what is the meaning of
1. ds.Tables[0].Rows.Count > 0
2.ds.Tables[0].Rows[0]["column_name"].ToString();
3.dt.rows.count>0
with example
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pramod ShivharePosted Apr 2, 2013, 7:01 AM
1. ds.Tables[0].Rows.Count > 0
Ans : Data set can contains number of tables, here ds is data set and table [0] is pointing to 1st table index in data set. Rows.Count is a property in data table which will return you the number of rows in data table. The above statement ds.Tables[0].Rows.Count is returning you the number of rows in first table of data set ds. This is the conditional statement, here one is checking total number of rows with predefined value in this case it 0.
2.ds.Tables[0].Rows[0]["column_name"].ToString();
Ans : This statement will return you the first rows value of ds.Tables[0] table, and for which column you want value u can specify instead of "column_name"
3.dt.rows.count>0
Ans : the first statement and this statment has no diffrence. In 1 data table was from data set object and here we are directly using data tables object.
Vishal GilbilePosted Apr 2, 2013, 2:35 AM
The following lines conclude the following things.