How to check for rs.eof?

Carling

New Member
Hi I am new to ADO.net. But I was wondering how to check for rs.eof? I am using a dataset. Here is partial of my code<BR><BR><script language="VB" runat="server"><BR><BR> Sub GetInvoices_Click(Sender As Object, E As EventArgs) <BR><BR> Dim DS As DataSet<BR> Dim MyConnection As SqlConnection<BR> Dim MyCommand As SqlDataAdapter<BR><BR> Dim SelectCommand As String = "SQL Satememtent..."<BR> MyConnection = New SqlConnection("my connection string..")<BR> MyCommand = New SqlDataAdapter(SelectCommand, MyConnection)<BR><BR> MyCommand.SelectCommand.Parameters.Add(New SqlParameter("@Password", SqlDbType.NVarChar, 10))<BR> MyCommand.SelectCommand.Parameters("@Password").Value = http://aspmessageboard.com/archive/index.php/MyText.Value<BR><BR> DS = new DataSet()<BR> MyCommand.Fill(DS, "Invoices")<BR><BR> MyDataGrid.DataSource=DS.Tables("Invoices").DefaultView<BR> MyDataGrid.DataBind()<BR> End Sub<BR><BR></script>In the case above you have no need to check for EOF as the fill command will handle it for you.Thanks! But then how can display nothing when it is eof? Now I get the table headers displayed.you can do:<BR><BR>[dataset].tables("TableName").rows.countThanks this worked!
 
Back
Top