Click here to Skip to main content
15,889,992 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a desktop application , which verifies the finger and prompt the result
i am calling that app in wpf, than this all is showing in asp.net

on asp.net user put the finger, results comes to him How its Done?
on asp.net i created a static class & a web-service having a two static members which gets 'query' & connection string,
these both member set by asp.net i.e


C#
button1_click(){
      string querry="select * from employee where userid='123'";
        string connString="Data Source=mypc;Initial Catalog=abc;Persist Security Info=True;User ID=re;Password=12345
    ";
    
    StaticClass.Querry=querry;
    StaticClass.ConnStr=connString;
}


value setting in webserivce

C#
[WebMethod]
      public string Querry()
      {



          string SelectDataQuerry = StaticClass.Querry;

          return SelectDataQuerry ;
      }




desktop application subscribed the web-service which gets and give data.all is well ,NOW then i hosted the application on IIS,
multiple users are using the application now, on the same time, user1 set the query while user2 gets it.
i want to make it multi user, so whats the suggestion, should i create static strings dynamically as much as users create requests which uniquness or any thing else?
Posted
Updated 24-Jul-15 3:30am
v2
Comments
F-ES Sitecore 24-Jul-15 9:38am    
I don't really understand your question, you haven't explained the architecture very well, but the answer is going to be to not use static variables as they are shared across all users of a website

1 solution

Not really sure if I understood your question correctly, but...

From what I gather is that using a web service you transfer a SQL query from the server to the client. Why would you do that. If the server is connected to the database in most situations the client should know nothing about the database and vice versa.

What comes to the string handling, why do you use a static string in the first place if the content of the string depends on the id from the calling side. If you want to have a common identifier between the callers, when the string is set, return a unique id which is then again used when fetching the string. Unique id's and corresponding string may reside in a database or somewhere else where they are easily shared.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900