UpdateRowSource.FirstReturnedRecord
Posted: Tue  30 Jan 2007 11:26
				
				Hi,
i have in code for MSSQL :
DbDataAdapter da = DataFactory.CreateDataAdapter("Select * from ServiceConfig", connection);
DataFactory.CreateCommandBuilder(da);
((SqlDataAdapter) da).InsertCommand.CommandText += "; Select * from ServiceConfig WHERE ID=@@IDENTITY";
((SqlDataAdapter) da).InsertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord;
da.Fill(dataSet, "ServiceConfig");
now i rewrite application to PostGre and when i call Update on DataSet from code :
DbDataAdapter da = DataFactory.CreateDataAdapter("Select * from network", connection);
DataFactory.CreateCommandBuilder(da);
((PgSqlDataAdapter)da).InsertCommand.CommandText += "; Select * from network WHERE id=currval('network_id_seq')";
((PgSqlDataAdapter)da).InsertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord;
da.Fill(dataSet, "network");
show me error :
CoreLab.PostgreSql.PgSqlException: cannot insert multiple commands into a prepared statement
at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
What is bad??????
Gelny
			i have in code for MSSQL :
DbDataAdapter da = DataFactory.CreateDataAdapter("Select * from ServiceConfig", connection);
DataFactory.CreateCommandBuilder(da);
((SqlDataAdapter) da).InsertCommand.CommandText += "; Select * from ServiceConfig WHERE ID=@@IDENTITY";
((SqlDataAdapter) da).InsertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord;
da.Fill(dataSet, "ServiceConfig");
now i rewrite application to PostGre and when i call Update on DataSet from code :
DbDataAdapter da = DataFactory.CreateDataAdapter("Select * from network", connection);
DataFactory.CreateCommandBuilder(da);
((PgSqlDataAdapter)da).InsertCommand.CommandText += "; Select * from network WHERE id=currval('network_id_seq')";
((PgSqlDataAdapter)da).InsertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord;
da.Fill(dataSet, "network");
show me error :
CoreLab.PostgreSql.PgSqlException: cannot insert multiple commands into a prepared statement
at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
What is bad??????
Gelny