private void DemonstrateRowVersions(){
// Create a DataTable.
DataTable myTable = new DataTable("myTable");
// Create two columns. Set DataType and DefaultValue properties.
DataColumn col1 = new DataColumn("col1");
col1.DataType=System.Type.GetType("System.String");
col1.DefaultValue= "myDefaultValue";
DataColumn col2 = new DataColumn("col2");
col2.DataType=System.Type.GetType("System.Decimal");
col2.DefaultValue=.1;
// Add Columns to the DataTable.
myTable.Columns.Add (col1);
myTable.Columns.Add(col2);
DataRow newRow;
// Create one row and add it to the DataRow collection.
newRow = myTable.NewRow();
newRow[col1]="Nitrogen";
newRow[col2]=33;
myTable.Rows.Add(newRow);
// Invoke AcceptChanges on the table.
myTable.AcceptChanges();
// Print the current values:
PrintRowVersion(myTable, DataRowVersion.Current);
// Create a DataTable.
DataTable myTable = new DataTable("myTable");
// Create two columns. Set DataType and DefaultValue properties.
DataColumn col1 = new DataColumn("col1");
col1.DataType=System.Type.GetType("System.String");
col1.DefaultValue= "myDefaultValue";
DataColumn col2 = new DataColumn("col2");
col2.DataType=System.Type.GetType("System.Decimal");
col2.DefaultValue=.1;
// Add Columns to the DataTable.
myTable.Columns.Add (col1);
myTable.Columns.Add(col2);
DataRow newRow;
// Create one row and add it to the DataRow collection.
newRow = myTable.NewRow();
newRow[col1]="Nitrogen";
newRow[col2]=33;
myTable.Rows.Add(newRow);
// Invoke AcceptChanges on the table.
myTable.AcceptChanges();
// Print the current values:
PrintRowVersion(myTable, DataRowVersion.Current);
解决方案 »
- 微软SAPI二次开发
- 在C#中如何在不用方法的前提下維持一個線程的一直調用一個方法?
- .net sdk中的示例代码怎么看不到了
- 使用visual studio2005的system.net.mail发送邮件时出现错误
- 如何连续打印收据?每次打印机走纸时只走自定义的纸张高度?程序里好象可以设置纸张大小,没有效果,每次打印时还是将整张纸打走完
- xml 查询问题
- treeView
- 构造函数的问题?--怎样产生了一的实例?
- 调用函数时显示变量说明
- 有没有内蒙古地区C#高手和驱动开发或系统核心高手,请帖联系方式
- 怎样编程实现用给定的R,G,B三个值来为textbox的BackColor负值?
- 强烈推荐http://www.uncj.net网站
private OleDbCommand NewBDTableCommand()
{
if(newBDTableCommand == null)
{
OleDbConnection testConnection = new OleDbConnection(LabManageConfiguration.ConnectionString);
string mySelectQuery="CREATE TABLE"+BDData.BD_TABLE+"....... ";
newBDTableCommand =new OleDbCommand(mySelectQuery, testConnection);
//BData是已经构建的数据集,BD_TABLE是该数据集内的表名( 变量)
newBDTableCommand.Parameters.Add(new OleDbParameter(BDData.BD_TABLE, OleDbType.VarChar,10 ));
}
return newBDTableCommand;
}