473,395 Members | 1,613 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,395 software developers and data experts.

Save data doesn't work

Hello!

I'm using VS2005.
I'm looking at ADO.NET and have found some test tutorial solution on
microsoft MSDN.
The one that I'm looking at now is called Walkthrough: Saving Data to a
Database (Single Table)

I have followed the walkthrought exectly but it doesn't work as expected.

I have a Data Source with one database table.
The table is from the northwind database and is called customer.
This table is set to be in Detail mode meaning I get individuals control for
the whole table when I drag the table into the windows form.

In this form there is a diskett meaning that I can save data back to the
database.

So I do the following change some data in one of the control and then click
the diskett symbol meaning I save the data back to the database.
If I now go to the next record and then go back to the previous record the
change is there.
So I manage to change in the dataset but if I then close the application and
look in the database my changes has not changed anything in the database.

I can't understand why this doesn't work.
//Tony
Oct 22 '07 #1
1 2585
Hello!!

Below is the event handler that is called when I click the diskett save
icon.
The text that is printed is Update successful so I don't get any errors but
as I mentioned no update is done to the
database.
private void customersBindingNavigatorSaveItem_Click(object sender,
EventArgs e)
{
try
{
this.Validate();
this.customersBindingSource.EndEdit();
this.customersTableAdapter.Update(this.nwindDataSe t.Customers);
MessageBox.Show("Update successful");
}
catch (System.Exception ex)
{
MessageBox.Show("Update failed");
}
}

"TonyJ" <jo*****************@telia.comskrev i meddelandet
news:%2******************@TK2MSFTNGP02.phx.gbl...
Hello!

I'm using VS2005.
I'm looking at ADO.NET and have found some test tutorial solution on
microsoft MSDN.
The one that I'm looking at now is called Walkthrough: Saving Data to a
Database (Single Table)

I have followed the walkthrought exectly but it doesn't work as expected.

I have a Data Source with one database table.
The table is from the northwind database and is called customer.
This table is set to be in Detail mode meaning I get individuals control
for
the whole table when I drag the table into the windows form.

In this form there is a diskett meaning that I can save data back to the
database.

So I do the following change some data in one of the control and then
click
the diskett symbol meaning I save the data back to the database.
If I now go to the next record and then go back to the previous record the
change is there.
So I manage to change in the dataset but if I then close the application
and
look in the database my changes has not changed anything in the database.

I can't understand why this doesn't work.
//Tony


Oct 22 '07 #2

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

Similar topics

9
by: Mark Johnson | last post by:
How can you save all or a portion of the Grafics object to a Image/Bitmap ? I am try to save the Images from Cards.dll to a BitMap file. I can read in the Images to the Grafics, but when I try this...
22
by: Br | last post by:
First issue: When using ADPs you no longer have the ability to issue a me.refresh to save the current record on a form (the me.refresh does a requery in an ADP). We usually do this before...
10
by: Henok Girma | last post by:
Hello Gurus, I want to save the state of an unbound DataGridView on my Windows Form application to an XML file so i can later load it back.. Basically, on my form I have a DataGridView, it's got...
2
by: mast2as | last post by:
Hi there, for a long time I've been trying to think of way of saving different data of different types using one single class (well 2 in reality, a class for the data, and 1 class for a list of...
1
by: liuliuliu | last post by:
hi -- sorry if this is trivial -- but how do you make a screenshot of a pygame display? i have a surface which is basically the entire visible screen -- how do you write this surface as an image...
6
by: Josetta | last post by:
Access 2003 I've been experiencing some problems with my "monster" database the last couple of days. I imported all objects into a new database yesterday, which pretty much stopped the crashing...
6
by: Joe Kovac | last post by:
Hi! I change quite a lot TableRows in several Tables of a typed DataSet. Now I would like to know which is the best way to save all the rows. Currently I just use each TableAdapters Update()...
1
by: QCLee | last post by:
Hello Sir, Im here again asking for help. I have a form and a subform relate to HVAC Windward Table. i have a SAVE button on the form that when clicked it saves data on the HVAC Windward Table but...
5
by: terrybell105 | last post by:
I downloaded Stephan's utility from his website but can't get it to work - or maybe I'm not driving it properly! The form works OK with the existing 3 "views" - I can switch between them and they...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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,...

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.