Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
i am using a class file for creating connections and also for executing queries. from the class file am assigning the connection string in session. is it a wrong practice or not? is it lead to hacking the database or not?

i am using mysql database driver 3.5
Posted
Updated 4-Feb-15 23:19pm
v2

Is there any specific requirement for storing connection string in session?
I don't think anyone would do that.
Best place to keep connection strings are configuration files.
 
Share this answer
 
 
Share this answer
 
connection string is global to the whole web app, just keep it inside the web.config, refer: Store connection string in web.config[^]
 
Share this answer
 
Comments
Thanks7872 5-Feb-15 7:19am    
This answer has nothing to do with question. I don't know who voted 5 for this.

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



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