Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datarows & DBNULL

Status
Not open for further replies.

MartinCroft

Programmer
Jun 12, 2003
151
GB
Hi

I’ve several dynamic textboxs/combo boxes which can be added and deleted from the screen these are populated from a datatable and looped through each datarow populating the textboxes as below

Dim drow As DataRow
For Each drow In dt.Rows

when I come to read any changes back into the datrow i get an error message Operator is not valid for type DBNULL and nothing
It is showing the datarowstate has been modified when this is not the case so i did an compare of the current against original datarowversion which works ok apart from when using dbnull values

I have tried checking (******* below) for nothing, vbnull, dbnull (couldn't figure syntax for this one out)

Case DataRowState.Modified
If Not drow(j, DataRowVersion.Current) = Nothing then *******
If drow(j, DataRowVersion.Current) <> drow(j, DataRowVersion.Original) Then

I believe all I need to do is just not compare the values when is is dbnull but don’t know how to check any help is appreciated
 
isdbnull()

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Cheers was being stupid, had tried value = isdbnull()
instead of isdbnull(value), the pennt finally dropped thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top