Click here to Skip to main content
15,908,264 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I have two gridview (with two "send" button) with same column names and textbox with a button, I write to textbox some ID and when I click this button 1st gridview execute "sp_xyz" and takes value from there, after 1st gridview get value I am clicking 1st gridview send button to send values 2nd gridview but I want to execute "sp_123" but I could not figured that out, sp_xyz already declared in sp_123 I do not have any problem with sql part. I want learn how I execute sp_123 for takes value from 1st gridview to send 2nd gridview.

What I have tried:

I have been trying to get value with databind, SetOutData, I listed object and I get value but I could not show in 2nd gridview, I am losing data somewhere.
Posted
Updated 28-Jul-16 22:58pm
v3

The easiest and the quickest i could think of is

C#
private void Form1_Load(object sender, EventArgs e)
		{
			DataGridViewRow row = (DataGridViewRow)dataGridView1.Rows[0].Clone();
			row.Cells[0].Value = "XYZ";
			row.Cells[1].Value = 50.2;
			dataGridView1.Rows.Add(row);

//copying it to grid two 
//considering they have same columns

			foreach (DataGridViewRow r in dataGridView1.Rows)
			{
				row = (DataGridViewRow)dataGridView2.Rows[0].Clone();
				row.Cells[0].Value = r.Cells[0].Value;
				row.Cells[1].Value = r.Cells[1].Value;
				dataGridView2.Rows.Add(row);
			}

		}
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900