PC Review


Reply
Thread Tools Rate Thread

binding data with textboxes

 
 
alpoor
Guest
Posts: n/a
 
      16th Jun 2005
I have lots of textboxes on my webform. I need to bind them with fields
from table. I am not sure how to bind with textboxes. I have seen so many
samples for dropdown boxes and datagrid binding, but not with textboxes

Is there any easy of doing it

Any ideas

Thanks


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm91bmkgS2FycHBpbmVu?=
Guest
Posts: n/a
 
      16th Jun 2005
One solution could be using naming convention for textboxes like
ID="txt_[DBColumnName]"
When reading data from db you can set right value to right textbox by using
FindControl-method.
((TextBox)Page.FindControl("txt_[CurrentDBColumn]")).Text = [CurrentDBValue]

I assume that your SQL returns only one row which contains values, otherwise
you should use DataGrid, DataList or Repeater






"alpoor" wrote:

> I have lots of textboxes on my webform. I need to bind them with fields
> from table. I am not sure how to bind with textboxes. I have seen so many
> samples for dropdown boxes and datagrid binding, but not with textboxes
>
> Is there any easy of doing it
>
> Any ideas
>
> Thanks
>
>
>

 
Reply With Quote
 
=?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
Guest
Posts: n/a
 
      16th Jun 2005
Individual text boxes cannot be bound as easily as repetitive controls. You
still have the option, but you could end up with an error if you have
multiple rows and generically set to a field.

Normally, textbox binding is done behind the scenes rather than
declaratively.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


"alpoor" wrote:

> I have lots of textboxes on my webform. I need to bind them with fields
> from table. I am not sure how to bind with textboxes. I have seen so many
> samples for dropdown boxes and datagrid binding, but not with textboxes
>
> Is there any easy of doing it
>
> Any ideas
>
> 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 to TextBoxes on MySQL with C# jwitt Microsoft ADO .NET 1 3rd Mar 2006 07:48 AM
Binding Data to Forms, Textboxes etc. Ed Warren Microsoft Access Form Coding 3 10th Jul 2005 03:47 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
Is there a way to edit a database without Data Binding TextBoxes? HAN(removethis)twister Microsoft VB .NET 1 9th Feb 2004 04:03 AM


Features
 

Advertising
 

Newsgroups
 


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