⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 excuteprocparm.aspx.cs

📁 比较可以的源码
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class ExcuteProcParm : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //初始化参数
        SqlParameter myparm = new SqlParameter();
        //获取参数的名字
        myparm.ParameterName = txtparm.Text;
        //设置变量的类型和长度
        myparm.SqlDbType = SqlDbType.NVarChar;
        myparm.Size = 20;
        //获取参数的值
        myparm.Value = txtvalue.Text;
        //获取要执行的存储过程名
        string sqlexec = txtsqlexec.Text;
        SqlCommand cmd = new SqlCommand();
        //定义对象资源保存的范围,一旦using范围结束,将释放对方所占的资源
        using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
        {
            //打开连接
            conn.Open();
            //调用执行方法
            SqlHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, sqlexec, myparm);
            Response.Write("<font color=red>操作完成!请检查数据库!</font>");
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -