|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Count RcordsYou need to loop through the rows using the Read method and increment a
counter I'm afraid: While reader.Read() counter += 1 End While -- Show quoteHide quoteCarsten Thomsen Communities - http://community.integratedsolutions.dk --------- Voodoo Programming: Things programmers do that they know shouldn't work but they try anyway, and which sometimes actually work, such as recompiling everything. (Karl Lehenbauer) --------- "Anuradha" <anurad***@lankaequities.com> wrote in message news:%23gOuGIFkGHA.412@TK2MSFTNGP05.phx.gbl... > Dear Experts > > How can I count records in a data reader? > > > > Thx > > Anuradha > > > > > What i mean is I need to check the table and if records found I need to
update another table. I will give a example Select * from bktrn where EPF='" & text.text & "' If recodes found then xxxxxxxxx end if how can I do this Thx Anuradha Show quoteHide quote "CT" <carstent@spammersgoawayintegrasol.dk> wrote in message news:OtDYdLFkGHA.4276@TK2MSFTNGP03.phx.gbl... > You need to loop through the rows using the Read method and increment a > counter I'm afraid: > > While reader.Read() > counter += 1 > End While > > -- > Carsten Thomsen > Communities - http://community.integratedsolutions.dk > --------- > Voodoo Programming: Things programmers do that they know shouldn't work but > they try anyway, and which sometimes actually work, such as recompiling > everything. (Karl Lehenbauer) > --------- > "Anuradha" <anurad***@lankaequities.com> wrote in message > news:%23gOuGIFkGHA.412@TK2MSFTNGP05.phx.gbl... > > Dear Experts > > > > How can I count records in a data reader? > > > > > > > > Thx > > > > Anuradha > > > > > > > > > > > > Okay, I'm not sure where the check is done, but if you're returning the rows
in your DataReader before the check, the HasRows property will tell you if there are any rows that matches the criteria in your SELECT statement. If you need it done at the data source, I suggest looking at a stored procedure and executing it. You don't mention which data source you're using. -- Show quoteHide quoteCarsten Thomsen Communities - http://community.integratedsolutions.dk --------- Voodoo Programming: Things programmers do that they know shouldn't work but they try anyway, and which sometimes actually work, such as recompiling everything. (Karl Lehenbauer) --------- "Anuradha" <anurad***@lankaequities.com> wrote in message news:ujGBvcGkGHA.3780@TK2MSFTNGP03.phx.gbl... > > > What i mean is I need to check the table and if records found I need to > update another table. I will give a example > > > > Select * from bktrn where EPF='" & text.text & "' > > > > If recodes found then > > xxxxxxxxx > > end if > > > > how can I do this > > > Thx > Anuradha > > > > "CT" <carstent@spammersgoawayintegrasol.dk> wrote in message > news:OtDYdLFkGHA.4276@TK2MSFTNGP03.phx.gbl... >> You need to loop through the rows using the Read method and increment a >> counter I'm afraid: >> >> While reader.Read() >> counter += 1 >> End While >> >> -- >> Carsten Thomsen >> Communities - http://community.integratedsolutions.dk >> --------- >> Voodoo Programming: Things programmers do that they know shouldn't work > but >> they try anyway, and which sometimes actually work, such as recompiling >> everything. (Karl Lehenbauer) >> --------- >> "Anuradha" <anurad***@lankaequities.com> wrote in message >> news:%23gOuGIFkGHA.412@TK2MSFTNGP05.phx.gbl... >> > Dear Experts >> > >> > How can I count records in a data reader? >> > >> > >> > >> > Thx >> > >> > Anuradha >> > >> > >> > >> > >> > >> >> > >
changing the date format in vb.net
Datasets - use 1 or many? Assigning the result of a '/' division to an integer type causes rounding Calling a batch file from vb.net with parameters Dealing with NULL values in Integer fields Mulples threads and impersonation How to force upper case in a DataGridView column? Handle pointers from delphi client to a vb.net dll What's the Best Startup Scenario for Unattended Server Execution? From Delphi to VB |
|||||||||||||||||||||||