G
Guest
Hello,
I am try to update a row in a database (Basis 9.1) with this code:
OdbcConnection con= null;
OdbcTransaction tran = null;
try
{
con = new OdbcConnection("DSN=BASIS
administration;DBUPW=*****;UID=*****;DBUID=*****");
con.Open();
OdbcCommand command = new OdbcCommand("update NPAGA_NPAGA.T_USUA set
USU_MOD='01;02' where USU_ID='pppppppp' ",con);
OdbcDataReader a = command.ExecuteReader(CommandBehavior.SingleResult);
a.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace);
}
finally
{
con.Close();
}
when i execute this code I get the next error:
ERROR [IM001] [Microsoft][ODBC Driver Manager] Driver does not support this
function
stack:
at System.Data.Odbc.OdbcConnection.HandleError(HandleRef hrHandle,
SQL_HANDLE hType, RETCODE retcode)\r\n at
System.Data.Odbc.OdbcDataReader.NextResult()\r\n
at System.Data.Odbc.OdbcDataReader.FirstResult()\r\n
at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior
behavior, String method)\r\n at
System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior)\r\n at
conbasis.Form1.Grabar_Click(Object sender, EventArgs e) in
d:\\alvaro\\conbasis\\form1.cs:line 173
the problem is in the NextResult().The Basis driver do not support the
nextresult command. The update work in the table but I receive the error. If
I want to work with transactions the update do not work (automatic rollback)
and it's no posible to do the update.
How can I do to eliminate the automatic nextresult?
If I change ExecuteReader and put executenonquery I get the same error.
Thanks
Alvaro
I am try to update a row in a database (Basis 9.1) with this code:
OdbcConnection con= null;
OdbcTransaction tran = null;
try
{
con = new OdbcConnection("DSN=BASIS
administration;DBUPW=*****;UID=*****;DBUID=*****");
con.Open();
OdbcCommand command = new OdbcCommand("update NPAGA_NPAGA.T_USUA set
USU_MOD='01;02' where USU_ID='pppppppp' ",con);
OdbcDataReader a = command.ExecuteReader(CommandBehavior.SingleResult);
a.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace);
}
finally
{
con.Close();
}
when i execute this code I get the next error:
ERROR [IM001] [Microsoft][ODBC Driver Manager] Driver does not support this
function
stack:
at System.Data.Odbc.OdbcConnection.HandleError(HandleRef hrHandle,
SQL_HANDLE hType, RETCODE retcode)\r\n at
System.Data.Odbc.OdbcDataReader.NextResult()\r\n
at System.Data.Odbc.OdbcDataReader.FirstResult()\r\n
at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior
behavior, String method)\r\n at
System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior)\r\n at
conbasis.Form1.Grabar_Click(Object sender, EventArgs e) in
d:\\alvaro\\conbasis\\form1.cs:line 173
the problem is in the NextResult().The Basis driver do not support the
nextresult command. The update work in the table but I receive the error. If
I want to work with transactions the update do not work (automatic rollback)
and it's no posible to do the update.
How can I do to eliminate the automatic nextresult?
If I change ExecuteReader and put executenonquery I get the same error.
Thanks
Alvaro