Dim oConn as SqlClient.SqlConnection = New SqlClient.SqlConnection("server=(local),database=test,user=sa,password=sa") Dim oDA As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter("select * from table1 where field1='1'", oConn) Dim ds As New DataSet oDA.Fill(ds, "table1") If ds.Tables("table1").Rows(0).Item("field2").Value="2" RetValue = True Else RetValue = False End IfHTH