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/ser开发者_JAVA技巧ver 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 ...
IS the only change i need is to specify the ip of the DB server in connection string ?
Does the client computer need any other programs in addition to my program (database client tools or any other libraries) ?
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 ?
Any links to sample programs or articles covering this topic are very welcome
Thanks in advance
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!
The only thing to do is to specify the name or the IP address of your server in your connection string and you can install the application in your clients stations by using the publishing to a specific folder in your network.
精彩评论