J
joel
Hi guys,
I am a newbie in programming and i wonder how to do this..
Everytime i code forms i have to declare the connection string
sample:
Private Sub frmItems_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
SqlStrCon = "Data Source=Server1;Initial
Catalog=Inventory_DB;Integrated Security=True;User
ID=sa;password=1234"
SqlCon = New SqlConnection(SqlStrCon)
i thought this is wrong... because what if the server name changes and
i have 50 forms... i have to change every 1 of it.
how can i declare my connection string globally so that i dont have to
declare it everytime i code forms?
I hope i stated it clear...
any suggestion is very much appreciated guys!
joel
I am a newbie in programming and i wonder how to do this..
Everytime i code forms i have to declare the connection string
sample:
Private Sub frmItems_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
SqlStrCon = "Data Source=Server1;Initial
Catalog=Inventory_DB;Integrated Security=True;User
ID=sa;password=1234"
SqlCon = New SqlConnection(SqlStrCon)
i thought this is wrong... because what if the server name changes and
i have 50 forms... i have to change every 1 of it.
how can i declare my connection string globally so that i dont have to
declare it everytime i code forms?
I hope i stated it clear...
any suggestion is very much appreciated guys!
joel