VB . NET tips and tricks

Aug 15, 2013   //   by kdecom   //   vb.net  //  No Comments

I am very much beginner for VB .Net application. So you might not find a very advanced level tips here but some basics which helps everyone in everyday development of Visual Basic . Net development.

Database connection string with windows authentication don’t works.

when i was new with VB .net i was trying to setup a temp database with temp tables and trying to display a record using a DataGrid view but for some reason it wasn’t working.

In my case it was something to do VS studio 2013 preview edition. Then i did download VS 2012 and its starts working. So there is some bug in VS 2013 editor.

 

 How to focus a textbox in vb.net

Here is a small code snippet for VB.net Developer to focus a textbox in form load.

 

Me.Show()
Application.DoEvents()
barcode.Focus()

 

how to force a text to 2 decimal places in vb .net

Format(Double.Parse(subtotal.Text), "0.00")
First it convert text to double which gets formatted to 2 decimal places. 
Output example:-

2 => 2.00
1.1234 => 1.12

Form KeyDown event is not firing or not working?

I got a simple solution just go to form and make sure keyPreview proporty of that form set to true.

KeyPreview = true

 

Leave a comment

css.php