B
backwards15
Simple question for you all. I'm new to ADO.net and i'm trying to run
a querry on a SQL 2000 database and return all the rows found to a
listbox.
Below the code i have returns one item to the listbox and if i run my
querry it otherwise should add another 3 items.
Is there anyway i can make a quick change to the code below in order
to do this.
Regards,
Andy
sql.Open()
Dim ds As New DataSet()
Dim da As New SqlClient.SqlDataAdapter(cmd)
da.Fill(ds, "Output")
If ds.Tables(0).Rows(0).Item(0) Is DBNull.Value Then
MessageBox.Show("no user found")
Else
Me.ListBox1.Items.Add(ds.Tables(0).Rows(0).Item(0).ToString + ", " +
ds.Tables(0).Rows(0).Item(1).ToString)
End If
sql.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, Application.ProductName,
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
a querry on a SQL 2000 database and return all the rows found to a
listbox.
Below the code i have returns one item to the listbox and if i run my
querry it otherwise should add another 3 items.
Is there anyway i can make a quick change to the code below in order
to do this.
Regards,
Andy
sql.Open()
Dim ds As New DataSet()
Dim da As New SqlClient.SqlDataAdapter(cmd)
da.Fill(ds, "Output")
If ds.Tables(0).Rows(0).Item(0) Is DBNull.Value Then
MessageBox.Show("no user found")
Else
Me.ListBox1.Items.Add(ds.Tables(0).Rows(0).Item(0).ToString + ", " +
ds.Tables(0).Rows(0).Item(1).ToString)
End If
sql.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, Application.ProductName,
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try