SQL Connection ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marylipscomb
    New Member
    • Apr 2007
    • 51

    SQL Connection ??

    I am trying to connect to a sql server 2000.

    I keep getting errors.. HELP Please!!!


    Partial Class projectdevelopm entmain


    Inherits System.Web.UI.P age
    DIM SQLClient.SqlCo nnection as conn
    Dim conSQL As New SQLClient.SqlCo nnection()
    conSQL.Connecti onString= "Integrated Security=True;" &_
    "Data Source =LocalHost;Init ial Catalog=PDDB;"
    conSQL.Open()

    End Class

    I get end of statement expected and I dont know what that means.
    Declaration expected?/

    HELP Please.

    TIA!!!!
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Have you checked:
    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.

    Comment

    • marylipscomb
      New Member
      • Apr 2007
      • 51

      #3
      by the way, I am using VB.NET and ASP.NET... trying to connect to the SQL Server 2000

      Comment

      • marylipscomb
        New Member
        • Apr 2007
        • 51

        #4
        no but I will try it, thanks!!

        How do I know where my server address is??

        Comment

        • marylipscomb
          New Member
          • Apr 2007
          • 51

          #5
          when I use this line it says there is a declaration expected on the Driver.

          Driver={SQL Server};Server= local;Database= PDDB;Trusted_Co nnection=Yes;

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            You said you were using sql server 2000 right?

            That website says:
            Code:
            Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
            is the example connection string.


            An alternative is to go through the wizzard in visual studio and then look at the connection string it creates and use that.

            Comment

            Working...