Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Simple Dataset Question

0 views
Skip to first unread message

Morf

unread,
Oct 3, 2008, 10:21:07 AM10/3/08
to
Hi,

Hope this is OK, I have searched and not found anything (in the first
20 pages anyway).

I am starting mobile development in VS2008, SP1, framework 3.5 SP1.

Make new smart device app, and add a dataset to the form.

In the dataset I add one table and one column, I didn't change
anything so I have dataTable1, and dataColumn1.

Add a list box and this code to populate it in the Form1()
constructor, after the InitializeComponent call.

foreach (DataTable tab in dataSet1.Tables)
{
listBox1.Items.Add(tab.TableName);
}

Run it and nothing appears in the listbox - none of the tables.

I add code to add a row to the table:

dataSet1.Tables[0].Rows.Add("Test");

and I get an IndexOutOfRangeException

Conclusion ? The dataset is empty, no tables created.

Why not ?

If I do the same thing in normal Windows app, it works fine - the
tables are there.

Am I doing something really silly ?

Thanks

M.

0 new messages