select stmt to a textbox

Results 1 to 2 of 2

Thread: select stmt to a textbox

  1. #1
    Join Date
    Dec 1969

    Default select stmt to a textbox

    i&#039;m not able to get the correct syntax to get the value dataset items into a textbox<BR><BR>// code<BR>Sub Page_Load ( s As Object, e As EventArgs )<BR>Dim conn As OleDbConnection<BR>Dim str As String<BR>Dim username As String<BR>Dim myAdapter As OleDbDataAdapter<BR>Dim myDS As DataSet<BR><BR>username = request.params("username")<BR><BR> conn = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE=c:websites
    laink emphomeshomes2.mdb" )<BR> <BR> str = "SELECT homes.*, users.ID where homes.user_id = users.ID and username=&#039;" & username & "&#039;"<BR> <BR> myAdapter = New OleDbDataAdapter( str, conn )<BR><BR>myDS = new DataSet()<BR> myAdapter.Fill(myDS)<BR> conn.Close()<BR>End Sub<BR><BR>// textbox<BR>&#060;asp:Textbox <BR> ID="site_title" <BR> size="50" <BR> Text=&#060;%# myDS.site_title %&#062; <BR> runat="Server" /&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: select stmt to a textbox

    &#060;%# is databinding syntax; nowhere do you call DataBind() on that control (or it&#039;s Naming Container).<BR><BR>Take a peek at this:<BR><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