samoht
unread,Nov 6, 2008, 3:57:20 AM11/6/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to H2Sharp
This is the call stack
System.NotSupportedException: Only CommandBehavior Default is
supported for now.
at System.Data.H2.H2Command.ExecuteReader(CommandBehavior behavior)
in C:\H2Sharp-Release\\H2Sharp\\H2Command.cs:line 387
at System.Data.H2.H2Command.ExecuteDbDataReader(CommandBehavior
behavior) C:\in H2Sharp-Release\\H2Sharp\\H2Command.cs:line 374
at
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior
behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables,
Int32 startRecord, Int32 maxRecords, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at EmbeddedFirebirdExample.Form1.button1_Click(Object sender,
EventArgs e) in Form1.cs:line 93
the reason is this method:
public new H2DataReader ExecuteReader(CommandBehavior behavior)
{
if (behavior != CommandBehavior.Default) { throw new
NotSupportedException("Only CommandBehavior Default is supported for
now."); }
CheckConnection();
EnsureStatment();
try
{
return new H2DataReader(statement.executeQuery());
}
catch(org.h2.jdbc.JdbcSQLException ex)
{
throw new H2Exception(ex);
}
}
I changed it to following:
public new H2DataReader ExecuteReader(CommandBehavior behavior)
{
CheckConnection();
EnsureStatment();
try
{
ResultSet set = statement.executeQuery();
if
((behavior&CommandBehavior.SingleResult)==CommandBehavior.SingleResult)
{
set.next();
}
return new H2DataReader(statement.executeQuery());
}
catch(org.h2.jdbc.JdbcSQLException ex)
{
throw new H2Exception(ex);
}
}
Now it works but i don't know if this is correct