Welcome
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
Get requested webpage URL with asp.net
Sometimes its useful to know what web page has been requested by your web browser.
Geocode with google maps api in ASP.Net
I have spent many hours trying to find a free way to do postcode lookups and obtain the longitude and latitude. A few websites provide this service, but unfortunately i have found that after a few months the websites no longer work, or restrict the number of lookups each day.
How to delete SQL transaction logs with a query.
When using a Microsoft SQL server regularly, you may find that the transaction log can get quite large. If an import is ran every day then the database log file can quickly grow to several gigabytes.
Read data from an XML file in VB.Net
XML is a very flexable file format used to contain data. I often use XML configuration files for applications now instead of a .ini text file, as this type of file is better suited to complex configuration data for your application.
Change the document type using MIME
When any webpage is returned back to the browser a type is specified which indicates what type of document is being returned. Normally this would be a standard html document and this is rendered in the browser.
How resize an image using GDI+
Resizing of images is very important when designing web applications, as you don't really want to have 4 megabyte images displayed on your web pages. Ideally you want to create a thumbnail image of those, and display that. When the user clicks on this image, then display original Image.
How to change the quality of jpeg images using GDI+
Sometimes the standard functions for converting images to jpeg's isn't of a high enough quality. Perhaps you are converting map images or high resolution text documents, where the jpeg artifacts are easily seen.
Create a new bitmap image and draw a line
Many applications require that images are dynamically created especially for the user in websites. I normaly do this when ploting graphs or adding watermarking on images as they are displayed instead of having numerous duplicated saved images on the server.
Case insensitive replace on a string
I'm sure everyone is familiar with the replace function which replaces all occurances of a string with another string, however this can also be done with the same function but ignoring the case of the compare string.
Setup a 301 permanent redirect using asp.net
A permanent 301 redirect is very usefull if you have recently moved or redesigned your website. Search engines will have references to your old pages and also any links from other websites may refer to your old pages. To keep any search engine ranking then you must add this redirect, and over time all the references will update to your new pages.