|
-
Jan 17th, 2007, 02:10 AM
#1
Thread Starter
Junior Member
connection to database
i use visual web developer n microsoft sql server for database,so my source code for connection to database
Dim sqlConn As SqlConnection = New SqlConnection()
sqlConn.ConnectionString = "Data Source=NORA;Initial Catalog=myAccount;User Id=sa;Password=password;"
sqlConn.Open()
my questions is:
everytime i want access data from database, i need to write this source code,, so if have 10 page that need acces to database, i have to write the same source code, if i need to change the location of server, i need to modify the source code in all pages,
so i hope anybody can give me solution where i do need to write repeatly the same code, my plan is want to write the source code for connection in some file or some place, and invoke or call them as many times as my application needs..
please help me now
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|