且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在DataGridView中显示旧值和新值

更新时间:2023-12-06 15:14:28

访问这里...



比较DataGridView单元格中的旧值和新值 [ ^ ]







添加链接文字以反映文章标题。

[/编辑]

In DataGridView, I need to display the old value and also the new value too.

I selected some values from DataTable and showing in DataGridView. It's fine next time I am going to select some value from DataTable and need to display in the same DataGridView, but that old values...

private void button1_click(object sender,EventArgs e)
{ 
    string strGetProductName;
    strGetProductName = sender.ToString();
    strGetProductName = strGetProductName.Replace("System.Windows.Forms.Button, Text: ", "");
    
    strCon = GetConnectionString();
    OleDbConnection objCon = new OleDbConnection(strCon);
    string Query = "Select Category,SubCategory,Rate,Qty from tblProduct where SubCategory ='" + strGetProductName + "' ";
    objCon.Open();
    OleDbDataAdapter adpter = new OleDbDataAdapter(Query, objCon);
    DataTable dt = new DataTable();
    adpter.Fill(dt);
    objCon.Close();
    dataGridView1.DataSource = dt;
}

visit here...

Compare old and new value in DataGridView cell[^]


[Edit member="Tadit"]
Link text added to reflect the article title.
[/Edit]