Hi,
I would try this:
Dim strConnection as string = cstr(myReader.item(conn))
Then set a breakpoint at the next line, and make sure the Connection string
is correct:
breakpoint at: Dim cnSqlServer as new SqlConnection(strConnection)
Connection string should look like this:
"Data Source=\\Servername;Initial Catalog=DatabaseName;User
Id=something;Password=something;"
Btw when can you connect to the server if you type the connection string in
the program and don't get it from the reader?
Greetz Peter
"Agnes" <ag***@dynamictech.com.hk> schreef in bericht
news:#u**************@TK2MSFTNGP09.phx.gbl...
As i run the form ,unknow command "user id"
"Peter Proost" <pp*****@nospam.hotmail.com>
¼¶¼g©ó¶l¥ó·s»D:ea***************@tk2msftngp13.phx. gbl...
Hi,
What's your error? And have you got option strict on turned on, so you
can check it's not a converting error
Greetz Peter
"Agnes" <ag***@dynamictech.com.hk> schreef in bericht
news:ut**************@TK2MSFTNGP12.phx.gbl... I want to use a table store the database connection. (e.g myDBC)
I use cmdReader to get the string from that table sucesfully and then
want
to create it .
Dim strConnection as string = myReader.item(conn)
Dim cnSqlServer as new SqlConnection(strConnection)
I check that I can get the strConnection very well. (e.g
"server=MyServer;
database=Account;user id =sa;password=;")
However, as newSqlConnection(strConnection) it got errors.
Does anyone try this similar approach ?? Thanks a lot