public ComCommand CreateCommand() { ComCommand cmd = new ComCommand(); cmd.Command = _con.CreateCommand(); return(cmd); }
public int ExecuteNonQuery(CommandType commandType, string commandText, Param commandParameters) { ComCommand cmd = new ComCommand(); PrepareCommand(cmd, commandType, commandText, commandParameters); int tmpValue = cmd.ExecuteNonQuery(); cmd.Parameters.Clear(); return(tmpValue); }
public object ExecuteScalar(CommandType commandType, string commandText, Param commandParameters) { ComCommand cmd = new ComCommand(); PrepareCommand(cmd, commandType, commandText, commandParameters); object tmpValue = cmd.ExecuteScalar(); cmd.Parameters.Clear(); return(tmpValue); }
public ComDataReader ExecuteReader(CommandType commandType, string commandText, Param commandParameters) { ComCommand cmd = new ComCommand(); PrepareCommand(cmd, commandType, commandText, commandParameters); ComDataReader dr = cmd.ExecuteReader(); cmd.Parameters.Clear(); return(dr); }
public DataView ExecuteDataView(CommandType commandType, string commandText, Param commandParameters) { DataSet ds = new DataSet(); ComCommand cmd = new ComCommand(); PrepareCommand(cmd, commandType, commandText, commandParameters); ComDataAdapter da = new ComDataAdapter(cmd); da.Fill(ds, "MyTableName"); cmd.Parameters.Clear(); return(ds.Tables["MyTableName"].DefaultView); }
public DataSet ExecuteDataset(CommandType commandType, string commandText, Param commandParameters, DataSet ds, string tableName) { ComCommand cmd = new ComCommand(); PrepareCommand(cmd, commandType, commandText, commandParameters); ComDataAdapter da = new ComDataAdapter(cmd); if (Object.Equals(tableName, null) || (tableName.Length < 1)) { da.Fill(ds); } else { da.Fill(ds, tableName); } cmd.Parameters.Clear(); return(ds); }
private void PrepareCommand(ComCommand cmd, CommandType commandType, string commandText, Param commandParameters) { cmd.CommandType = commandType; cmd.CommandText = commandText; cmd.Connection = this._dbconn; if (trans == null) { cmd.Transaction = null; } else { cmd.Transaction = trans.Transaction; } if ((commandParameters != null) && (commandParameters.Count > 0)) { for (int i = 0; i < commandParameters.Count; i++) { cmd.Parameters.AddWithValue(commandParameters[i].ParameterName, commandParameters[i].Value); } } }
public ComDataAdapter(ComCommand cmd) { _da = new SqlDataAdapter(cmd.Command); }
public ComDataAdapter(ComCommand cmd) { _da = new System.Data.OracleClient.OracleDataAdapter(cmd.Command); }