7 messages in com.mysql.lists.dotnetRe: Dataadapter doesn't disconnect?
FromSent OnAttachments
Bryan Luisana02 Feb 2005 10:46 
Jorge Bastos02 Feb 2005 12:50 
Jorge Bastos02 Feb 2005 13:26 
Jorge Bastos02 Feb 2005 13:37 
Bryan Luisana02 Feb 2005 13:47 
Jorge Bastos02 Feb 2005 14:22 
Reggie Burnett03 Feb 2005 10:15 
Subject:Re: Dataadapter doesn't disconnect?
From:Bryan Luisana (blui@earthlink.net)
Date:02/02/2005 01:47:01 PM
List:com.mysql.lists.dotnet

Ooops,

Thanks for the reply. It seems like the connector/net project has been going on
for long enough that someone would have noticed if the dataadapter couldn't
release connections. I feel like I must be missing something. In a desktop
application you probably wouldn't really notice this because you are only going
to open the connection once during the life of you application. In a web app
you are instantiating the datadapter everytime a page loads so you will quickly
see the connections adding up if you allow the user to do something like refresh
a datagrid.

desktop reply to the list instead of the sender i don't have problems with that, is just to everybody see it don't understand me wrong

----- Original Message ----- From: "Bryan Luisana" <blui@earthlink.net> To: "Jorge Bastos" <mysq@decimal.pt> Sent: Wednesday, February 02, 2005 9:36 PM Subject: Re: Dataadapter doesn't disconnect?

Are you using it in desktop app or in a web app?

-----Original Message----- From: Jorge Bastos <mysq@decimal.pt> Sent: Feb 2, 2005 4:27 PM To: dot@lists.mysql.com Subject: Re: Dataadapter doesn't disconnect?

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!!