Monday, January 20, 2014

How to fetch ricord between 3 and 15 only, if a dataset contains 100 rows

 SqlDataAdapter da = new SqlDataAdapter("usp_GetData",con);  
 DataSet ds1 = new DataSet();  
 da.Fill(ds1);  
 int rowcount = ds1.Table[0].Rows.Count;  
 if(rowcount >=15)  
 {  
      for(int i=3;i<=15;i++)  
      {  
           lbl.Text = Convert.ToSting(ds1.Table[0].Row[i].ToString());  
      }  
 }  

0 comments:

Post a Comment