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

Problem with DataGrid/DataSet add/update/delete functions

I will explain the problem that i have with as much detail as i can.
I have an application developed using C# & SQL 2000. I am using a relational
database scheme.
The problem is present in this part of the application:
I have two tables, "Providers" & "Providers_Telephones", connected by a
relation:
1 Provider -> many Telephones.
I have created a DataSet that has the 2 tables and this relation defined.
I defined 1 Master DataGrid that contains all the Providers data and then a
Detail Datagrid connected by the relation that shows the Telephones of the
selected Provider.
I have created 4 Stored Procedures for each Table to do the following:
insert/mod/delete/select all.
Using 1 SQLDataAdapter for each table i fill the tables in the DataSet.
Up to here everything works as designed.
For testing purpose, i have manually added some Providers & Telephones.
When i want to mod a Telephone, i have no problems.
The problem appears when i want to add a new row, modify that new row and
delete a row. It looks like those changes NEVER took place in the DataSet, so
they are not updated in the Database.
I am using this for the "modification" operation:
this.dataSetProviders.Tables["Providers_Telephones"].RowChanged +=new
DataRowChangeEventHandler(ProvidersTelephone_RowCh anged);
[...]
private void ProvidersTelephone_RowChanged(object sender,
DataRowChangeEventArgs e)
{
if (this.dataSetProviders.HasChanges())
{
this.sqlDataAdapterTelephones.Update(this.dataSetP roviders.Providers_Telephones);
}
}

It looks like i do not know when the event to add the new/delete a Row
happens, so i am not confirming that change on the DataSet, so that change
never goes to the Database.
Any help on this will be great.
Thanks for your time.
Nov 16 '05 #1
1 2316
Nobody has an idea about this?
I think the problem must be in the update of the DataGrid or the DataSet...
Nov 16 '05 #2

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

Similar topics

3
by: Chumley the Walrus | last post by:
IN my code behind .vb page for a delete records script (this also does a deletion confirmation with a javascript popup, this gets called on my front .aspx page with the datagrid), I'm not sure if...
0
by: Leona Smyth | last post by:
I am trying to update data directly in a datagrid using the UpdateCommand. However when I click the update button in my datagrid nothing seems to happen. I keep going round in circles and can't...
0
by: David | last post by:
Hello. I have some little problem with DataSet and I hope somebody will help me. So what's my problem: I have DataSet with some table in it lets say table name is "Suppliers", I have DataGrid...
9
by: Pam Ammond | last post by:
After clicking btnDeleteSize_Click in frmSize, I move to frmSizeDelete, allow deleting a Size using a datagrid, and then return to frmSize and want to update the datagrid in frmSize to reflect the...
1
by: Harry Devine | last post by:
I have a DataGrid that is configured to use the Edit/Update/Cancel concept correctly. My grid shows values from 5 database fields. I only need to update that last 4 fields. The last field is a...
1
by: jason | last post by:
The guts of the below asp.net vb code was pieced together from another thread - all due credit to it's original author. Thank you! I've modified it to maintain a small local Microsoft 2000...
5
by: Maria Anthonsen | last post by:
I have filled a datagrid with data from a dataset. The dataset was filled with a dataadapter - and I used the wizard to create insert, update, delete commands. I would like to prevent the user...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
1
by: Andrew Wan | last post by:
Is it possible to make some of the DataGrid functionality to client-side? Such as the Edit, Update, Cancel, Delete functionality? Everytime I click on a row's Edit button, I wait 2 seconds...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.