N
Nick N.
Hi all,
I just started to play around with VB.Net.
I currenlty do Powerbuilder work and was wondering how database connection
management works in VB.net.
My applications typically pop-up a login window, attempts to connect to the
database (Sybase or MSSQL). Once the connection is established, it will open
a MDI Frame and the application will do whatever it is meant to do. (Mostly
reporting by SQL Query...in PB there is something called the Datawindow)
In Powerbuilder, there is a "global" variable called SQLCA which holds the
connection to the database and is accessible from any point in the
application given its global nature.
For instance, to connect to the database, I will set properties for the
SQLCA object then issue the following command:
connect using SQLCA;
then wherever I am in the application, I can reference the SQLCA object for
a valid database connection.
How is something like this done in VB.Net.
I managed to create a login window. I have the connection logic in the
clicked event of the OK button and it does connect to MS SQLServer 2K. Do I
have to then Pass the connection object to the MDI frame and other child
windows etc?
Or is there a cleaner way to do this?
I don't know if declaring a global oledbconnection object is the correct
thing to do.
Please advise!
Thanks
Nick
I just started to play around with VB.Net.
I currenlty do Powerbuilder work and was wondering how database connection
management works in VB.net.
My applications typically pop-up a login window, attempts to connect to the
database (Sybase or MSSQL). Once the connection is established, it will open
a MDI Frame and the application will do whatever it is meant to do. (Mostly
reporting by SQL Query...in PB there is something called the Datawindow)
In Powerbuilder, there is a "global" variable called SQLCA which holds the
connection to the database and is accessible from any point in the
application given its global nature.
For instance, to connect to the database, I will set properties for the
SQLCA object then issue the following command:
connect using SQLCA;
then wherever I am in the application, I can reference the SQLCA object for
a valid database connection.
How is something like this done in VB.Net.
I managed to create a login window. I have the connection logic in the
clicked event of the OK button and it does connect to MS SQLServer 2K. Do I
have to then Pass the connection object to the MDI frame and other child
windows etc?
Or is there a cleaner way to do this?
I don't know if declaring a global oledbconnection object is the correct
thing to do.
Please advise!
Thanks
Nick