Home All Groups Group Topic Archive Search About

sqlconnection question

Author
6 Jan 2006 7:38 AM
00eric claption
I define the following code in a button click event:

Dim cn As New SqlConnection( _

"Server=(DBTEST\DBTEST;DataBase=pubs" _

& "Integrated Security=SSPI")

***************************************************************************************************

I got this error when I trigger the button click event and error stop at the
code:

"An unhandled exception of type 'System.ArgumentException' occurred in
system.data.dll

Additional information: Invalid delimiter = found in the connection option
value. "

***************************************************************************************************

Can anyone please help me? Thanks.

Author
6 Jan 2006 8:35 AM
Cor Ligthert [MVP]
Hi,

Your first opening ( is for sure wrong. Has not even to be there.

www.connectionstrings.com

I hope this helps,

Cor

Show quoteHide quote
"00eric claption" <a@b.com> schreef in bericht
news:uwwilQpEGHA.2320@TK2MSFTNGP11.phx.gbl...
>I define the following code in a button click event:
>
> Dim cn As New SqlConnection( _
>
> "Server=(DBTEST\DBTEST;DataBase=pubs" _
>
> & "Integrated Security=SSPI")
>
> ***************************************************************************************************
>
> I got this error when I trigger the button click event and error stop at
> the code:
>
> "An unhandled exception of type 'System.ArgumentException' occurred in
> system.data.dll
>
> Additional information: Invalid delimiter = found in the connection option
> value. "
>
> ***************************************************************************************************
>
> Can anyone please help me? Thanks.
>
>
Author
6 Jan 2006 10:06 AM
Andrew Morton
00eric claption wrote:
> I define the following code in a button click event:
> Dim cn As New SqlConnection( _
> "Server=(DBTEST\DBTEST;DataBase=pubs" _
> & "Integrated Security=SSPI")

You're missing a semi-colon between pubs and Integrated.

And as Cor pointed out, it's unlikely the server's name starts with (.

Andrew