PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Tableadapter record count

Reply

Tableadapter record count

 
Thread Tools Rate Thread
Old 25-04-2008, 05:39 PM   #1
John
Guest
 
Posts: n/a
Default Tableadapter record count


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


  Reply With Quote
Old 25-04-2008, 05:57 PM   #2
Cor Ligthert[MVP]
Guest
 
Posts: n/a
Default Re: Tableadapter record count

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
>


  Reply With Quote
Old 25-04-2008, 06:13 PM   #3
amdrit
Guest
 
Posts: n/a
Default Re: Tableadapter record count

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
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off