“Keyword not supported: ” error in ASP .NET

ado.netasp.net

i get a Keyword not supported: '192.168.1.1;initial catalog'. error when trying to do this

Dim cn As New SqlConnection(str)

where str is the connection string starts with '192.168.1.1;initial catalog' …
I have not specified the provider in the connection string

Best Answer

you need to provide a properly formatted connectionstring such as:

Dim str As String
str = "Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;"

Dim cn As New SqlConnection(str)