lovemike2010
New member
- Joined
- May 26, 2011
- Messages
- 1
- Programming Experience
- Beginner
Hi all, I am using vb.net 2003 and Sql 2000 server when I am trying to connect to sql server it generates error.
it says "An unhandled exception of typw 'System.NullReferenceException' occurred in System.data.dll"
Here is the code. Please help me
Thank you in advance
Private Sub ConnectToSQL()
Dim con As New SqlConnection
Dim cmd As New SqlCommand
con.ConnectionString = "Data Source=(local);Initial Catalog=AACA_Library_db;Persist Security Info=True;User ID=lib;Password=lib"
con.Open()
End Sub
it says "An unhandled exception of typw 'System.NullReferenceException' occurred in System.data.dll"
Here is the code. Please help me
Thank you in advance
Private Sub ConnectToSQL()
Dim con As New SqlConnection
Dim cmd As New SqlCommand
con.ConnectionString = "Data Source=(local);Initial Catalog=AACA_Library_db;Persist Security Info=True;User ID=lib;Password=lib"
con.Open()
End Sub