troubleshooting Question

ASP.NET data base connection

Avatar of ybt
ybt asked on
Web DevelopmentASP.NETC#
35 Comments4 Solutions315 ViewsLast Modified:
Hello, I'm just switch from C# winform to webforms and do not know how to make DB connection created in login page accessible from other pages, in login I created:
SqlConnection DbConn = new SqlConnection("user id='"+ls_user+"';password='"+ls_pwd+"';server=server_nameL;database=db_name; Trusted_Connection = False;connection timeout=30;");

To get a data from DB in other pages< I need to use DbConn.
What should I do?
Kyle Abrahams
Director of Information Technology

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 4 Answers and 35 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 35 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros