Transfer data from a user control textbox to textbox on a form - c#

I have a user control I made on a windows form.  When the control is activated the user there are several texboxes on it containing int32 values based on user input in/on the control.  I would like to have these values transfer to textboxes on the windows form, so the data from the control is included in the dataset update to the database.
Who is Participating?
p_davisConnect With a Mentor Commented:
TextBox tb = userControl.Controls["controlName"] as TextBox;
formTextBox.Text = tb.Text;
you can databind as well

formTextBox.DataBindings.Add("Text", tb ,"Text");
Joseph HornseyPresident and JanitorCommented:

You might want to post some of the code.  But, off the top of my head, here are some things that I could point out:

1. "there are several texboxes [sic] on it containing int32 values"
Textboxes don't contain int32 datatypes.  The x.Text property of the textbox contains a String.

2. To make the text in one textbox populate into another textbox, it should be relatively easy:
TextBoxB.Text = TextBoxA.Text

3. Keep in mind that the update to the database is not necessarily impacted by whether or not you've put values into textboxes.  You could always simply take the values straight from the control and update the database:

Dim TextString as String
Dim TextInt as Integer

TextString = TextBoxA.Text
TextInt = Convert.ToInt32(TextString)

<Code to Connect to Database>
<Code to Update Database>

Does that help at all?

The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

TrackerGroupAuthor Commented:
You are awesome!!  Thank you so very much for your quick response!!  It works perfectly.
TrackerGroupAuthor Commented:
It took me longer researching this on my own than asking an expert.  I should have asked the experts first.  Thanks Experts-exchange.
thanks for the compliment, i am glad it worked for you.
All Courses

From novice to tech pro — start learning today.