7 messages in com.mysql.lists.dotnetRe: Dataadapter doesn't disconnect?| From | Sent On | Attachments |
|---|---|---|
| Bryan Luisana | 02 Feb 2005 10:46 | |
| Jorge Bastos | 02 Feb 2005 12:50 | |
| Jorge Bastos | 02 Feb 2005 13:26 | |
| Jorge Bastos | 02 Feb 2005 13:37 | |
| Bryan Luisana | 02 Feb 2005 13:47 | |
| Jorge Bastos | 02 Feb 2005 14:22 | |
| Reggie Burnett | 03 Feb 2005 10:15 |
| Subject: | Re: Dataadapter doesn't disconnect?![]() |
|---|---|
| From: | Jorge Bastos (mysq...@decimal.pt) |
| Date: | 02/02/2005 01:26:47 PM |
| List: | com.mysql.lists.dotnet |
Well one thing i know is that you can't open it, my vb example:
dim MyCon as new mysalconnection(constr) dim sql as string = "select * from blabla" dim MyDa as new mysqldataadapter(Mycon , sql) dim dt as new datatable myda.fill(dt)
That's the way i use it and have no problems
----- Original Message ----- From: "Bryan Luisana" <blui...@earthlink.net> To: "Jorge Bastos" <mysq...@decimal.pt> Sent: Wednesday, February 02, 2005 9:15 PM Subject: Re: Dataadapter doesn't disconnect?
I have seen and experiemented with plenty of examples where you can open
and close the connection manually using a dataadapter. The dataadapter is supposed to open the connection if it is closed and then close the conneciton itself. You can overide this default functionality though. No mater what I do using the mysqldataadapter I can't get the connection to the database to close. It doesn't close itself and I am unable to force it to close.
-----Original Message----- From: Jorge Bastos <mysq...@decimal.pt> Sent: Feb 2, 2005 3:50 PM To: dot...@lists.mysql.com Subject: Re: Dataadapter doesn't disconnect?
You can't open the connection when using the dataadapter, it open's and close's the connection automatly
----- Original Message ----- From: "Bryan Luisana" <blui...@earthlink.net> To: <dot...@lists.mysql.com> Sent: Wednesday, February 02, 2005 6:47 PM Subject: Dataadapter doesn't disconnect?
Hello,
Is anyone else having an issue when using the a mysqldatadapter.
Even doing something as simple as the code below creates a conneciton
that
sleeps after I
am done with it. This means that everytime a new user connects to my webpage a new conneciton is made untill the mysql max connections is reached.
MySqlConnection connection = new MySqlConnection(constr);
MySqlCommand myCommand = new MySqlCommand(sqlCommand); myCommand.CommandType = CommandType.Text;
myCommand.Connection=connection; MySqlDataAdapter dataAdapter = new MySqlDataAdapter(myCommand); DataTable myDataTable = new DataTable();
try { connection.Open(); dataAdapter.Fill(myDataTable); connection.Close(); connection.Dispose(); dataAdapter.Dispose(); }
Neither the close nor the dispose method makes the connection to the database close?
HELP!!
-- MySQL on .NET Mailing List For list archives: http://lists.mysql.com/dotnet To unsubscribe: http://lists.mysql.com/dotnet?unsub=mysq...@decimal.pt
-- MySQL on .NET Mailing List For list archives: http://lists.mysql.com/dotnet To unsubscribe: http://lists.mysql.com/dotnet?unsub=bry...@pobox.com




