PC Review


Reply
Thread Tools Rate Thread

Binding textboxes

 
 
Big E
Guest
Posts: n/a
 
      4th Jun 2004
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")


 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      4th Jun 2004
"Big E" <(E-Mail Removed)> wrote in message
news:%23b2QR$(E-Mail Removed)...
> 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.


Did that even compile?

Try dtReg.Rows(intRowNum)("columnName") instead.
--
John Saunders
johnwsaundersiii at hotmail


 
Reply With Quote
 
Big E
Guest
Posts: n/a
 
      5th Jun 2004
No it didn't compile. I just made that up as a example of the various things
I've tried.

What is the part after Rows..... --> (intRowNum).?
I've used that when I have a combobox and add contents through looping. How
would I use it if there will only be one record with a textbox.

Thanks.


"John Saunders" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> "Big E" <(E-Mail Removed)> wrote in message
> news:%23b2QR$(E-Mail Removed)...
> > 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.

>
> Did that even compile?
>
> Try dtReg.Rows(intRowNum)("columnName") instead.
> --
> John Saunders
> johnwsaundersiii at hotmail
>
>



 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      5th Jun 2004
If there's only one row, then use (0).

--
John Saunders
johnwsaundersiii at hotmail

"Big E" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> No it didn't compile. I just made that up as a example of the various

things
> I've tried.
>
> What is the part after Rows..... --> (intRowNum).?
> I've used that when I have a combobox and add contents through looping.

How
> would I use it if there will only be one record with a textbox.
>
> Thanks.
>
>
> "John Saunders" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > "Big E" <(E-Mail Removed)> wrote in message
> > news:%23b2QR$(E-Mail Removed)...
> > > 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.

> >
> > Did that even compile?
> >
> > Try dtReg.Rows(intRowNum)("columnName") instead.
> > --
> > John Saunders
> > johnwsaundersiii at hotmail
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding textboxes to dataset relationship =?Utf-8?B?TSBL?= Microsoft Dot NET Framework Forms 7 11th Sep 2009 04:56 PM
Binding to TextBoxes on MySQL with C# jwitt Microsoft ADO .NET 1 3rd Mar 2006 07:48 AM
binding data with textboxes alpoor Microsoft ASP .NET 2 16th Jun 2005 09:32 PM
Binding textboxes (again) VB Learner Microsoft Dot NET Framework Forms 3 1st Mar 2005 08:22 AM
Questions about binding textboxes. Aaron Microsoft Dot NET Framework Forms 2 30th Jan 2004 08:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:56 AM.