473,804 Members | 3,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_Cl ick(object sender, System.EventArg s e)

{

SqlCommandBuild er cm = new SqlCommandBuild er(sqlDataAdapt er1);

sqlDataAdapter1 .Update(dataSet Usuario1);

}

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 1258
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_Cshar p" <jo*********@ya hoo.es> escribió en el mensaje
news:#a******** ******@TK2MSFTN GP10.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_Cl ick(object sender, System.EventArg s e)

{

SqlCommandBuild er cm = new SqlCommandBuild er(sqlDataAdapt er1);

sqlDataAdapter1 .Update(dataSet Usuario1);

}

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
4103
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
1220
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 the table names a post back is fired. During the post back the datagrid has columns added to it dynamically to represent each of the columns in the selected table When the user clicks the edit button on a given row the cells then have textboxes...
0
1759
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 for editing and deleting data. When a user clicks on the "Edit" button in the datagrid, Edit() method is called and the appropriate row is changed into textboxes. And if user clicks on the "Update" button, the Update() method is fired. But if...
7
4143
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 that fast but I would like to update the data maybe twice a second. Currently, I have about 20 textboxes that get updated at once. This seems to be a pretty slow process. I'm looking for suggestions. What is the best way to update the .text...
0
9591
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10331
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10087
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7631
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.