473,466 Members | 1,381 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Binding textboxes

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.Connecti onString")

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")
Nov 18 '05 #1
3 1028
"Big E" <no****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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
Nov 18 '05 #2
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" <jo**************@notcoldmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Big E" <no****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #3
If there's only one row, then use (0).

--
John Saunders
johnwsaundersiii at hotmail

"Big E" <no****@nospam.com> wrote in message
news:OR**************@TK2MSFTNGP09.phx.gbl...
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" <jo**************@notcoldmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Big E" <no****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jesse | last post by:
Hi there, I am trying to bind a combobox and some textboxes to a single table in a dataset. I want it so that when a (unique) value in the combobox is selected, the other textboxes show...
2
by: alpoor | last post by:
I have lots of textboxes on my webform. I need to bind them with fields from table. I am not sure how to bind with textboxes. I have seen so many samples for dropdown boxes and datagrid binding,...
6
by: Scott Mueller | last post by:
I have a question about simple binding: (please forgive any syntax errors... I am at home, where I do not have Vb.Net installed, and I rely far too much on Vb's intellisense!) If I have two...
4
by: Steven Smith | last post by:
Hi guy's whats the syntax for binding the text property of a textbox to a particular field in a dataview programatically ? here's the scenario my form has two main sections the first is a...
3
by: Slonocode | last post by:
I have some textboxes bound to an access db. I wanted to format the textboxes that displayed currency and date info so I did the following: Dim WithEvents oBidAmt As Binding oBidAmt = New...
2
by: nate axtell | last post by:
After binding a DataGrid and a few TextBoxes to the same DataTable in VB ..NET I successfully see the TextBoxes update when I change the selection in the DataGrid. I put DataGrid1.Invalidate() in...
2
by: Matthias | last post by:
Hi Team this may be a newbie question. I have searched the discussions before posting: I'd like to re-use a form instance to edit record details. My data binding (a DataTable bound to...
2
by: Rich | last post by:
Hello, Following an example at http://www.vb-tips.com/dbpages.aspx?IA=DG (by Cor Lightert and Ken Tucker) on binding a dataRelation to a Datagridview for sqlClient, I was able to view rows...
2
by: Bob | last post by:
Got a datagridview with records bound to tableParent. Each time I go to a new row (single select) in the datagrid view I want a series of textboxes as well as another datagridview to shwo the...
3
by: Max | last post by:
Hello, I made a windows form with a combo box and 4 text boxes. All 5 objects should get their data from a data set which is populated in the form load method. The combo box has item ids. When...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.