I have the following code in the page_load event of page Default.aspx:
Imports System.Data
Imports System.Data.SqlClient
Partial Class _Default
Protected Sub page_load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not IsPostBack Then
Dim conn As New SqlConnection
conn.ConnectionString = "Dsn=Wic;uid=sa;pwd=flatfive"
End If
End Sub
End Class
When I run this code it gives me the error stated in the Subject.
The Dsn is valid. I use it to connect to SQL server often.
What am I doing wrong?
Imports System.Data
Imports System.Data.SqlClient
Partial Class _Default
Protected Sub page_load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not IsPostBack Then
Dim conn As New SqlConnection
conn.ConnectionString = "Dsn=Wic;uid=sa;pwd=flatfive"
End If
End Sub
End Class
When I run this code it gives me the error stated in the Subject.
The Dsn is valid. I use it to connect to SQL server often.
What am I doing wrong?