473,405 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

ADO.NET - Working with DataSet

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/Da...geswiththe.htm
http://www.functionx.com/vcsharp/databases/datarow.htm
http://en.csharp-online.net/Working_...g_Rows_of_Data

THank you very much

May 24 '07 #1
3 4561
On May 24, 10:39 am, Sheikko <shei...@gmail.comwrote:
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/Da...dding_Rows_of_...

THank you very much
Hi,

You should define Update, Insert & Delete adapter bindings (you can
use the Table Data Adapter Wizard... *)
This article might help:
http://www.theserverside.net/tt/arti...ataSetDesigner

Hope this helps.
Moty

May 24 '07 #2
On 24 Mag, 10:40, Moty Michaely <Moty...@gmail.comwrote:
On May 24, 10:39 am, Sheikko <shei...@gmail.comwrote:
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/Da...stratestheuseo......
THank you very much

Hi,

You should define Update, Insert & Delete adapter bindings (you can
use the Table Data Adapter Wizard... *)
This article might help:http://www.theserverside.net/tt/arti...s?id=DataSetDe...

Hope this helps.
Moty
THank you. I have solved the problem. I have added a table Adapter,
and i have inserted this line:
myTableAdapter.Update(Setting);

I have also removed tis:
Setting.AcceptChanges();

May 24 '07 #3
On May 24, 12:48 pm, Sheikko <shei...@gmail.comwrote:
On 24 Mag, 10:40, Moty Michaely <Moty...@gmail.comwrote:
On May 24, 10:39 am, Sheikko <shei...@gmail.comwrote:
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/Da...stratestheuseo......
THank you very much
Hi,
You should define Update, Insert & Delete adapter bindings (you can
use the Table Data Adapter Wizard... *)
This article might help:http://www.theserverside.net/tt/arti...s?id=DataSetDe...
Hope this helps.
Moty

THank you. I have solved the problem. I have added a table Adapter,
and i have inserted this line:
myTableAdapter.Update(Setting);

I have also removed tis:
Setting.AcceptChanges();
Great!

May 24 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Bull | last post by:
I have an asp.net app that consumes a web service that is working fine on my local machine. I have put the service and the app on our web server. If I make a call to a function in the service that...
10
by: April | last post by:
Hope someone can help me The SQL string i need to use does not work, Who can help me.... Thanks in advance Dim strConn As String Dim strSQL As String
2
by: | last post by:
Hello, I have a GridView in my ASP.NET 2.0 application that performs the paging feature perfect when I have it bound to a data source. But now I have it bound to a dataset and the paging...
5
by: glenn | last post by:
Hi folks, The problem I have is that a query string works if hard-coded but if I pass a variable to it, it does not work as shown here. This works: querystring="SELECT * FROM USERS WHERE...
1
by: matt | last post by:
hello, i have a web app that allows users to query our oracle db and produce a dataset of report data. they then have the option to serialize this data and store it in the database. later, then...
3
by: UJ | last post by:
I've got a working web service that we are moving to another machine and now I suddenly get the following error. While transferring the files, got the following message:...
2
by: tshad | last post by:
I have been using a schema.ini file to define the columns of my .csv files that has been working fine. But I just tried one where it doesn't work. I have the following schema.ini file: ...
2
by: Sheikko | last post by:
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...
2
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Have a complex process where I need to Import a large amount of data then run some transformations on this data then import into DataBase. The transformation involves multiple fields and multiple...
0
by: Mark112 | last post by:
Hi I am attempting to restore the search feature that was created by an external company using the indexing service for our intranet. the intranet is located locally at each of our offices. The...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.