Click here to Skip to main content
15,905,776 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
For i = 0 To ds.Tables(0).Rows.Count - 1
            MsgBox(ds.Tables(0).Rows(i).Item(0))
        Next

What does this code mean and the other one? Can you explain what is the difference between this two code.


VB
For i = 0 To dt.Tables(0).Rows.Count - 1
            MsgBox(dt.Tables(0).Rows(i).Item(0))
        Next
Posted
Updated 23-Jul-12 18:30pm
v3

Both Code Block works same. The code will display a messagebox showing count(1,2,3,4....) upto rows count of a dataset(ds) or datatable(dt)


The difference is only of the dataset and datatable.



Thanks
Ashish
 
Share this answer
 
Comments
ianshack 24-Jul-12 0:54am    
Thanks for your reply Ashish
I'm a little bit confused about the dataSet and dataTable.
AshishChaudha 24-Jul-12 0:56am    
Please check the URL

http://www.dotnetobject.com/Thread-difference-between-DataReader-DataTable-and-DataSet
Both the codes are same and it looks like ds and dt both means the same i.e, dataset.
This code will give you value of first column in each row of your datatable in msgbox
 
Share this answer
 
The only difference is ds and dt but its the same a dataset. You are displaying data from a dataset.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900