Results 1 to 7 of 7

Thread: [RESOLVED] data binding

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    245

    Resolved [RESOLVED] data binding

    ok, very new here. running through some beginner books but still having issues. i am going step by step in order to bind data using data adapters, datasets and such. but when i set up all the bindings to the listboxes, textboxes and such i get nothing in the boxes. now if i was going alone on this, then i would chock it up to my newbieness. but i am going by this book and it is not working. is there something wrong with my installation?
    tibor

  2. #2
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    Re: data binding

    Have you got any data in your DataSet? This could be from a database, a file, XML, manually entered data, etc.

    Give us some code so that we can point you in the right direction.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    245

    Re: data binding

    yes there is data in the dataset. i dont have any code because im doing it in design mode like the walkthrough that im doing

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    245

    Re: data binding

    heres the generated code from .net

    Me.ListBox1.DataSource = Me.DsNorthwind1.Customers
    Me.ListBox1.DisplayMember = "ContactName"
    Me.ListBox1.Location = New System.Drawing.Point(288, 112)
    Me.ListBox1.Name = "ListBox1"
    Me.ListBox1.Size = New System.Drawing.Size(184, 173)
    Me.ListBox1.TabIndex = 0
    '

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2006
    Posts
    245

    Re: data binding

    ok i figured it out. aparently you even though you have the option of binding with no coding you still have to code this in.

    SqlDataAdapter1.Fill(DsNorthwind1, "customers")

  6. #6
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    Re: [RESOLVED] data binding

    Yeah. You have to fill the dataset.

  7. #7
    Member
    Join Date
    Apr 2006
    Posts
    41

    Re: [RESOLVED] data binding

    hello,
    i can bind the data into the datagrid
    'fills dataset with only results from string
    daNamePhone.Fill(dsNamePhone, "f_name")
    'binds data into the datagrid
    DataGrid1.DataSource = dsNamePhone.Tables("f_name")

    but how can i binds data into a textbox?
    i tried
    TextBox1.DataBindings.Add("Text", daNamePhone, "f_name")
    but it does not work .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width