I have a form with a dataset bound to a datagrid and several textbox controls. I can navigate my data with ease and perform updates but for some reason when I add a new datarow using BindingContext.AddNew, although the BindingContext.Count gets incremented I cannot reference the actual row at that location - it errors out saying there is no row.

Here's sample code:
VB Code:
  1. With tArbiter
  2.             .Columns("ID").DefaultValue = Guid.NewGuid
  3.             .Columns("ArbiterKey").DefaultValue = ArbiterID
  4.             .Columns("FirmKey").DefaultValue = rLawFirm(iFirmPos).Item("ID")
  5.             .Columns("FirmName").DefaultValue = rLawFirm(iFirmPos).Item("FirmName").ToString
  6.             .Columns("CreationDate").DefaultValue = Date.Today
  7.             .Columns("LastUpdate").DefaultValue = Date.Today
  8.             .Columns("StartDate").DefaultValue = Date.Today
  9.         End With
  10.         Console.WriteLine("Before: " & BindingContext(dsArbiters, tnArbiter).Position.ToString)
  11.         BindingContext(dsArbiters, tnArbiter).AddNew()
  12.         Console.WriteLine("After: " & BindingContext(dsArbiters, tnArbiter).Position.ToString)

Now the console writelines show the position gets incremented but any referencing to new row fails.

I've been pulling my hair out on this one... anyone have any insight?

~/<at

~~~~~~~~~~~~~~~
There is a certain satifaction in living a life in complete and total failure.
- Edward Abbey