Trying to connect SQL Server 2000 from VB. NET 2003

.net , sql server Bermuda
  • 14 years ago

    Hi,

    I am having a problem with connecting to SQL Server 2000 (Personal Edition) using VB .NET 2003 (Standard Edition).

    It works with MS Access using VB.NET 2003.  I have tried to download the SQL Server 2005 Express Edition to my machine and it failed due to .NET Framework 1.1 on my machine (Windows 2000 Professional). When I tried to download the .NET Framework 2.0 on my machine, it failed due to unsuccesful (I don't know why) from Windows Updates.

    Does anyone know how to connect the SQL Server 2000 to VB . NET 2003?

    I have been using SQL Server 2000 for two years now (on and off). I cannot afford to buy VB .NET 2005.

    I would appreciate your help. Thanks.

    Regena

  • 14 years ago

    Hope this one helps. Butl make sure you have reference to system.data.sqlclient

     

    Dim

    sqlConn As SqlConnection

    Dim sqlComm As SqlCommand

    Dim sqlReader As SqlDataReader

    Dim strSQL As String

    sqlConn =

    New SqlConnection("Persist Security Info=False;User ID=<your user id>; Password=<your password>; Initial Catalog=fy2006;Data Source=<server name>")

    sqlConn.Open()

    strSQL =

    "SELECT * from <Your Table>"

     

    sqlComm = sqlConn.CreateCommand

    sqlComm.CommandText = strSQL

    sqlReader = sqlComm.ExecuteReader

     

    Other codes here........

     

     

    Good luck!

    Reivax

  • 14 years ago

    Thank you Reivax.

    Will let you know if mine is worked.

     

    Regena

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity.” - Dennis Ritchie