我想改变这个
string query = "Update tbPegawai set Total_Gaji = Total_Gaji + where Kode_Pegawai = " + textBoxKDPegawai.Text + "";
到此:
string query = "Update tbPegawai set Total_Gaji = Total_Gaji + "**Label**" where Kode_Pegawai = " + textBoxKDPegawai.Text + "";
我该怎么做?
答案 0 :(得分:0)
string query =“更新tbPegawai设置Total_Gaji = Total_Gaji + \”Label \“其中Kode_Pegawai =”+ textBoxKDPegawai.Text +“”;
或
string query = @“更新tbPegawai设置Total_Gaji = Total_Gaji +”Label“其中Kode_Pegawai =”+ textBoxKDPegawai.Text +“”;
答案 1 :(得分:0)
我认为你正在寻找这个:
string query = string.Format(@"Update tbPegawai set Total_Gaji = Total_Gaji + ""{0}"" where Kode_Pegawai = ""{1}""",Label.Text,textBoxKDPegawai.Text);