我将form1上的值传递给form2,并在form2上使用该值作为查询的“where”。基本上当用户单击form1上的datagrid列并按下编辑按钮时。我们将使用传递给文本框的datagrid的值转到form2。我成功地将值传递给文本框但未能插入它。继承人的代码
// form1
name = raw_input ("What is your name human?: ")
print "Got it! Your name is %r" % name
computers_owner = raw_input("Are you the owner of this machine?: ")
if computers_owner in ['1','yea','y','yo','hell yeah','true','True', 'true dat']:
print "Good! I need you %s" % name
else:
print "Call me your master! %s" % name
//表格2
private void btnEdit_Click(object sender, EventArgs e)
{
var frm2 = new frmItem(dataGridView1.Rows[0].Cells[0].Value.ToString());
frm2.Show();
this.Hide();
frm2.Text = "EDIT";
}