Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

binding textbox values on form2 from datagrid on form1

Status
Not open for further replies.

kim20

Programmer
Nov 3, 2002
9
GB
Hi

I have Form1.cs (with a datagrid)
when the datagrid is double-clicked the ID value of the record is passed to hidden text box on Form2.cs using public property form1TextBoxValue
as
Code:
this.txtID.Text  = tempvalue.ToString();

i have textboxes i would now like to populate based on the ID i have passed.
the connection and table is the same as Form1.cs but how can i best populate these textboxes.
i have created another connection, data adapter and dataset on form2.cs also.

thanks
chris
 
think i have sort of done it using

Code:
	this.daProviderEdit.SelectCommand.Parameters["@ID"].Value = txtID.Text;
dsProviderEdit.Clear();
daProviderEdit.Fill(dsProviderEdit);
[code]

i then set the databindings of each text box in the designer.

probably not the best method but works !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top