How to connect to a Data Base?

How do I connect, read from, and write to a sql server 2000 data base via C#.NET 2005?

  • I can write applications in C#.NET 2005, and can make databases in MS SQL Sever 2000. Now I want to access this database using my application. How would I go about doing that?

  • Answer:

    To Connect use: System.Data.SQLClient.SQLConnection Connection String: Provider=sqloledb;Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword; To Access use: System.Data.DataTable System.Data.DataSet Hope this helps, Cheers

world_cl... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.