You're here: Snippet Directory » Microsoft .NET (152)
Language:

Creating a DataSet

Language: English
Programming Language: VB.NET
Published by: Dennis Pallett [not registered]
Last Update: 5/9/2006
Views: 1085

Description

This codesnippet shows you how to dynamically create a DataSet.

Code

1 Dim ds As DataSet 2 Dim tbl As DataTable 3 Dim col1,col2 As DataColumn 4 5 ds = New DataSet() 6 tbl = New DataTable("mytable") 7 col1 = New DataColumn("mycolname1", Type.GetType("System.Int32")) 8 col2 = New DataColumn("mycolname2", Type.GetType("System.String")) 9 10 tbl.Columns.Add(col1) 11 tbl.Columns.Add(col2) 12 13 ds.Tables.Add(tbl)

No comments avaiable

Add a comment

Name *  

Email (won't be displayed) *    

Website  

Comment *  

Sicherheitscode Security Code *    

RSS