📄 26.12.txt
字号:
Listing 26.12 Updating a SQL Server CE Database
private void btnChange_Click(object sender, System.EventArgs e)
{
DataGridCell currentCell;
string currentCellData;
// Get the text to put into the current cell.
currentCellData = tbNewValue.Text;
// Get the current cell.
currentCell = dataGrid1.CurrentCell;
// Set the current cell’s data.
dataGrid1[currentCell.RowNumber,currentCell.ColumnNumber] = currentCellData;
// update the data source
DataRow updateRow =
catalogDataSet.Tables[“Catalog”].Rows[dataGrid1.CurrentRowIndex];
updateRow[“Title”] = dataGrid1[dataGrid1.CurrentRowIndex,1];
updateRow[“Artist”] = dataGrid1[dataGrid1.CurrentRowIndex,2];
sqlDataAdapter.Update( catalogDataSet, “Catalog” );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -