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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datatable.select to find Null values

Status
Not open for further replies.

chris123321

IS-IT--Management
Mar 13, 2007
139
0
0
US
I need to find the rows that have PlatformId, RoleCd, and ContactId as null values.

Here is the code:

Code:
foundRows = tdtReportPermissions.Select("PlatformID_F = '" & drUserInfo.IsPlatformIdNull & "'" & _
                                        " AND RoleCD_F  = '" & drUserInfo.IsUserRoleDescNull & "'" & " AND ContactID_F = '" & _
                                        drUserInfo.IsContactIdNull & "'")

The error I'm getting is: Cannot perform '=' operation on System.Int32 and System.String

 
I believe you want:

Code:
foundRows = tdtReportPermissions.Select("PlatformID_F IS NULL AND RoleCD_F  = IS NULL AND ContactID_F = IS NULL")

--Rob
 
You're right; I had cut-and-paste issues. The correct code is:

Code:
foundRows = tdtReportPermissions.Select("PlatformID_F IS NULL AND RoleCD_F IS NULL AND ContactID_F IS NULL")

Sorry!

--Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top