zoukankan
html css js c++ java
随手记录修改某条记录时,不使用数据库控件而用datareader
可能是很简单的,记录一下,以后自己好用
protected
void
Page_Load(
object
sender, EventArgs e)
{
getSession.JuageSession();
//
自定义的一个检查登录状态的类
if
(
!
Page.IsPostBack)
{
int
id
=
Convert.ToInt32(Request[
"
id
"
]);
this
.ViewState[
"
id
"
]
=
id;
string
sqlexe
=
"
select * from product where id =
"
+
id;
SQLDbDataReader dr
=
userSql.db.ExecuteDataReader(sqlexe);
if
(dr.Read())
{
this
.title.Text
=
dr[
"
title
"
].ToString();
this
.content.Value
=
dr[
"
content
"
].ToString();
DropBind(Convert.ToInt32(dr[
"
parent
"
]));
this
.ViewState[
"
smallimg
"
]
=
dr[
"
smallimg
"
];
this
.ViewState[
"
bigimg
"
]
=
dr[
"
bigimg
"
];
this
.ViewState[
"
id
"
]
=
dr[
"
id
"
];
this
.audit.Checked
=
Convert.ToBoolean(dr[
"
audit
"
]);
this
.post.Text
=
dr[
"
post
"
].ToString();
this
.comment.Text
=
dr[
"
comment
"
].ToString();
}
dr.Close();
dr.Dispose();
dr
=
null
;
PageControlInt();
}
}
查看全文
相关阅读:
智能问答系统构思(持续更新)
软件测试
Android实现智能问答机器人(四) -----连接我们的系统
软件架构模式---分层架构V2.0
软件架构模式---分层架构
PHP文件上传示例
PHP文件上传常见类型checklist
PHP操作Mysql数据库查询数据实例
PHP操作Mysql数据库更新数据实例
PHP 操作Mysql数据库删除数据示例
原文地址:https://www.cnblogs.com/yeagen/p/1331190.html
最新文章
IOS设计模式浅析之桥接模式(Bridge)
IOS设计模式浅析之适配器模式(Adapter)
创建型设计模式小结
IOS设计模式浅析之抽象工厂模式(Abstract Factory)
跨浏览器开发工作小结
我们会不会与操作系统谈一场奋不顾身的爱情──《云端情人》有感
匠以利器为助---移动设计师应该知道的8款利器
前端工程师,确定你的目标吧!无能的人才管他叫命运
6个方法,用博客建立你的个人“品牌”
对你同样重要的非技术贴,一封有效的求职信的具体写法
热门文章
对你同样重要的非技术贴,告诉你写求职信的9个技巧
解读刘强东关于人才的两个标准和5个层次
iOS 8最酷的三个技巧
决不随波逐流,记住15件事让你达成目标
对你同样重要的非技术贴,10件事证明你跟错了人
异常处理:Mybatis报错:There is no getter for property named 'xxxx' in 'class xxx'
异常处理:el表达式数据类型转换异常 Cannot convert B36 of type class java.lang.String to class java.lang.Long
Caused by: org.xml.sax.SAXParseException; lineNumber: 18; columnNumber: 70; cvc-complex-type.2.4.a: 发现了以元素 'context:component-scan' 开头的无效内容。应以 '{"http://www.springframework.org/schema/context":include
网页模板引入json或js报错,解决方法
第一周计划(2018.12.25-2019.1.1)
Copyright © 2011-2022 走看看