Hi i got a question for you guys.
I am trying to write a program in C# that communicates with a database. I have:
1) main_prog class
2) Object_reader class
main_prog is the main program, and object_reader is a class which has all the function to communicate with the database(collect_to, close, etc..)
My main form has a bunch of buttons. One of the buttons is a "load_record".
On the click of that button i instanciate a new object_reader object, open the connection and load the first record. Here is where my question is:
After the use clicks that button i want to keep the connection open and just pass the instance of that object to another button's click event. This way I dont have to open a new connection, do whatever, and close the connection for every button clicked.
Do you guys understand my question. Here is another example:
class my_class
{
bla bla blah
}
class main_prog
{
button1_click(.....)
{
my_class thisclass = new my_class
}
button2_click(i want to pass thisclass to here)
}
ok guys. any help is greatly appreciated.. thanx a lot
I am trying to write a program in C# that communicates with a database. I have:
1) main_prog class
2) Object_reader class
main_prog is the main program, and object_reader is a class which has all the function to communicate with the database(collect_to, close, etc..)
My main form has a bunch of buttons. One of the buttons is a "load_record".
On the click of that button i instanciate a new object_reader object, open the connection and load the first record. Here is where my question is:
After the use clicks that button i want to keep the connection open and just pass the instance of that object to another button's click event. This way I dont have to open a new connection, do whatever, and close the connection for every button clicked.
Do you guys understand my question. Here is another example:
class my_class
{
bla bla blah
}
class main_prog
{
button1_click(.....)
{
my_class thisclass = new my_class
}
button2_click(i want to pass thisclass to here)
}
ok guys. any help is greatly appreciated.. thanx a lot