[Newbie] db web service

Feb 4 2005 1:44 PM
Im very new to c# and web services etc and Im having some difficulty understanding how they work. I have a projec to do which involves creating a web service that handles connections to sql db, performs queries etc on the db. What I dont understand is how you handle continuity between the methods for a webservice. For example I have public methods which, construct the connection string, opens the connection, closes the connection and performs a select on the database. These are all seperate methods though the open and close are called from the select method. The sql connection string is stored in a private variable in the web service. Is it possible to do it like this? If I call the connection string method first to set the private variable and then the open method will the open method see the value I set? Using the debugging in Visual Studio and accessing the methods directly didnt work for me but I dont know if it will work if called from an asp.net page. Like I said Im new to this so I dont fully understand how it works. Id appreciate any help or advice.

Answers (1)