博客
关于我
gridview删除 asp.net
阅读量:138 次
发布时间:2019-02-27

本文共 925 字,大约阅读时间需要 3 分钟。

protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e){// ???????// ??????????int rowIndex = e.RowIndex;// ????????GridViewRow row = GridView1.Rows[rowIndex];// ????????????string wjzh = row.Cells[1].Text;

// ??????// ????????????SQL????using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString())){    try    {        // ??????        SqlCommand sqlCommand = new SqlCommand("DELETE FROM QC_CSR WHERE wjzh = @wjzh", connection);        sqlCommand.Parameters.AddWithValue("@wjzh", wjzh);                // ????        connection.Open();        sqlCommand.ExecuteNonQuery();        connection.Close();    }    catch (Exception ex)    {        // ????        if (!IsDebugEnabled)        {            throw new Exception("???????" + ex.Message);        }        else        {            LogHelper.Log("????????" + ex.Message);        }    }}

}

转载地址:http://vofd.baihongyu.com/

你可能感兴趣的文章
PHP5.4 + IIS + Win2008 R2 配置
查看>>
PHP5.4 pfsocketopen函数判断sock是否存活的bug(由memcached引起)
查看>>
Redis从入门到精通
查看>>
PHP5.6.x编译报错:Don't know how to define struct flock on this system, set --enable-opcache=no
查看>>
php5ts.dll 下载_php5ts.dll下载
查看>>
php7
查看>>
PHP7 新特性
查看>>
PHP7+MySQL5.7+Nginx1.9. on Ubuntu 14.0
查看>>
php7.1.6 + redis
查看>>
php7中使用php_memcache扩展
查看>>
PHP7中十个需要避免的坑
查看>>
php7和PHP5对比的新特性和性能优化
查看>>
PHP7安装pdo_mysql扩展
查看>>
PHP7实战开发简单CMS内容管理系统(7) 后台登录架构 用户登录校验
查看>>
php7,从phpExcel升级到PhpSpreadsheet
查看>>
PHP8.1 + ThinkPHP实战指南:高效构建现代化网站的六大技巧
查看>>
PHP8中match新语句的操作方法
查看>>
PHP:第一章——PHP中常量和预定义常量
查看>>
PHP:第一章——PHP中的位运算
查看>>
phpcms
查看>>