Пример #1
0
        public static void ExecuteGetButtonBrowse(BindingDataEventArgs e, string storedProcedureName)
        {
            using (var conn = new SqlConnection(BaseAppConfig.ConnectionString))
            {
                var cmd = new SqlCommand(storedProcedureName, conn)
                {
                    CommandType = CommandType.StoredProcedure
                };
                if (BaseAppConfig.CommandTimeout != null)
                {
                    cmd.CommandTimeout = BaseAppConfig.CommandTimeout.Value;
                }

                cmd.Parameters.Add("@objectName", SqlDbType.NVarChar).Value        = e.DatabaseObjectName;
                cmd.Parameters.Add("@paramInt", SqlDbType.Int).Value               = e.ParamInt;
                cmd.Parameters.Add("@paramString", SqlDbType.NVarChar).Value       = e.ParamString;
                cmd.Parameters.Add("@paramGuid", SqlDbType.UniqueIdentifier).Value = e.ParamGuid;
                cmd.Parameters.Add("@paramDateTime", SqlDbType.DateTime).Value     = e.ParamDateTime;


                conn.Open();
                var obj = cmd.ExecuteScalar();
                if (obj != null)
                {
                    e.Text = obj.ToString();
                }
            }
        }
Пример #2
0
 public static void ExecuteGetButtonBrowse(BindingDataEventArgs e)
 {
     ExecuteGetButtonBrowse(e, "dbo.SP_GetButtonBrowse");
 }