是通过这么一种方式来往表中插入记录的
1
DataTable dt = DataAccess.GetTable("tableName");
2
DataRow dr = dt.NewRow();
3
dr["col1"] = 1;
4
dr["col2"] = "test str";
5
dt.Rows.Add(dr);
6
DataAccess.UpdateDateTable(dt);
2
3
4
5
6
DataAccess.GetTable 和 UpdateDataTable 是这么实现的。
1
public static DataTable GetTable(string tablename)
2
}
2
大家看看,有感想吗?