Skip to Content
author's profile photo Former Member
Former Member

Issues and bugs regarding the new Bind method of the DataBind object

Hi, (SDK 2005)

I'm trying to bind a textbox to a DataTable, doing something like

textbox.DataBind.Bind("TableName", "UniqueID")

1) it looks like there is a bug : this is not persisted when I dump the form to XML (the databind element looks like this :

<databind databound="0" table="" alias="" />

If I manually modify this element

<databind databound="1" table="Table" alias="column" />

this is ignored .. I have to do the binding the column manually ..

is this a bug or I'm doing something wrong ?

2) Is there a way to tell the textbox to bind to a specific row of the datatable .. it looks like it binds to the first row of the datatable only

Thank in advance for your help

best regards

Enrico Sabbadin

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Oct 11, 2005 at 12:11 PM

    Hi Enrico,

    When you bind to a DataTable what you put in the first parameter of the Bind method is the DataTable UID (DataTable that you should have created before and asigned to the form), in the second you put the column UID.

    It should be like

    DataBind.Bind("MyDataTable", "columnUID")

    I haven't tried with EditText, I have only used DataTables for Grids.

    What would be the advantage of using a DataTable instead of the traditionals UserDataSources or DBDataSources?

    Regards

    Trinidad.

    Message was edited by: Trinidad Martinez

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Maria Trinidad MARTINEZ GEA

      The 2005 SDK docs says

      Bind Method:

      Description

      Binds the specified DataTable to the object.

      so it does works .. the problem is that it binds to the first record of the datatable and I don't know how to bind to another row

      ---

      >What would be the advantage of using a DataTable instead >of the traditionals UserDataSources or DBDataSources?

      I'm developing a disconnected architecture I do not want to tie the UI to the Database .. so i'm using datatables for grids and userdatasources for textboxes and similar (unless I find a way to bind a textbox to a specific row of a databale). both datatables and userdatasources gets data from .NET DataSets

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.