PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Tableadapter record count
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Tableadapter record count
![]() |
Tableadapter record count |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

