?
Solved

Adding data to datatable

Posted on 2008-09-30
2
Medium Priority
?
1,101 Views
Last Modified: 2013-11-26
I am using visual basic .net 2005.
I added a new dataset to my project: DataSet1.xsd
In the DataSet1.xsd, I created a datatable: DataTable1
In the DataTable1 I created columns: DataColumn1, DataColumn2

Im going to be using the the dataset in  crystal report. I have to crystal report created already
using the dataset created above.

Now, I am trying to add rows to the datatable of which is obviously in the dataset
but when I try, I keep getting decleration errors and such.

Anyone  give an example of some code to add rows to a datatable of which
the datasets/datatables are created in the designer.

I have seen code to add rows to datasets/datatables created in code, but i dont want to do it that way.
0
Comment
Question by:crw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
VBRocks earned 2000 total points
ID: 22606006
Dim table as New DataSet1()
table.Rows.Add("Item 1", "Item 2")

'Add 5 rows:
For i as Integer = 1 to 5
    table.Rows.Add("Item " & i, "Item " & (i + 5))
Next
0
 

Author Comment

by:crw
ID: 22608074
Ok, that worked great. Now to use the dataset information between different forms, I would have to create the DIM line above in a module and instead declare the variable  as PUBLIC?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question