“Keyword not supported: ” error in ASP .NET


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

Dim cn As New SqlConnection(str)

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

Best Solution

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)