public static DataSet ExecuteDataset(OleDbConnection connection, CommandType commandType, string commandText, params OleDbParameter[] commandParameters)
{
if (connection == null) throw new ArgumentNullException("connection"); // Create a command and prepare it for execution
OleDbCommand cmd = new OleDbCommand();
bool mustCloseConnection = false;
PrepareCommand(cmd, connection, (OleDbTransaction)null, commandType, commandText, commandParameters, out mustCloseConnection); // Create the DataAdapter & DataSet
using (OleDbDataAdapter da = new OleDbDataAdapter(cmd))
{
DataSet ds = new DataSet(); // Fill the DataSet using default values for DataTable names, etc
da.Fill(ds);//fill的时候 提示newid未定义 // Detach the OleDbParameters from the command object, so they can be used again
cmd.Parameters.Clear(); if (mustCloseConnection)
connection.Close(); // Return the dataset
return ds;
} }
为什么呢?ps:谁有完整的sqlhelper for access 请给一份我 mikezzx#163.com
{
if (connection == null) throw new ArgumentNullException("connection"); // Create a command and prepare it for execution
OleDbCommand cmd = new OleDbCommand();
bool mustCloseConnection = false;
PrepareCommand(cmd, connection, (OleDbTransaction)null, commandType, commandText, commandParameters, out mustCloseConnection); // Create the DataAdapter & DataSet
using (OleDbDataAdapter da = new OleDbDataAdapter(cmd))
{
DataSet ds = new DataSet(); // Fill the DataSet using default values for DataTable names, etc
da.Fill(ds);//fill的时候 提示newid未定义 // Detach the OleDbParameters from the command object, so they can be used again
cmd.Parameters.Clear(); if (mustCloseConnection)
connection.Close(); // Return the dataset
return ds;
} }
为什么呢?ps:谁有完整的sqlhelper for access 请给一份我 mikezzx#163.com
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货