binding.... pls help

Results 1 to 2 of 2

Thread: binding.... pls help

  1. #1
    Join Date
    Dec 1969

    Default binding.... pls help

    i&#039;ve been over every binding tutorial and can&#039;t get this right, but i hope i&#039;m close and someone could help...<BR><BR>//code snippet<BR>str = "SELECT homes.*, users.ID FROM homes INNER JOIN users ON homes.ID = users.ID WHERE users.username=&#039; & username & &#039;;"<BR> <BR>myAdapter = New OleDbDataAdapter( str, conn )<BR><BR>myDS = new DataSet()<BR>myAdapter.Fill(myDS, "homes")<BR>DataBind()<BR><BR>conn.Close()<BR> <BR>// i&#039;m just trying to fill a textbox...<BR>&#060;asp:Textbox <BR> ID="site_title" <BR> datasource="&#060;%# site_title %&#062;" &#039;not right<BR> runat="Server" /&#062;

  2. #2
    Join Date
    Dec 1969

    Default 3 suggestions

    first, you are not using a command object, or the SelectCommand member of the dataadapter. but that might be ok. there are numerous ways to make work, and your way might be fine. the only way to tell if you need to fix the part is to first fix the part as follows:<BR><BR>second, your code in the SUB needs to populate the Text property of the textbox control. this is done right after the fill command in your code. here is an example from a different script:<BR>Dim strOrgNameTextBox As String = tblOrgIDlabel.Rows(0)("Name")<BR>OrgNameTextBox.Te xt = strOrgNameTextBox<BR><BR>third, you might need to add some arguments to your textbox control in order to attach it to the dataset. though i am unsure about this as i look at my own (properly working) code because i wonder from the logic if the following is not necessary if you have already set the text property as shown above. an example of functional wording for a textbox control is as follows:<BR>&#060;asp:textbox id="OrgNameTextBox" DataValueField = "Name" DataTextField = "Name" runat="server"/&#062;<BR>

Posting Permissions

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