0

当按下按钮时,我想在 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
4

1 回答 1

0

该值是否存在于您的 RepositoryItemComboBoxEdit 的 Items 集合中?

于 2013-11-10T05:36:37.467 回答