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();
}
}
查看全文
相关阅读:
CF 848C
BZOJ 4025 二分图
支配树学习笔记
CF1120D Power Tree
Codeforces 360A(找性质)
Codeforces 142D(博弈)
Codeforces 142B(二分染色、搜索)
GYM 101981E(开关反转性质)
Codeforces 1150E(树、线段树)
Codeforces 1150D(字符串dp)
原文地址:https://www.cnblogs.com/yeagen/p/1331190.html
最新文章
华为实习日记——第十五天
华为实习日记——第十四天
华为实习日记——第十三天
华为实习日记——第十二天
华为实习日记——第十一天
华为实习日记——第十天
HDU 3957 Street Fighter(搜索、DLX、重复覆盖+精确覆盖)
ZOJ 3812 We Need Medicine(dp、背包、状态压缩、路径记录)
2-sat
NSOJ A fairy tale of the two(最小费用最大流、SPFA版本、ZKW版本)
热门文章
codeforces 460D Little Victor and Set(构造、枚举)
HDU 1823 Luck and Love(二维线段树)
HDU 4966 GGS-DDU(最小树形图)
HDU 4945 2048(dp)
HDU 4949 Light(插头dp、位运算)
HDU 4942 Game on S♂play(线段树、模拟、扩栈)
AGC035D
CF573E (平衡树)
P5562 [Celeste-B]Center of the Earth 题解
CF1132G
Copyright © 2011-2022 走看看