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

Expression has been evaluated and has no value - string binding

code:
---------------- ---------------- ---------------- --------------------------------
----------------
namespace TestApp {
public partial class Form1 : Form {

private object s = "1";

public Form1() {
InitializeComponent();
Binding b = new Binding("Text", s, null, false,
DataSourceUpdateMode.OnPropertyChanged);
textBox2.DataBindings.Add(b);
}

private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
MessageBox.Show(" s = "+ s);
}

private void button1_Click_1(object sender, EventArgs e) {
//textBox2.DataBindings["Text"].ReadValue();
textBox2.DataBindings["Text"].WriteValue();
}

}
}
---------------- -------------------------------- --------------------------------
-------------------------------- -------------------------------- ----------------

problem:

-textBox2.DataBindings["Text"].ReadValue();

works okay, value "1" is copied to the textbox.

However, if I change the value of the textbox to "5" and then try
textBox2.DataBindings["Text"].WriteValue(); nothing happens. When exiting
the form, s is still "1".

Have I misunderstood something?
--
With regards,

Nick

Feb 20 '07 #1
0 4306

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

Similar topics

23
by: Paul Rubin | last post by:
OK, I want to scan a file for lines matching a certain regexp. I'd like to use an assignment expression, like for line in file: if (g := re.match(pat, line)): croggle(g.group(1)) Since...
3
by: MLH | last post by:
Am repeating question with different subject heading, perhaps stating more clearly my problem... I have an A97 query (qryVehiclesNowners2) that has a table field in it named . Depending on the...
3
by: Jason luo | last post by:
Hi all, In c99-standard page 52,there is a sentence about void,as below: If an expression of any other type is evaluated as a void expression, its value or designator is discarded. I don't...
14
by: John Temples | last post by:
Given this code: extern volatile unsigned char v; int main(void) { v; return 0; }
15
by: Nerox | last post by:
Hi, If i write: #include <stdio.h> int foo(int); int main(void){ int a = 3; foo(a); }
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
7
by: Tizzah | last post by:
What is wrong with that? regex = /^(http|https):\/\/+({1}+)*\.{2,5}(({1,5})?\/.*)?$/ if(field.hpage.value != regex.test(field.hpage.value)){ alert("Bad Homepage") field.hpage.focus()...
21
by: Steven T. Hatton | last post by:
I'm trying to improve my formal understanding of C++. One significant part of that effort involves clarifying my understanding of the vocabulary used to describe the language. This is from the...
3
by: bumwipe | last post by:
I am trying to create a program that takes string expressions and solves them mathematically (i.e. string "5 + 4 * 2" will evaluate as 13). i have this much of the program made, but I am not sure...
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...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.