Create an empty data set with table structure.

Posted by Virendradugar under VB.NET category on | Views : 9548
This function creates an empty dataset with an empty table but with predefined schema.

Private function GenerateEmptyDataSet() As Dataset
Dim dtData As New DataTable()
Dim dsData As New DataSet()
dtData.Columns.Add(New DataColumn("ID"))
dtData.Columns.Add(New DataColumn("FirstName"))
dtData.Columns.Add(New DataColumn("LastName"))
dtData.Columns.Add(New DataColumn("Contact"))
dtData = Nothing
return dsData
End Sub

Comments or Responses

Login to post response