111,125
社区成员
发帖
与我相关
我的任务
分享
public CustomerInformaion_xiugai()
{
InitializeComponent();
}
private string str;//定义的私有变量
public string STR//为窗体Form2定义的属性
{
get { return str; }//读
set//写
{
str = value;
}
}
Public_SQL public_sql = new Public_SQL();
private void CustomerInformaion_xiugai_Load(object sender, EventArgs e)
{
this.comboBox1.Items.Clear();
string sqlselect = "select *from T_BasicInformation_District";
public_sql.getComboBox(sqlselect, comboBox1, 0);
SqlConnection sqlcon = new SqlConnection("Server =(local);database = SalesManagementSystem;uid =sa;pwd = 123");
if (sqlcon.State == ConnectionState.Closed)
sqlcon.Open();
SqlDataAdapter sda = new SqlDataAdapter("Select FCustomerNumbers,FCompanyName,FLegal,FAddress,FTelephone,FFax,FDistrictID,Fbeizhu from T_BasicInformation_Customer where FCustomerNumbers ='"+ str +"'" , sqlcon);
DataSet ds = new DataSet();
sda.Fill(ds);
DataTable dt = ds.Tables[0];
this.textBoxFCustomerNumbers.Text = dt.Rows[0][0].ToString();public void xiugai()
{
if (dataGridView1.SelectedRows.Count != 0)
{
string xiugai = dataGridView1[0, dataGridView1.CurrentRow.Index].Value.ToString();
customerinformaion_xiugai.STR = xiugai;
customerinformaion_xiugai.ShowDialog();
this.shuaxindgv();
}
else
{
return;
}
}