I get a NullReferenceException error while saving a record with following statement:
Dim sel As String = "select COUNT(*) from Master_URLEntry where Projectname='" &0 G_Current_Project & "' and ListCode like '%" & sCode & "%' "]
If blnAdd = False Then
sel += "and Recordid not in ('" & _dtMasterRow.Item("RecordID") & "')"
End If