Binding textboxes

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Big E (nospam_at_nospam.com)
Date: 06/04/04


Date: Fri, 4 Jun 2004 13:09:16 -0700

I create a Connection, SQL DataAdapter, DataTable, DataSet and Fill the
Table. Now I want to bind the data in the Table to textboxes on the ASP.Net
page. I thought I could do something as simple as Textbox1.Text =
dtReg.Columns.Row(dataintable). I would rather do it in the .vb file than in
the aspx page.

I can't figure out how to do it.

Thanks.

Dim Portal As String

Dim dsReg As DataSet

Dim cnPortal As SqlConnection

Dim daReg As SqlDataAdapter

Dim dtReg As DataTable = New DataTable

Portal = ConfigurationSettings.AppSettings("Portal.ConnectionString")

dsReg = New DataSet

cnPortal = New SqlConnection(Portal)

daReg = New SqlDataAdapter("SELECT * FROM tblProspect WHERE Fname= '" &
varFirstName & "' and Lname ='" & varLastName & "'and HomePhone ='" &
varPhone & "'", cnPortal)

daReg.Fill(dsReg, "tblProspect")

dtReg = dsReg.Tables("tblProspect")



Relevant Pages

  • Re: Error Handling DAO Is Null BoundColumn?
    ... One mechanism would be to have naming convention of the textboxes, ... Dim iCol As Integer ... The macro below "Sub MyFormFields" ... Dim AInitials As String 'Authors Initials ...
    (microsoft.public.word.vba.userforms)
  • Re: Error Handling DAO Is Null BoundColumn?
    ... you don't need to shift the BoundColumn property in order to read the ... One mechanism would be to have naming convention of the textboxes, ... Dim iCol As Integer ... Dim AInitials As String 'Authors Initials ...
    (microsoft.public.word.vba.userforms)
  • RE: Prevent duplications where index contains multiple fields
    ... I would either clear the textboxes after each valid data entry or close ... Function isDataDupAs Boolean ... Dim rs As ADODB.Recordset ... Private Sub Text0_AfterUpdate ...
    (microsoft.public.access.formscoding)
  • Re: Why cant I set the textbox "text" property??
    ... for some reason I can only set properties of textboxes ... Dim intAttributes As Integer ... Dim cntCount As Integer ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Need More Help for Searching Textboxes
    ... I see where you search for an Excel file and open it, ... Then, on each sheet, you step through rows 1 ... contain the acct no, look in the textboxes. ... > Dim objFSO As Object ...
    (microsoft.public.excel.programming)