MySqlAdapter.Fill Error...

This is a discussion on MySqlAdapter.Fill Error... within the MySQL Database forums, part of the Database Forums category; Hello, I got an error message every time when I run the code below. The code is below, the last ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-25-2006
Till Merker
 
Posts: n/a
Default MySqlAdapter.Fill Error...

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(In t32 fieldCount, Boolean
isBinary)
at MySql.Data.MySqlClient.CommandResult.Consume()
at MySql.Data.MySqlClient.MySqlDataReader.Close()
at MySql.Data.MySqlClient.MySqlDataReader.System.IDis posable.Dispose()
at System.Data.Common.DbDataAdapter.FillFromCommand(O bject data,Int32
startRecord,Int32 maxRecords,String srcTable,IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
......

best regards,

Till









Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:19 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0