PC Review


Reply
Thread Tools Rate Thread

Binding to TextBoxes on MySQL with C#

 
 
jwitt
Guest
Posts: n/a
 
      2nd Mar 2006
Ref: WinXP SP2, MySQL 5.0, .NET 1.1, C#

I try to bind columns to TextBoxes. The column data appears in the
textboxes, but if modified will not update. My code came from MySQL
example, which uses a datagrid. If cols in the datagrid are modified
they update fine.

The following code:

DataTable changes;


changes = this.data.GetChanges();
x = 1;
this.da.Update( changes );
this.data.AcceptChanges();

yields the error "Value cannot be null", as I guess 'changes' is null
because nothing in the DataGrid has changed.

So, how to get the TextBox bindings to yield non-null 'changes'

FYI: 'data' is a DataTable, 'da' is MySQLDataAdapter

Thanks!
 
Reply With Quote
 
 
 
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      3rd Mar 2006
jwitt,

Mostly will help you to do a endcurrentedit in version 1.x (AFAIK does
EndEdit now the same in 2.0) to push the data down in the datasource, what
is standard only done by a rowchange.

typed here so watch typos or whatever

Therefore before your update
\\\
Bindingcontext[this.data].EndCurrentEdit();
///

I hope this helps,

Cor

"jwitt" <(E-Mail Removed)> schreef in bericht
news:%23Ca%(E-Mail Removed)...
> Ref: WinXP SP2, MySQL 5.0, .NET 1.1, C#
>
> I try to bind columns to TextBoxes. The column data appears in the
> textboxes, but if modified will not update. My code came from MySQL
> example, which uses a datagrid. If cols in the datagrid are modified they
> update fine.
>
> The following code:
>
> DataTable changes;
>
>
> changes = this.data.GetChanges();
> x = 1;
> this.da.Update( changes );
> this.data.AcceptChanges();
>
> yields the error "Value cannot be null", as I guess 'changes' is null
> because nothing in the DataGrid has changed.
>
> So, how to get the TextBox bindings to yield non-null 'changes'
>
> FYI: 'data' is a DataTable, 'da' is MySQLDataAdapter
>
> Thanks!



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding Checkboxes to MySQL jwitt Microsoft ADO .NET 1 4th Apr 2006 07:47 AM
binding data with textboxes alpoor Microsoft ASP .NET 2 16th Jun 2005 09:32 PM
Binding textboxes (again) VB Learner Microsoft Dot NET Framework Forms 3 1st Mar 2005 08:22 AM
Binding textboxes Big E Microsoft ASP .NET 3 5th Jun 2004 03:48 AM
Questions about binding textboxes. Aaron Microsoft Dot NET Framework Forms 2 30th Jan 2004 08:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:56 AM.