473,320 Members | 2,083 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,320 software developers and data experts.

Trouble with databinding on a textbox

Hi,

I am having trouble with the databinding of my textboxes. They display
correctly the data they are getting from the dataset but when I enter a new
value, nothing seems to have changed and the following if statement never
gets true.
if (dataSet1.HasChanges(DataRowState.Modified))

{

MessageBox.Show("Changed");

}

I can't believe that I have to write code to update the dataset with the
textbox values, so what must I do to get this correct?

Thanks and best regards,

AEgir


Nov 17 '05 #1
1 1336
I have discovered the solution myself:

The magic lines are:
myCurrencyManager =
(CurrencyManager)this.BindingContext[dataSet1,"MyField"];

and

myCurrencyManager.EndCurrentEdit();

Thanks,

AEgir

"AEgir Sveinsson" <ae***@origo.is> wrote in message
news:u5**************@TK2MSFTNGP12.phx.gbl...
Hi,

I am having trouble with the databinding of my textboxes. They display
correctly the data they are getting from the dataset but when I enter a
new value, nothing seems to have changed and the following if statement
never gets true.
if (dataSet1.HasChanges(DataRowState.Modified))

{

MessageBox.Show("Changed");

}

I can't believe that I have to write code to update the dataset with the
textbox values, so what must I do to get this correct?

Thanks and best regards,

AEgir

Nov 17 '05 #2

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

Similar topics

0
by: Robert Ludig | last post by:
How do I bind a textbox to a simple string varaible with databinding? I managed to do the binding but unfortnatedly the textvox does not get updated when I change the string wich the textbox is...
1
by: | last post by:
Hi, I posted a message a while ago about programatically databinding and got a response that did not make sense to me. Here's a brief description of what I want to do. If I create a regular...
2
by: Colin Robinson | last post by:
Help please I have an example class called Person with 2 public properties Firstname and Lastname, I cant create a textbox on an asp.net form bound to the Person.Firstname property Can...
2
by: Al Smith | last post by:
I kind of understand how the below works, however I am trying to do it at runtime vrs design time. <asp:TextBox id="TextBox1" runat="server" Text='<%# StateList.SelectedItem.Text...
0
by: Kevin Hodgson | last post by:
I have a ComboBox and a TextBox bound to a Dataset/datatable returned from a SQL Database. The databinding is set in Design Mode. Everything works fine on my initial fill, and I get the correct...
2
by: John R. Lewis | last post by:
I posted this yesterday with a different email address. I am reposting with my fake-address as given to me by Microsoft so that I can be guraranteed a response from a support representative. Sorry...
3
by: Hayden Kirk | last post by:
Hi, I'm trying to add databinding to the wizard control. Basically a user is entering their email address and I want to validate this to a sql database when the hit next but I cannot get this to...
7
by: Naveen | last post by:
I posted this message to another board and have hardly had any views on it, leave alone answers. So I am cross-posting here. This may be a very simple question but I can't get my head around it....
3
by: Peter | last post by:
Hi! I am having some very strange behavior with my databound controls. It's taken a long time to isolate exactly what is provoking the problem, but I'm still leagues away from solving it. I...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.