I am loading a datagriview with data in the tables.
Below is the code I used.
There is no data in the table but ds is Nothing is going False and the control is moved to else part of the program.
I am using VS 2012.Please help me.
Below is the code I used.
Code:
Dim da As SqlDataAdapter Try ds = New DataSet da = New SqlDataAdapter("select A.ANALCODE 'ANALYSIS CODE ID',B.ANALCODEDESC 'ANALYSIS CODE DESC' from ACT00052_P A,ACT00051_P B where B.ANALCODE = A.ANALCODE and A.SACCTCOMB = '" & cmbAccount.Text & "' order by A.ANALCODE", sqlCon1) ds.Clear() da.Fill(ds, "ConnToSqlDrp") If ds Is Nothing = True Then DGV2.Rows.Clear() Exit Sub Else da.Fill(ds) DGV2.DataSource = ds.Tables(0) End If Catch ex As Exception MsgBox(ex.Message.ToString()) End Try
I am using VS 2012.Please help me.
Comment