G
Guest
Hi
I am a beginner in VB.NET, and have a problem with empty field in Access
I have transfered a worksheet in Excel to Access table. Some of the cels are empty
I use VB.NET program to acces this Access table (product.mdb)
One of the statements is to validate whether the field empty or not
My statement is
If Trim(dr_Product("bt_m3event")) = "" Or Trim(dr_Product("bt_m3event")) = " " The
........
End I
dr_Product ==> is OleDbDataReade
bt_m3event ==>is the field nam
The bt_m3event is empty
When this statement is processed, I got a message like below
An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dl
Additional information: Cast from type 'DBNull' to type 'String' is not valid
I have tried so many times and many ways, but it didn't work
Can anybody tell me how to validate an empty field
Thanks in advance
Joachim
I am a beginner in VB.NET, and have a problem with empty field in Access
I have transfered a worksheet in Excel to Access table. Some of the cels are empty
I use VB.NET program to acces this Access table (product.mdb)
One of the statements is to validate whether the field empty or not
My statement is
If Trim(dr_Product("bt_m3event")) = "" Or Trim(dr_Product("bt_m3event")) = " " The
........
End I
dr_Product ==> is OleDbDataReade
bt_m3event ==>is the field nam
The bt_m3event is empty
When this statement is processed, I got a message like below
An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dl
Additional information: Cast from type 'DBNull' to type 'String' is not valid
I have tried so many times and many ways, but it didn't work
Can anybody tell me how to validate an empty field
Thanks in advance
Joachim