I'm using the source code like this:
Database db1 = new Database(); //init 1 db connection
db1.BeginTransaction();
//this function used to check exist customer
//in this function, I also use Database db2 = new Database(); db2.Close();
CheckExistCustomer();
InsertCustomer(db1, strInsert); //this function worked correct, use db1
if(iErrorCode == ErrorStatus.SUCCESSED)
db1.CommitTransaction();
else db1.RollbackTransaction();
As you see, I have 2 db connections. Can I use them? When db2.Close(), it won't affect to current db1, right? Should I use only 1 db connection (db1)?
When I run CheckExistCustomer(), the program will hang on. I don't know why. Any clue?
Please advise.
I'm very appriciated for your help.