sqlconnection question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • 00eric claption

    sqlconnection question

    I define the following code in a button click event:

    Dim cn As New SqlConnection( _

    "Server=(DBTEST \DBTEST;DataBas e=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.Argumen tException' occurred in
    system.data.dll

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

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

    Can anyone please help me? Thanks.


  • Cor Ligthert [MVP]

    #2
    Re: sqlconnection question

    Hi,

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

    All connection strings in one place. Find the syntax for your database connection using ADO.NET, ADO, ODBC, OLEDB, C#, VB, VB.NET, ASP.NET and more.


    I hope this helps,

    Cor

    "00eric claption" <a@b.com> schreef in bericht
    news:uwwilQpEGH A.2320@TK2MSFTN GP11.phx.gbl...[color=blue]
    >I define the following code in a button click event:
    >
    > Dim cn As New SqlConnection( _
    >
    > "Server=(DBTEST \DBTEST;DataBas e=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.Argumen tException' occurred in
    > system.data.dll
    >
    > Additional information: Invalid delimiter = found in the connection option
    > value. "
    >
    > *************** *************** *************** *************** *************** *************** *********
    >
    > Can anyone please help me? Thanks.
    >
    >[/color]


    Comment

    • Andrew Morton

      #3
      Re: sqlconnection question

      00eric claption wrote:[color=blue]
      > I define the following code in a button click event:
      > Dim cn As New SqlConnection( _
      > "Server=(DBTEST \DBTEST;DataBas e=pubs" _
      > & "Integrated Security=SSPI")[/color]

      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


      Comment

      Working...