Web service accessing client database
I am new to web services and i have a question: Should a web service be able to access the client database? Sorry if开发者_StackOverflow中文版 i am not using the proper terms.
Lets say i have a web service method called :GetCarDetails(string name)
which will actually return details from car table.
in this method i have an sql statement like SELECT * FROM car WHERE name = ?.
In the client application, i have a textbox where i can input a name and a button on which when i click, fill a gridview.
So im kinda confused, should the web service normally know that the client has a table called car?Please correct me if ive used the wrong terms.
ThanksNormally, a web service method would not access a client database. Instead, there would be one database on the server which the web service method would read and write to. A client would call a web service method like GetCarDetails, and inside that method (executing on the server) the SELECT statement would be run and the data returned from the method in some format (a DataTable, XML, object collection or whatever). Usually (not always) the clients have no databases whatsoever on their end.
精彩评论