public override int Fill(DataSet dataSet) { command = (RiaDbCommand)this.SelectCommand; connection = (RiaDbConnection)command.Connection; provider = connection.Provider; var parameters = this.GetFillParameters(); RemoteInvoke agent = new RemoteInvoke(new Uri(provider.DataSource)); string sql = command.CommandText; string code = $"var cmd=new tw.Common.SqlCmdDirect('{sql}');ds=cmd.FillDataSet();"; agent.Execute(code); var ds = agent.GetValue <DataSet>("ds"); if (ds != null) { foreach (DataTable dt in ds.Tables) { dataSet.Tables.Add(dt.Copy()); } } return(0); }
public RiaDbCommand(string cmdText, RiaDbConnection connection) { this.CommandText = cmdText; this.CommandType = CommandType.Text; this.DbConnection = connection; this.agent = new RemoteInvoke(new Uri(connection.Provider.DataSource)); }
public override int Fill(DataSet dataSet) { command = (RiaDbCommand)this.SelectCommand; connection = (RiaDbConnection)command.Connection; provider = connection.Provider; var parameters = this.GetFillParameters(); RemoteInvoke agent = new RemoteInvoke(new Uri(provider.DataSource)); string sql = command.CommandText; string code = $"var cmd=new tw.Common.SqlCmdDirect('{sql}');ds=cmd.FillDataSet();"; agent.Execute(code); var ds = agent.GetValue<DataSet>("ds"); if (ds != null) { foreach (DataTable dt in ds.Tables) { dataSet.Tables.Add(dt.Copy()); } } return 0; }