PC Review


Reply
Thread Tools Rate Thread

Tableadapter record count

 
 
John
Guest
Posts: n/a
 
      25th Apr 2008
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
 
 
 
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      25th Apr 2008
MyDataSet.tblMyTable.Count


"John" <(E-Mail Removed)> schreef in bericht
news:%(E-Mail Removed)...
> 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
 
amdrit
Guest
Posts: n/a
 
      25th Apr 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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Count that will display the number for each record in the count increment. Sylvain Lafontaine Microsoft Access ADP SQL Server 0 12th Jul 2008 05:25 PM
Tableadapter record count John Microsoft VB .NET 2 25th Apr 2008 07:13 PM
TableAdapter, BindingSource and DataSet - the first record. Hubert Wisniewski Microsoft VB .NET 1 23rd Jan 2008 02:59 AM
Current Record Count, Previous Record #, Add New Record =?Utf-8?B?Um9iZXJ0IE51c3ogQCBEUFM=?= Microsoft Access Forms 0 15th Feb 2005 09:35 PM
Stop adding record in subform after record count = 1 Charlie Microsoft Access Forms 0 31st Jul 2003 12:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:22 PM.