Welcome

June 2, 2010 - 18:11

Welcome to SimpleVB.Net, I hope to share with you some of my experience as a programmer, where i have managed to obtain a large amount of code samples for various issues i have come accross.

When programming most of my time is spent refering back to old code in the past and simply just reusing the same code. Any of the examples on this website should be working and ready for you to just cut and paste into your application. I try and cover all the most common topics from Database connection, File I/O and image manipulation.

I expect most people who use this archive to have a basic knowledge of programming in .Net and probably already have used some of the functions described here, but perhaps cannot find the example they have used before or just want to be able to find it quickly without too much waffle about how the code works.

If you have any queries then please contact me on neil@NOSPAMcrutchlow.co.uk

Read in the contents of a webpage to a string.

02/09/2010 07:20:24

You may wish to display the contents of a feed from another website or grab data from another website and perform some processing on this information and then redisplay on your own site.

How to dynamically create a word document in ASP.NET

31/07/2010 05:30:00

The easiest way i have found to generate a word document from website content is to use the feature of word to read in HTML documents and display as a normal word document.

Convert an image to a byte array.

16/07/2010 10:14:03

You should have your image stored in the "myimage" variable, and then use the below code to convert to a .Png format and save into the "mybytearray" array.

Convert a byte array into an image.

16/07/2010 10:13:38

The binary array "mybytearray" should contain your image data, then use the below code to convert this into an image usable by VB.Net.

Open and Read files in VB.Net

15/07/2010 15:17:56

To read the entire contents of a file first we must open the file and specify the access mode by using the System.IO namespace. This class also allows various file operations such as delete, copy, and checking for the existance of a file.

Write a string to a file in vb.net

15/07/2010 15:15:30

Writing to a file works very similarly to when reading a file. The filestream is created passing the details of the filename and type of access.

Send an email from a webpage with asp.net

15/07/2010 15:06:19

Emailing with .net is fairly simple. You will also need to know an SMTP mailserver which you have permission to relay from, otherwise you will recieve an error 550.

Run a query on an sql database in VB.Net

14/07/2010 17:09:07

Connecting to a microsoft sql database is done by first creating the database on your server and assigning the correct username and password. Once this is done then create your connection string. This will look something like this:

Hide and display a div element using javacript

14/07/2010 06:26:01

You may wish to hide or display a certain area of your website when the user clicks on a mouse. To do this first you need to create your area which will be hidden to begin with, and then later displayed using the javascript.

 
 

© 2010 simplevb.net