Stupid Typed Dataset Question

G

Guest

I have a DataGridView whose dource is a typed dataset. Before I call
TableAdapter.Update, I want to make sure that the a value in the underlying
datatable is not null. For some reason I can't get to it and check it

I wanted to do this

if not
typeof(Me.CTSData.dtActions(Me.DtActionsBindingSource.Current).ActionID) is
system.DbNull then
....

But I get an IndexOutOfRange Exception. I'm thinking the TypeOf operator
won't work either

grr
but this is clearly has a couple of problems
 
G

Guest

Not sure what you are doing but can you try this -

Me.CTSData.dtActions(Me.DtActionsBindingSource.Current).ActionID is
system.dbnull.value
 
J

Joe

UNTESTED
IF Not Me.DtActionsBindingSource.Current("ActionID") is dbnull.Value
...
Then

or

If Me.CTSData.dtActions(Me.DtActionsBindingSource.POSITION).ActionID is
system.DbNull then
...
End If



Thanks, Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top