BeginEdit is ignored
- From: <SHB-MSDN@xxxxxxxxxxxxxxxx>
- Date: Fri, 22 Sep 2006 17:38:40 +0200
Hi,
Im pretty new to ADO.net and I ran into the following problem:
I try to add a row to a DataSet that has NotNull-Constraints on its columns.
When doing:
DataRow row = ds.Tables["docdescriptors"].NewRow();
DocTypeDB dt = new DocTypeDB(row);
NpgsqlCommand command = new NpgsqlCommand("select
nextval('docdescriptor_id_seq')", connection);
row["id"] = (int)(Int64)command.ExecuteScalar();
ds.Tables["docdescriptors"].Rows.Add(row);
I get the a ConstraintException because I did not fill all columns. That's
ok so far. But following the documentaion I added a BeginEdit
DataRow row = ds.Tables["docdescriptors"].NewRow();
row.BeginEdit();
DocTypeDB dt = new DocTypeDB(row);
NpgsqlCommand command = new NpgsqlCommand("select
nextval('docdescriptor_id_seq')", connection);
row["id"] = (int)(Int64)command.ExecuteScalar();
ds.Tables["docdescriptors"].Rows.Add(row);
But I still get the Exception I try to add the Row to the table.
Best
Thomas
.
- Follow-Ups:
- Re: BeginEdit is ignored
- From: Dave Sexton
- Re: BeginEdit is ignored
- Prev by Date: Access / DAO - What's the Future
- Next by Date: Re: ADO.NET 2.0 Love it or die from it!!!
- Previous by thread: Access / DAO - What's the Future
- Next by thread: Re: BeginEdit is ignored
- Index(es):
Loading