标题:这些代码又是什么意思 ?
只看楼主
leesunmoo
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2006-3-19
 问题点数:0 回复次数:4 
这些代码又是什么意思 ?

Conn.Open();
SQL = "Select * From 成绩单 ";
SQL = SQL + "Where 学号=" + "'" + No + "'" + " And 姓名='" + Name + "'";
Comm = new OleDbCommand(SQL,Conn);
OleDbDataReader drScore = Comm.ExecuteReader();
if(drScore.Read()){
if (drScore[Lesson].ToString() == "-1") {
SQL = "update 成绩单 set " + Lesson + " = " + Score.ToString()
+ " where 学号=" + "'" + No + "'"
+ " And 姓名='" + Name + "'";
Conn.Close();
Conn.Open();
Comm = new OleDbCommand(SQL,Conn);
Comm.ExecuteNonQuery();
}
else {
Response.Write ("<script>{alert('你已经考过了')}</script>");
}

<%//重新读取成绩
Conn.Close();
Conn.Open();
SQL = "Select * From 成绩单 ";
SQL = SQL + "Where 学号=" + "'" + No + "'" + " And 姓名='" + Name + "'";
Comm = new OleDbCommand(SQL,Conn);
drScore = Comm.ExecuteReader();
if(drScore.Read()){
%>



string TestType = "";
while (dr.Read()){
Response.Write("<B>" + dr["题号"].ToString() + "."
+ Server.HtmlEncode(dr["题目"].ToString())
+ dr["类型"].ToString() + ":" + dr["分数"].ToString() + "分)</B>");
Response.Write("<div>");
for (int i=1; i<5; i++) {
if (dr["类型"].ToString() == "单选") {
TestType = "Radio";
}
else {
TestType = "CheckBox";
}
Response.Write("<INPUT Type=" + TestType
+ " Name=No" + dr["题号"].ToString()
+ " Value=" + i +">"
+ Server.HtmlEncode(dr["选项" + i].ToString()) + "<BR>");
}
Response.Write("</div>");

搜索更多相关主题的帖子: 代码 
2006-03-20 14:13
唐伯猫
Rank: 8Rank: 8
等 级:贵宾
威 望:45
帖 子:5323
专家分:58
注 册:2005-8-9
得分:0 
asp中读取数据库的代码.

<iframe name="alimamaifrm" frameborder="0" marginheight="0" marginwidth="0" border="0" scrolling="no" width="300" height="170" src="/go/app/tbk_app/chongzhi_300_170.php?pid=mm_28854300_2441872_11377541&page=chongzhi_300_170.php&size_w=300&size_h=170&stru_phone=1&stru_game=1&stru_travel=1" ></iframe>
2006-03-21 09:06
月夜枫华
Rank: 4
等 级:贵宾
威 望:12
帖 子:437
专家分:42
注 册:2006-1-2
得分:0 

是ASP.net的代码


2006-03-21 11:52
water123456
Rank: 5Rank: 5
等 级:贵宾
威 望:15
帖 子:3208
专家分:5
注 册:2006-2-21
得分:0 
那是呀,这也同样,和asp一样的.看看就明白了,你具体的哪一句不明白了.

让我们风风火火的过一生,别平平淡淡过一年。
2006-03-21 12:24
leesunmoo
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2006-3-19
得分:0 
OleDbDataReader drScore = Comm.ExecuteReader();

Response.Write("<INPUT Type=" + TestType
+ " Name=No" + dr["题号"].ToString()
+ " Value=" + i +">"
+ Server.HtmlEncode(dr["选项" + i].ToString()) + "<BR>");


这句

2006-03-21 16:07



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-51584-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.184767 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved