当按下按钮时,我想在 TECNICO 列中设置组合框文本。
但是在运行时我无法在TECNICO列中显示设置值
private void asing_Click(object sender, EventArgs e)
{
if ( tecnicos.Text.Length > 0)
{
try
{
SqlConnection con = conec.ObtenerCon();
SqlCommand sel = new SqlCommand("SELECT * FROM RTID_STATUS WHERE ID_RTID='" + gridView1.GetFocusedRowCellValue(colID_RTID) + "'", con);
SqlDataReader rs = sel.ExecuteReader();
if (rs.Read())
{
con.Close();
SqlConnection con1 = conec.ObtenerCon();
MessageBox.Show(" hay :\t" + gridView1.GetFocusedRowCellValue(colID_RTID));
SqlCommand up = new SqlCommand("UPDATE RTID_STATUS SET ID_TECH='" + idtec(tecnicos.Text) + "'", con1);
gridView1.SetRowCellValue(gridView1.FocusedRowHandle, tec,tecnicos.Text.ToString());
gridView1.RefreshRow(gridView1.FocusedRowHandle);
SqlDataReader resu = up.ExecuteReader();
con1.Close();
}
else