connection string
-
Hi Everyone, In my website when user login then I make connection string and store connection to the class in static variable. when user navigation different page in site I take connection string from class file and create connect to the DB. But my problem is that when another user login the first user connection string was change to last user connection string, reason is static variable. There is any solutions.....please help me out Thanks Raj
-
Hi Everyone, In my website when user login then I make connection string and store connection to the class in static variable. when user navigation different page in site I take connection string from class file and create connect to the DB. But my problem is that when another user login the first user connection string was change to last user connection string, reason is static variable. There is any solutions.....please help me out Thanks Raj
connection string are best stored in the
web.config
.Yusuf May I help you?
-
connection string are best stored in the
web.config
.Yusuf May I help you?
Hi Yusuf, Thanks for reply. I know about web.config , but think is that there is website like shopping site, www.shopping.com but this website may have multiple database. DB-1, DB-2. But I don't know the database name and login details of database, its come through another database, After getting dbnam, userid, pwd I create connection string in class file. I will receive that value whole site. did you get my point
-
Hi Yusuf, Thanks for reply. I know about web.config , but think is that there is website like shopping site, www.shopping.com but this website may have multiple database. DB-1, DB-2. But I don't know the database name and login details of database, its come through another database, After getting dbnam, userid, pwd I create connection string in class file. I will receive that value whole site. did you get my point
-
Hi Everyone, In my website when user login then I make connection string and store connection to the class in static variable. when user navigation different page in site I take connection string from class file and create connect to the DB. But my problem is that when another user login the first user connection string was change to last user connection string, reason is static variable. There is any solutions.....please help me out Thanks Raj
vnsraj wrote:
But my problem is that when another user login the first user connection string was change to last user connection string,
Can you please explain your business requirement, I am not able to understand that why connection of database changed based on user.:confused:
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net
modified on Friday, May 8, 2009 1:13 AM
-
Hi Everyone, In my website when user login then I make connection string and store connection to the class in static variable. when user navigation different page in site I take connection string from class file and create connect to the DB. But my problem is that when another user login the first user connection string was change to last user connection string, reason is static variable. There is any solutions.....please help me out Thanks Raj
Hi, try to check again your connstring: www.connectionstrings.com
Hope this one can help. Thanks Hi, Please select Good Question if my answer are fit to your Question.
-
Hi Everyone, In my website when user login then I make connection string and store connection to the class in static variable. when user navigation different page in site I take connection string from class file and create connect to the DB. But my problem is that when another user login the first user connection string was change to last user connection string, reason is static variable. There is any solutions.....please help me out Thanks Raj
Storing the connstring to Session is a good way so each user will hold his own connstring. Static variable is used at the Appliction level, which leads to your problem.
Welcome to www.softwaretree.net! This website is generated completely by static html pages transforming technology. You can find many excellent audio/video tools there!
-
Hi Everyone, In my website when user login then I make connection string and store connection to the class in static variable. when user navigation different page in site I take connection string from class file and create connect to the DB. But my problem is that when another user login the first user connection string was change to last user connection string, reason is static variable. There is any solutions.....please help me out Thanks Raj
hi the connection string will change to the last user why?because you put it in static variable it's means that this variable is shared for all users of application .so when any user assign it,it has only the last value. for example if we have static variable called x.the first user assign it by 5 .the second user assign it by 10. it becomes 10 not 5 . don't use static variable in this case. Essam