views:

2483

answers:

3

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

+3  A: 

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)
lomaxx
+2  A: 

You have to specify the database with the keyword "Data Source" or "Server". Here's an example:

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
Barry Dorman
A: 

how do you creat an user id and pssword????