G
Guest
Hi,
I'm developing an Windows forms based app that will draw data from a SQL
Server 2000 system, that is set to use SQL Authentication (i.e. connection
string must pass unameword).
Given that various forms will need to use a SQL connection to generate data
for data grid's etc ... how can I pass this authentication information around
the various forms?
A solution is to start the application from a VB.NET class, that has a
shared member with the connection string (set once the user completes the
login)
Or create a shared connection object? Should I create a new connection
object for each form?
I currently test whether the login credentials are correct by enclosing
within a try..catch clause an attempt to open and close a connection, failure
will indicate invalid details (or perhaps a dead SQL Server!) ... any
improvements on this?
I assume that when using the form designer in VS.NET that if I manually
program the connection (i.e. outside the section of code written by VS.NET )
that I can point the adapters/datasets etc. to the required connection.
There are a few questions here ... but I've not so far found any answers
here, on Google or elsewhere !
Thanks in advance for help
I'm developing an Windows forms based app that will draw data from a SQL
Server 2000 system, that is set to use SQL Authentication (i.e. connection
string must pass unameword).
Given that various forms will need to use a SQL connection to generate data
for data grid's etc ... how can I pass this authentication information around
the various forms?
A solution is to start the application from a VB.NET class, that has a
shared member with the connection string (set once the user completes the
login)
Or create a shared connection object? Should I create a new connection
object for each form?
I currently test whether the login credentials are correct by enclosing
within a try..catch clause an attempt to open and close a connection, failure
will indicate invalid details (or perhaps a dead SQL Server!) ... any
improvements on this?
I assume that when using the form designer in VS.NET that if I manually
program the connection (i.e. outside the section of code written by VS.NET )
that I can point the adapters/datasets etc. to the required connection.
There are a few questions here ... but I've not so far found any answers
here, on Google or elsewhere !
Thanks in advance for help