代码如下
Dim obj As Object = System.DBNull.Value
Dim sql As String = "select department1 from Information_System_department where dele_log='" + "S" + "' and company_id='" + s + " and department2='" + obj + "' "
sqlada = New SqlDataAdapter(sql, Me.sqlcon)
ds1 = New DataSet
ds1.Clear()
sqlada.Fill(ds1)
代码如下 Dim obj As Object = System.DBNull.Value Dim sql As String = "select department1 from Information_System_department where dele_log='" + "S" + "' and company_id='" + s + " and department2='" + obj + "' " sqlada = New SqlDataAdapter(sql, Me.sqlcon)
Dim sql As String = "select department1 from Information_System_department where dele_log='" + "S" + "' and company_id='" + s + " and ( isnull(department2,'') = '') "
Dim sql As String = "select department1 from Information_System_department where dele_log='" + "S" + "' and company_id='" + s + " and ( department2 is null or department2 ='') "