Home All Groups Group Topic Archive Search About

Simple Binding with Textbox Control

Author
21 Feb 2006 4:15 AM
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

Author
21 Feb 2006 7:14 AM
Cor Ligthert [MVP]
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?ID=c6c7d9a8-7511-41a1-a488-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
Author
21 Feb 2006 1:48 PM
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

Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:OJ%23KNZrNGHA.3788@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?ID=c6c7d9a8-7511-41a1-a488-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
>
>
Author
21 Feb 2006 2:46 PM
Cor Ligthert [MVP]
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



Show quoteHide quote
"Sam" <ask***@yahoo.com> schreef in bericht
news:u6MC51uNGHA.2320@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]" <notmyfirstn***@planet.nl> wrote in message
> news:OJ%23KNZrNGHA.3788@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?ID=c6c7d9a8-7511-41a1-a488-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
>>
>>
>
>