Article View: borland.public.csharpbuilder.language.csharp
Article #185Error with MySqlAdapter.Fill
From: Till Merker
Date: Wed, 25 Oct 2006 07:23
Date: Wed, 25 Oct 2006 07:23
63 lines
3356 bytes
3356 bytes
Hello,
I got an error message every time when I run the code below. The code is
below, the last line is where the error occurs, could anybody
tell me why and how to solve it?
Thanks a lot!!
for int i=x i<y do (
MySqlCommand select = new MySqlCommand();
select.Connection = conn;
System.Console.WriteLine(select.Connection.State);
select.Parameters.Add("?Start", startDate);
select.Parameters.Add("?End", endDate);
MySqlDataAdapter adapter = new MySqlDataAdapter(select);
select.CommandText =
"SELECT * FROM ticket WHERE Processed = 1 AND CreateTime <= ?End AND " +
"(_EndTime IS NULL OR _EndTime >= ?Start) AND Network = '" + network +
"' ORDER BY TicketNo";
DataSet tickets = new DataSet();
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
adapter.MissingMappingAction = MissingMappingAction.Passthrough;
adapter.Fill(tickets, "Ticket");
System.Console.WriteLine("after filling tickets...");
ProgressDialog.Step();
select.CommandText =
"SELECT m.* FROM ticket t, milestone m WHERE Processed = 1 AND
t.CreateTime <= ?End AND " +
"(t._EndTime IS NULL OR t._EndTime >= ?Start) AND t.Network = '" +
network + "' " +
"AND t.ticketno = m.ticketno ORDER BY t.TicketNo";
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
adapter.MissingMappingAction = MissingMappingAction.Passthrough;
adapter.Fill(tickets,"Milestone");
-< Error appears here....!!!!!!
) end loop
errorstack looks like this:
Connection unexpectedly terminated
at MySql.Data.MySqlClient.PacketReader.Read(Byte[]&buffer,Int64 pos,Int64
len)
at MySql.Data.MySqlClient.PacketReader.Skip(Int64 count)
at MySql.Data.MySqlClient.PacketReader.OpenPacket()
at MySql.Data.MySqlClient.NativeDriver.OpenDataRow(Int32 fieldCount, Boolean
isBinary)
at MySql.Data.MySqlClient.CommandResult.Consume()
at MySql.Data.MySqlClient.MySqlDataReader.Close()
at MySql.Data.MySqlClient.MySqlDataReader.System.IDisposable.Dispose()
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data,Int32
startRecord,Int32 maxRecords,String srcTable,IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
.....
best regards,
Till
Technical Details
Message-ID:
<ehn3g1$bi9$1@daniel-new.mch.sbs.de>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed2.sbs.de!news.mch.sbs.de!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,9739105a48aeaa6c,start X-Google-Attributes: gid1efe35,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed2.sbs.de!news.mch.sbs.de!not-for-mail From: "Till Merker" <tillxz.merker@web.com> Newsgroups: borland.public.csharpbuilder.language.csharp Subject: Error with MySqlAdapter.Fill Date: Wed, 25 Oct 2006 15:23:55 +0800 Organization: Siemens Business Services Lines: 66 Message-ID: <ehn3g1$bi9$1@daniel-new.mch.sbs.de> NNTP-Posting-Host: 140.231.204.59 X-Trace: daniel-new.mch.sbs.de 1161761090 11849 140.231.204.59 (25 Oct 2006 07:24:50 GMT) X-Complaints-To: abuse@siemens.de NNTP-Posting-Date: Wed, 25 Oct 2006 07:24:50 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409