Hello all,
This is probably a simple one...
Right now I have a working web service (programmed in c#) and it offers up two webmethods that either read or write data to a MS SQL database. What I want to know is this... Do I have to worry about errors when multiple users try to connect to, reading from, and writing to the database? Furthermore, should I be using threads and locks in my webmethods when they access the database (right now, I'm not using threads or locks)?
Here is some idea of what I have running now (code snippet):
[WebMethod(Description = "Attempts to post a new score to the scoreboard.")]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public TextMessage UpdateScoreboard(string password, string playerName,
int level, int gameBoard, string auth)
{
SqlDataReader myReader = null;
SqlCommand myCommand = null;
SqlConnection myConnection = null;
/*
The method then attempts to connect to the DB,
look for a duplicate playerName, and if there isn't one,
data is entered into the DB ... using the INSERT command.
*/
}
Thanks.