private void CreateProcedure()
        {
            string str = richTxtStoredDef.Text;

            using (SymfowareConnection conn = DbUtil.GetConnection())
            {
                try
                {
                    SymfowareCommand command = new SymfowareCommand(str, conn);
                    command.ExecuteNonQuery();
                    string text1 = "result:  " + command.ToString();
                    MessageBox.Show("できた。");
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message);
                }
            }
        }
Beispiel #2
0
        public static SymfowareCommand CallProcedure(SymfowareCommand command, List <ProcedureParameter> paramInfos)
        {
            foreach (ProcedureParameter paramInfo in paramInfos)
            {
                SymfowareParameter param = new SymfowareParameter();
                param.ParameterName   = paramInfo.colName;
                param.SymfowareDbType = paramInfo.getDataType();
                param.Direction       = paramInfo.getDirect();

                if (param.Direction == ParameterDirection.Input)
                {
                    param.Value = DbUtil.GetUserInput(paramInfo.colName);
                }
                else if (param.Direction == ParameterDirection.Output)
                {
                    param.Size = paramInfo.max;
                }
                command.Parameters.Add(param);
            }
            command.ExecuteNonQuery();

            return(command);
        }