Thread View: borland.public.csharpbuilder.language.csharp
1 messages
1 total messages
Started by Till Merker
Wed, 25 Oct 2006 07:23
Error with MySqlAdapter.Fill
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads