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

ADO.NET - Working with DataSet

3 views
Skip to first unread message

Sheikko

unread,
May 24, 2007, 3:46:29 AM5/24/07
to
CSharp - ADO.NET - Working with DataSet
=========================

HI, I want to create an application that interact with a DB. I wont to
use SQL statement, but I want to use DataSet.
- I have created my application
- From SERVER EXPLORER panel, I have added a connection to a database
(MyDB) and the name of the dataset is "MyDBDataSet" .
- From DATA SOURCE panel, I have added Tables that I want to use
(Setting).
- When I click a button from my application I want to populate a table
with some values, so I write the following code:

MyDBDataSet.SettingDataTable Setting = new
MyDBDataSet.SettingDataTable();
DataRow SettingRow = Setting.NewRow();

private void button1_Click(object sender, EventArgs e)
{
SettingRow["Name"] = "Name1";
SettingRow["Age"] = 26;
SettingRow["City"] = "City1";

Setting.Rows.Add(SettingRow);
Setting.AcceptChanges();
}

When I close the application the Database is not Syncronized with the
DataTable.
Have you any Idea?
I want to make it working with Pocket PC, but I have the same problem
on the PC.
I found some examples in the net, and they make the same operations I
made.

Here some links:
http://www.java2s.com/Code/CSharp/Database-ADO.net/illustratestheuseofaddingmodifyinganddeletingarowinaDataTableobjectandsynchronizingthosechangeswiththe.htm
http://www.functionx.com/vcsharp/databases/datarow.htm
http://en.csharp-online.net/Working_with_Data%E2%80%94Adding_Rows_of_Data

THank you very much

0 new messages