コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: RiaDbDataAdapter.cs プロジェクト: fjiang2/sqlcon
        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;
        }