コード例 #1
0
        private async Task ExecuteNonQuery(DataSItem temp)
        {
            using (frmparamLoad load = new frmparamLoad(_selectedProcedure))
            {
                if (load.ShowDialog() == DialogResult.OK)
                {
                    if (load.Result != null)
                    {
                        _selectedProcedure = load.Result;

                        lblStatues.Text = "Loading NonQuery procedure ";
                        ExecAsyncResult result = await _selectedProcedure.ExecuteNonQueryAsync(_currentAgent);


                        lblStatues.Text = "Done.";
                        rTxtresult.AppendColorText(result.ToString(), Color.Blue);


                        if (_selectedProcedure.HasOutputParam)
                        {
                            rTxtresult.AppendColorText("Output Params", Color.GreenYellow);
                            foreach (DataParam dataParam in _selectedProcedure.OutputParams.Values)
                            {
                                rTxtresult.AppendColorText(dataParam.Name + " = " + dataParam.Value, Color.Green);
                            }
                            rTxtresult.AppendColorText(new string('-', 30), Color.GreenYellow);
                        }
                    }
                }
            }
        }
コード例 #2
0
        private async Task ExecuteDs(DataSItem temp)
        {
            using (frmparamLoad load = new frmparamLoad(temp))
            {
                if (load.ShowDialog() == DialogResult.OK)
                {
                    if (load.Result != null)
                    {
                        _selectedProcedure = load.Result;

                        lblStatues.Text = "Loading dataSetExecution ...";
                        ExecAsyncResult result = await _selectedProcedure.ExecDataSetAsync(_currentAgent);

                        lblStatues.Text = "Done.";
                        rTxtresult.AppendColorText(result.ToString(), Color.Blue);

                        DataSet rsSet = result.Object as DataSet;

                        if (rsSet.Tables.Count > 0)
                        {
                            dataGridSet.DataSource = rsSet.Tables[0];
                        }
                        if (_selectedProcedure.HasOutputParam)
                        {
                            rTxtresult.AppendColorText("Output Params", Color.GreenYellow);
                            foreach (DataParam dataParam in _selectedProcedure.OutputParams.Values)
                            {
                                rTxtresult.AppendColorText(dataParam.Name + " = " + dataParam.Value, Color.Green);
                            }
                            rTxtresult.AppendColorText(new string('-', 30), Color.GreenYellow);
                        }
                    }
                }
            }
        }