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

update with textboxes

Hello group,
I trying to do an aplicattion where it shows the data from a sql server
database and you can save the changes. When I use a datagrid I haven´t any
problem to update de changes but when I use textboxes to show and make the
changes of any field of the table the command UPDATE doesn´t run correctly
(with no errors but doesn´t update de table).
I use the wizard to generate the sqlConnection, sqlDataAdapter ang the
DataSet. I use the DataBindings of the textboxes to link with the dataSet.

I'm using to update:
private void buttonUpdate_Click(object sender, System.EventArgs e)

{

SqlCommandBuilder cm = new SqlCommandBuilder(sqlDataAdapter1);

sqlDataAdapter1.Update(dataSetUsuario1);

}

I don´t know where is the error, I try with the calling the method
GetChanges and AcceptChanges of the dataSet but nothing. Thanks in
advance!!!
Nov 16 '05 #1
1 1243
I will answer my own question. Well I can update the database using the
textbox with databings adding the next line before to call the update method
to end the editing on the current record, saving changes to the underlying
dataset:

BindingContext[myDataSet, "myTable"].EndCurrentEdit();


"Jose_Csharp" <jo*********@yahoo.es> escribió en el mensaje
news:#a**************@TK2MSFTNGP10.phx.gbl...
Hello group,
I trying to do an aplicattion where it shows the data from a sql server
database and you can save the changes. When I use a datagrid I haven´t any
problem to update de changes but when I use textboxes to show and make the
changes of any field of the table the command UPDATE doesn´t run correctly
(with no errors but doesn´t update de table).
I use the wizard to generate the sqlConnection, sqlDataAdapter ang the
DataSet. I use the DataBindings of the textboxes to link with the dataSet.

I'm using to update:
private void buttonUpdate_Click(object sender, System.EventArgs e)

{

SqlCommandBuilder cm = new SqlCommandBuilder(sqlDataAdapter1);

sqlDataAdapter1.Update(dataSetUsuario1);

}

I don´t know where is the error, I try with the calling the method
GetChanges and AcceptChanges of the dataSet but nothing. Thanks in
advance!!!

Nov 16 '05 #2

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

Similar topics

7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
1
by: Demetri | last post by:
I have a datagrid on an aspx page with one column added via property builder - the edit/update/cancel. In addition there is a dropdownlist which has a list of table names. Upon selecting one of...
0
by: Erik | last post by:
Why isn't my update method getting called? Pasted below is an aspx from a 1.1 application I'm working on. It has two textboxes and a button for inserting data into the database, and a datagrid...
7
by: =?Utf-8?B?Sm9lIFRob21wc29u?= | last post by:
Hi, I have a C# windows form application (.NET 2.0) that reads data over the serial port and displays the data via textboxes. I get a message 50 times/second. I know I can't update the screen...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.