GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  VB.NET
Go To First  |  Previous Question  |  Next Question 
 VB.NET  |  Question 22 of 60    Print  
how to check for a particular record whether it is present or not in dataset
if the record is not present i want to display a message as no records what is the code for checking

  
Total Answers and Comments: 7 Last Update: March 15, 2007     Asked by: subrahmanyam 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
September 21, 2006 02:22:03   #1  
Madduri Rajasekhar        

RE: how to check for a particular record whether it is...
You can check by record or by rows if it contains zero then append it if at end use FOR loop to acesss the first record until-1
 
Is this answer useful? Yes | No
October 10, 2006 05:05:38   #2  
paragyerawar Member Since: October 2006   Contribution: 1    

RE: how to check for a particular record whether it is...
if thr is datareader then check for hasrows.
 
Is this answer useful? Yes | No
October 17, 2006 06:19:41   #3  
Bhaskar Nandi        

RE: how to check for a particular record whether it is...
Answer may be that we can use int32.recordsaffected .If it it 0 then there was no record..otherwise some records exist.
 
Is this answer useful? Yes | No
October 23, 2006 13:21:35   #4  
satnam singh        

RE: how to check for a particular record whether it is...
You can use followind methodtake reference to View( DataSet.Tables(indexOfTable).DefaultView).
 
Is this answer useful? Yes | No
October 23, 2006 13:26:54   #5  
satnam singh        

RE: how to check for a particular record whether it is...
You can use following methoda) take a reference to the defaultview of the required table in dataset.b) initialize RowFilter ColumnName value ( you can you multiple column condtions seperated by ' And ' keywordc) check the Count property of viewd) if ( view.Count > 0 ) the record exists )
 
Is this answer useful? Yes | No
March 09, 2007 12:44:20   #6  
Savi        

RE: how to check for a particular record whether it is...
SqlDataReader.HasRows

Gets a value indicating whether the SqlDataReader contains one or more rows.


 
Is this answer useful? Yes | No
March 15, 2007 02:40:32   #7  
ramzan_06        

RE: how to check for a particular record whether it is...

if you are using "DataReader" then

if DataReaderName.HasRows then
statements
else
statements
end if


if you are using "DataSet" then

if DataSetName.TABLES.("tablename").ROWS.COUNT 0 THEN

statements.


end if


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape