2007-07-12

Step to Create Dataset

This sample show the basic step to create dataset and there element.


Sample Code

Step 1 you should to Imports System.Data

Step 2 please see sample code below.

Dim ds As New DataSet("DataSetSample")

' Create Table
Dim dt As New DataTable("DataTable")

' Create Column
Dim cl1 As New DataColumn("Column1")
cl1.DataType = GetType(Integer)

Dim cl2 As New DataColumn("Column2")
cl2.DataType = GetType(String)

' Add column to table
dt.Columns.Add(cl1)
dt.Columns.Add(cl2)

' Add DataTable to DataSet
ds.Tables.Add(dt)

' Step to add DataRow
' Create new row
Dim dr As DataRow
dr = ds.Tables("DataTable").NewRow

dr("Column1") = 1
dr("Column2") = "Welcome to vb.net Sample code"

' Add Row1
ds.Tables("DataTable").Rows.Add(dr)


' If you can use array of datarow.
Dim drArray(1) As DataRow

drArray(0) = ds.Tables(0).NewRow
drArray(0)("Column1") = 2
drArray(0)("Column2") = "Show easy sample code"
ds.Tables("DataTable").Rows.Add(drArray(0))

drArray(1) = ds.Tables(0).NewRow
drArray(1)("Column1") = 3
drArray(1)("Column2") = "Easy to understand"
ds.Tables("DataTable").Rows.Add(drArray(1))


' binddata to gridview
Me.DataGridView1.DataSource = ds.Tables("DataTable").Copy()


vb.net sample code

21 comments:

oleh oleh khas Medan said...

Nice tutorial, very helpful

Anonymous said...

This blog was... how do I say it? Relevant!
! Finally I've found something which helped me. Thank you!

My page; arabcol.ac.il

Anonymous said...

Hi mates, its enormous post on the topic of cultureand fully defined, keep it up all the time.


My web site :: http://www.globalvirtualair.com/

Anonymous said...

I every time used to study post in news papers but now as
I am a user of web thus from now I am using net for articles, thanks to web.


my homepage :: Www.Readingwithtequila.Com

Anonymous said...

Thank you for the auspicious writeup. It in fact
was a amusement account it. Look advanced to more added agreeable from you!
By the way, how can we communicate?

My weblog http://pickup-artist.com/how-to-impress-girl

Anonymous said...

Great post but I was wondering if you could write a litte more on this subject?
I'd be very grateful if you could elaborate a little bit more. Kudos!

Also visit my weblog: Www.szakibazis.Com

Anonymous said...

Thank you for the good writeup. It in fact was
a amusement account it. Look advanced to more added
agreeable from you! By the way, how could we communicate?


My web page; linked internet site

Anonymous said...

Hello I am so glad I found your site, I really found you by
accident, while I was looking on Aol for something else, Regardless I am here now and would just like to say
thanks a lot for a remarkable post and a all round enjoyable blog (I
also love the theme/design), I don't have time to look over it all at the moment but I have saved it and also added in your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the great work.

Visit my webpage; relationshiprewinder.com

Anonymous said...

Hello! I'm at work browsing your blog from my new apple iphone! Just wanted to say I love reading through your blog and look forward to all your posts! Keep up the excellent work!

Feel free to surf to my website related internet page

Anonymous said...

We are a group of volunteers and starting a new scheme in our
community. Your site offered us with valuable information to work
on. You have done an impressive job and our entire
community will be thankful to you.

my blog :: Pure White Kidney Bean Extract

Anonymous said...

With havin so much content do you ever run into any problems of plagorism or copyright infringement?
My website has a lot of completely unique content I've either created myself or outsourced but it appears a lot of it is popping it up all over the web without my authorization. Do you know any ways to help prevent content from being stolen? I'd
truly appreciate it.

My page :: Best Supplements for Muscle Growth

Anonymous said...

I got this web page from my friend who informed me concerning this web site and now this time I
am browsing this web page and reading very informative content here.


Here is my blog post Buy Rejuvenex

Anonymous said...

Ahaa, its pleasant discussion concerning this post at
this place at this weblog, I have read all that, so
at this time me also commenting here.

Here is my site: 1285 muscle

Anonymous said...

I loved as much as you will receive carried out right here.
The sketch is attractive, your authored material stylish.
nonetheless, you command get bought an impatience over that you wish be delivering the following.
unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this
increase.

My webpage ... Vimax Free Trial

Anonymous said...

Ηey, I think yоuг blog might be having browsеr
сompаtіbility іssueѕ.
When I look at yοur website in Ie,
it looks fine but when oρеnіng іn Ιnternet Еxрlorеr, іt has some
οveгlapρіng. I јust ωanted to givе
уou a quick heaԁs up! Other then thаt,
gгeat blog!

Alsο visit my blog рoѕt :: www.wjaheart.com

Anonymous said...

What's up to every body, it's my first visit of
this blog; this website carries amazing and in fact good
information for visitors.

Here is my homepage dribnurakhmat.Blogspot.com

Anonymous said...

I'm extremely pleased to discover this page. I want to to thank you for your time due to this wonderful read!! I definitely enjoyed every little bit of it and i also have you book-marked to look at new things on your web site.

My website :: digiupdates.com

shams said...

May you provide code in c#

Thanks,
build muscle

ahmedshah said...

it's amazing post

buy
purchase
Elevate gf reviews
official
muscle factor x
Elevate Gf
Elevate gf
pros
directions

ahmedshah said...

I enjoy reading an article that will make men and women think.
Also, many thanks for allowing for me to comment!

bodybuilding

easy weight loss

fat burning supplements


burn fat


build muscle


fat burn


build muscles


supplements


supplements reviews


burn fat reviews

ahmedshah said...

An intriguing discussion is definitely worth comment. I do believe
that you ought to publish more about this topic, it may not be a taboo matter but generally folks don't speak about such issues. To the next! Many thanks!!


loss weight


easy weight loss

natural weight loss

burn fat build mussle

loss weight

Avoide soda

tips


top foods


wake up workout