我加載的數據從數據表到DataGridView中看起來是這樣的:運行時在數據Gridview行單元中顯示結果?
SerialNumber1 | Quantity | Issued Quantity | Status |
00001 | 1 | | |
00002 | 2 | | |
我有這樣的要求,這讓我卡住了。
我需要查詢數據數據網格視圖記錄來驗證加載的序列號是否與實際相同。 (也許使用LINQ - 糾正我,如果我不正確)
例:
var dgviewData = from a in gdview1.AsEnumerable()
where a<string>("SerialNumber").tostring() == txtserial.text
select a;
if(a.Count() > 0)
{
// Update Status of SerialNumber 00001 to Ok
}
else
{
//Error Serial Not Exist on Gridview
}
如果DGview SerialNumbers是掃描的實際序列相同,狀態會在運行時更新datagridview的行只有細胞。
如:DGview串行= 00001 --->單位實際掃描中問候= 00001
SerialNumber1 | Quantity | Issued Quantity | Status |
00001 | 1 | 1 | Ok |
00002 | 2 | | |
感謝....
你的意思是寫入數據庫,然後更新DGview? – soandos 2011-05-20 07:50:12
..我只需要更新datagridview行單元格...請參閱我的更新後的帖子.. – BizApps 2011-05-20 08:29:38