J
J055
Hi
I can't figure this one out. I'm using TableAdapters quite successfully with
the rest of my app but I have one where the insert just doesn't work when
the TableAdapter.Update(TypedDataTable) is called.
When I set the break point on the method I can see that it initializes the
adapter in the DataSet.Designer.cs file. Can someone suggest how I can work
out what's going wrong? I've recreated the table adapter in the xsd wizard
page but it's always the same. No exception is thrown but the update method
is definitely called and the insert stored procedure works too. The code is
ScsDataSet.NotificationEmailsDataTable notifyTbl = new
ScsDataSet.NotificationEmailsDataTable();
ScsDataSet.NotificationEmailsRow notifyRow =
notifyTbl.NewNotificationEmailsRow();
// account.AccountID retrieved from another TA update
notifyRow.AccountID = account.AccountID;
notifyRow.CreateDate = DateTime.Now;
notifyRow.ModifyDate = DateTime.Now;
notifyRow.NotifyType = 0;
notifyRow.Email = email.Trim();
notifyRow.IsLogin = true;
// row is populated above ok
NotificationEmailsTA.Update(notifyTbl); // notifyRow.EmailID == 0 and the
record is not inserted
if (notifyRow.EmailID == 0)
throw new ApplicationException("NotificationEmailsTA not inserting");
Thanks
Andrew
I can't figure this one out. I'm using TableAdapters quite successfully with
the rest of my app but I have one where the insert just doesn't work when
the TableAdapter.Update(TypedDataTable) is called.
When I set the break point on the method I can see that it initializes the
adapter in the DataSet.Designer.cs file. Can someone suggest how I can work
out what's going wrong? I've recreated the table adapter in the xsd wizard
page but it's always the same. No exception is thrown but the update method
is definitely called and the insert stored procedure works too. The code is
ScsDataSet.NotificationEmailsDataTable notifyTbl = new
ScsDataSet.NotificationEmailsDataTable();
ScsDataSet.NotificationEmailsRow notifyRow =
notifyTbl.NewNotificationEmailsRow();
// account.AccountID retrieved from another TA update
notifyRow.AccountID = account.AccountID;
notifyRow.CreateDate = DateTime.Now;
notifyRow.ModifyDate = DateTime.Now;
notifyRow.NotifyType = 0;
notifyRow.Email = email.Trim();
notifyRow.IsLogin = true;
// row is populated above ok
NotificationEmailsTA.Update(notifyTbl); // notifyRow.EmailID == 0 and the
record is not inserted
if (notifyRow.EmailID == 0)
throw new ApplicationException("NotificationEmailsTA not inserting");
Thanks
Andrew