views:

29

answers:

2

Hi ,

I am going to program windows application with c# and SQL server 2000 The Program use one central Database and all other versions of the program running on other computers in local network use this central Database on the server computer

But i have no idea about how to implement client/server application

After a lot of searches i found all i need is to specify the ip of the DB server in the connection string

So this is my questions ...

  1. IS the only change i need is to specify the ip of the DB server in connection string ?

  2. Does the client computer need any other programs in addition to my program (database client tools or any other libraries) ?

  3. I found a lot of articles talking about Network Libraries like (dbmssocn, dbmsrpcn, dbmsspxn) , so what is the use of these libraries ? and how can i use them in my code ? and which one is better ?

  4. Any links to sample programs or articles covering this topic are very welcome

Thanks in advance

A: 

Wow - what a big question.

Since this is Microsoft SQL Server, much of this will be easy for you. Use System.Data.SqlClient.SqlConnection (create a new instance, then call the .Open() method to open a connection. Use the System.Data.SqlClient.SqlCommand (create a new instance) - and set the .CommandText to the statement or stored procedure that you want to run, then call something like ExecuteReader() to go run the statement and bring back a reader.

Note - when you open the database connection, you will need to specify a connection string. If you don't know how to make a connection string, you have two options:

  • Go to http://www.connectionstrings.com/ and follow the directions
  • Create a new, empty (zero-byte) file on your desktop called something like test.udl. Now, double click on that file and that will start the UDL wizard, again, follow the steps. When done, save the changes, then open that file with Notepad to see the complete connection string.

Good luck!

Robert Seder
both sides of the connection need to be able to communicate with one another. - http://www.databasejournal.com/sqletc/article.php/1569851/Solving-SQL-Server-Connection-Problems.ht. When you do run into problems, read the error logs, error logs, error logs!!!!
MaasSql
A: 

thanks for the wizard ,

So all what i need to change in my code is the connection string to refer to the ip of the DB server

But Do i need to install any other programs on the client computer (DB client tools)??

And what about the Network Libraries ??

PS: I already know ado.net basics and can use it with local DBs , but the problem with remove or server based DBs

Thanks in advance

pcprogramer