Hi

I am using the below statement;

Me.MyTableAdapter.Fill(Me.MyDataSet.tblMyTable)

How can I now check the record count of the data table and specifically if
the record count returned by fill is not 0?

Thanks

Regards

Re: Tableadapter record count by Cor

Cor
Fri Apr 25 11:57:26 CDT 2008

MyDataSet.tblMyTable.Count


"John" <info@nospam.infovis.co.uk> schreef in bericht
news:%23gLDjLvpIHA.3548@TK2MSFTNGP06.phx.gbl...
> Hi
>
> I am using the below statement;
>
> Me.MyTableAdapter.Fill(Me.MyDataSet.tblMyTable)
>
> How can I now check the record count of the data table and specifically if
> the record count returned by fill is not 0?
>
> Thanks
>
> Regards
>


Re: Tableadapter record count by amdrit

amdrit
Fri Apr 25 12:13:31 CDT 2008

Really, is that your question?

With MSDN installed
1. Dim x as System.Data.SQLCLient.SQLDataAdapter
2. Highlight SQLDataAdapter
3. Press F1

Without MSDN installed
1. Open your favorite browser
2. Navigate to msdn.microsoft.com
3. Search on SQLDataAdapter Class


Some more help.

Intellisense shows Me.MyTableAdapter.Fill has several signatures, and that
it returns an integer. I wonder what that integer is for?

After filling Me.MyDataSet.tblMyTable, there should be a collection of rows
(0-N). Me.MyDataSet.tblMyTable.Rows.Count will either equal 0 or N. If the
table already had rows then:

dim iRowCount as integer = Me.MyDataSet.tblMyTable.Rows.Count
dim iSomeInteger as integer =
Me.MyTableAdapter.Fill(Me.MyDataSet.tblMyTable)
dim iNewRowCount as integer = Me.MyDataSet.tblMyTable.Rows.Count

msgbox iNewRowCount - iRowCount & " rows have changed" & vbcrlf & "With a
return value of " & iSomeInteger & vbcrlf & "Which means " & iSomeInteger -
(iNewRowCount - iRowCount) & " rows were simply refreshed."


http://msdn2.microsoft.com/en-us/library/905keexk(VS.80).aspx

Snip ...
Return Value
The number of rows successfully added to or refreshed in the DataSet. This
does not include rows affected by statements that do not return rows.
... Snip


"John" <info@nospam.infovis.co.uk> wrote in message
news:%23gLDjLvpIHA.3548@TK2MSFTNGP06.phx.gbl...
> Hi
>
> I am using the below statement;
>
> Me.MyTableAdapter.Fill(Me.MyDataSet.tblMyTable)
>
> How can I now check the record count of the data table and specifically if
> the record count returned by fill is not 0?
>
> Thanks
>
> Regards
>