473,508 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple Binding with Textbox Control

Sam
Hi guys,

I'm learning ADO.Net and I'm having trouble with binding a simple control,
the textbox. The problem that I'm having is updating the Northwind database
data through textbox controls. I can display, and update my data through my
datagridview control but I cannot update the data if I bind my DataSet
object through textbox controls(I can display them) .

When I run an update command( DACustomers.Update(DSCustomers1)), there is no
strange.

Does anyone have any idea what could cause this problem? Any help is greatly
appreciated.

Regards,

Sam

Feb 21 '06 #1
3 1199
Sam,

That is forever the same, if you have clicked the update button than the
data is not yet pushed into the datasource that you use.

You can do that with EndCurrentEdit.

By the way have a look at this sample.

http://www.vb-tips.com/default.aspx?...8-2e91e5295e7c

If it would be to a real database than before the update you would have to
do.
cma.endcurrentedit
Or if you have not created a currencymanager
bindingcontext(dt).endcurrentedit

(dt is exact the name for the datasource that you use in your second
paramater description of the binding ).

I hope this helps,

Cor
Feb 21 '06 #2
Sam
Hi Cor,

Thanks for the help. I'm looking at the example on the link. I have not
created the currencymanager because I thought the DataAdapter can do the
update just as it does with data on the datagrid control. And this is the
point that I don't quite understand why it does not work with the textbox

Regards,

Sam

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:OJ****************@TK2MSFTNGP09.phx.gbl...
Sam,

That is forever the same, if you have clicked the update button than the
data is not yet pushed into the datasource that you use.

You can do that with EndCurrentEdit.

By the way have a look at this sample.

http://www.vb-tips.com/default.aspx?...8-2e91e5295e7c

If it would be to a real database than before the update you would have to
do.
cma.endcurrentedit
Or if you have not created a currencymanager
bindingcontext(dt).endcurrentedit

(dt is exact the name for the datasource that you use in your second
paramater description of the binding ).

I hope this helps,

Cor

Feb 21 '06 #3
Sam,

I gave the sample because I wanted to show you this easy way with the
currencymanager.

The update is probably not done because the lack of that "endcurrentedit".

(That is it at least in 80% of this questions)

Cor

"Sam" <as****@yahoo.com> schreef in bericht
news:u6**************@TK2MSFTNGP11.phx.gbl...
Hi Cor,

Thanks for the help. I'm looking at the example on the link. I have not
created the currencymanager because I thought the DataAdapter can do the
update just as it does with data on the datagrid control. And this is the
point that I don't quite understand why it does not work with the textbox

Regards,

Sam

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:OJ****************@TK2MSFTNGP09.phx.gbl...
Sam,

That is forever the same, if you have clicked the update button than the
data is not yet pushed into the datasource that you use.

You can do that with EndCurrentEdit.

By the way have a look at this sample.

http://www.vb-tips.com/default.aspx?...8-2e91e5295e7c

If it would be to a real database than before the update you would have
to do.
cma.endcurrentedit
Or if you have not created a currencymanager
bindingcontext(dt).endcurrentedit

(dt is exact the name for the datasource that you use in your second
paramater description of the binding ).

I hope this helps,

Cor


Feb 21 '06 #4

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

Similar topics

3
1451
by: Jow Blow | last post by:
Hello All, In two different books, Simple Data Binding to a control is explained with an example of a TextBox where the data is initialized with an array. For example a class is defined as...
0
2756
by: Wesman | last post by:
Why does the following code not work (displays the correct values in the second textbox). if i chane the OnFocusChange method to the following it will work: private void OnFocusChange(object...
0
413
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
1177
by: ogs | last post by:
I need to create component that allows binding to it's properties. Maybe there exists some interface or something. Like: =================================================== public class Cat :...
4
12284
by: bardo | last post by:
Does anyone knwo how I can bind a textbox to a single dataset/dataTable row? The following will give me only a Column: textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text",...
0
1479
by: AM | last post by:
The following block of code defines a FormView control "FormView1" with an EditItemTemplate which has a Label and a TextBox control within it. While the Label "RequestIDLabel1" has one-way...
1
2038
by: AssOnFire | last post by:
Hello, I have bound a textbox to a CustomerName column of my DB, using the data binding property, and selected it from the DataTable. when i change the text in the texbBox, i try to update the...
3
5635
by: Phillip Vong | last post by:
I'm new and trying to learn. This is in VB.NET 2. I have a simple page with one Textbox1, one Label1 and one Button1. The on_click Button one goes and get's a simple data from the SQL db with...
1
2097
by: GS | last post by:
I am perplexed . I thought it is easy to fix the binding error on cvtDtFrom. I only used the cvtDtFrom a couple of places but I found out the error occurred before form loading. I tried...
0
7233
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
7135
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
7410
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
5650
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,...
1
5060
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...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
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 ...
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.