Bronislav,
As Bernie wrote is using a recordset ADODB,.
However I dont believe you are using a recordset, so please do not write
that next time.
A recordset has absolute no equalitiys with a dataset. One of the aspects is
by instance that a recordset is only one connected datatable. (While a
datatable in a dataset is disconnected).
Did you try already something as this. (Changed in this message so watch
typos or whatever).
\\\
Dim cm As CurrencyManager = _
DirectCast(BindingContext(DsTextProdMain," TextProductsMain").dtVBreg),
CurrencyManager)
If DsTextProdMain.tables("TextProductsMain").rows.Cou nt > 0 Then
DsTextProdMain.tables("TextProductsMain").rows(cm. Position).Delete()
End If
///
Be aware I tried to take the datasource as you used in your message, I do
not know if that is the used one.
I hope this helps?
Cor
"Bronislav" <Br*******@discussions.microsoft.com>
Hi Bernie
I'm using ado.net
Thanks, Bronislav.
"Bernie Yaeger" wrote:
Hi Bronislav,
Sounds strange. You say 'recordset', so I have to ask - are you using
ado
or ado.net? If ado.net, I'd recommend you post to
microsoft.public.dotnet.adonet.
Bernie Yaeger
"Bronislav" <Br*******@discussions.microsoft.com> wrote in message
news:A0**********************************@microsof t.com... >I have an error when I try to delete last record in the record set. The
>code
> I'm using is:
> lcurrow = Me.BindingContext(DsTextProdMain,
> "TextProductsMain").Current
> lcurrow.Delete()
> This code works for all records in the recordset except last one. But
> if
> recordset contains only one record the code works fine. The error is
> coming
> out only in 2003 version, 2002 version works fine.
>
> The system give me a not understandable error.
>
> An unhandled exception of type 'System.NullReferenceException' occurred
> in
> system.data.dll
>
> Additional information: Object reference not set to an instance of an
> object.
>
> Is somebody met this behabior?