當我雙擊DataGridView單元格(行)時,我需要選擇並編輯新行中的一行。我到目前爲止已經做的是:Datagrdview以新形式編輯
public partial class Vozila : Form
{
public static int cellValue = 0;
public Vozila()
{
InitializeComponent();
}
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
cellValue = Convert.ToInt32(((DataGridView)sender).SelectedCells[0].Value);
DodajVozilo check = new DodajVozilo();
Check.Show();
}
理念要做到這一點是使用可變cellValue(在DodajVozilo_Load新形式DodajVozilo),並與第 WHERE id=cellValue
MySql的SELECT命令,但一個不能得到任何有用的結果。公共靜態int變量的WHERE子句語法是什麼? 有沒有其他想法?
從閱讀你的問題,我認爲你正在尋找你的SQL查詢的where子句是否正確? – Sybren 2014-12-09 12:48:04