locked
ObjectsDataSource.Select() returned row columns to TextBox'es RRS feed

  • Question

  • User507956310 posted

     Hi Guys,

     

    I wonder if it is possible to fill individual textboxes with the columns I have obtained from my objectsdatasource.select (returns just 1 row,---always).

    So if I do:

     ObjectsDataSource.Select()

    I want

     TextBox1= ObjectsDataSource.Select("CustomerID").String

    TextBox1= ObjectsDataSource.Select("Carname").String

    etc.

     

    Is that possible?

     

    thanks,

    polynaux
     

    Monday, July 21, 2008 12:38 PM

Answers

  • User1564875471 posted

    If the Obejct type is DataSet Or TypedDataSet , then this could work

    Dim dv As Data.DataView = ObjectsDataSource1.Select()

    TextBox1.Text = dv("Carname").ToString()

    TextBox2.Text = dv("CustomerID").ToString()

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 21, 2008 1:33 PM

All replies

  • User-294030300 posted

    Hey,

    Not exactly, but why not just use a FormView, as that works with one record data...

    Monday, July 21, 2008 12:52 PM
  • User1564875471 posted

    Why you  don't call the object methods directly without a datasource ?

    Dim Obj as Customer=CustomerDal.GetById(CustomerId)

    TextBox1.Text= Customr.Name

    .....

     

    Monday, July 21, 2008 12:59 PM
  • User507956310 posted

    @bmains when I use the FormView I have to fight with thousands of erros like "declare scalar variables", "string cannot
    be truncated" and loads of stuff.
    so I want build my own formview with textboxes that are loaded with this data, edited and then
    saved/updated.
    I know how to use the objectedatasource.updateparamters("xx).defaultvalue to update my database through
    textbox text.

    @anas
    thanks for this quick way to fill my textboxes in the first place. the thing is that I have no idea
    what you provide.

    what is customerdal?  why getbyid?

    when I copy your code into my project it starts with "customer is not defined"

     

    I can import my dataset with

    Imports DataSet01

    but thats all I have figured out so far.

    Monday, July 21, 2008 1:07 PM
  • User507956310 posted

    wow, thanks bmains.

    but I wasn't really asking "how to built a three tier architecture in .net ?". I am just looking to bind my datasource row result to a textbox.
     I am trying it via the repeater control now

    Monday, July 21, 2008 1:20 PM
  • User1564875471 posted

    If the Obejct type is DataSet Or TypedDataSet , then this could work

    Dim dv As Data.DataView = ObjectsDataSource1.Select()

    TextBox1.Text = dv("Carname").ToString()

    TextBox2.Text = dv("CustomerID").ToString()

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 21, 2008 1:33 PM
  • User507956310 posted

    that works, thanks 

    Monday, July 21, 2008 2:20 PM