zoukankan
html css js c++ java
我的第二个C#代码
我写的第二个C#
protected
void
Page_Load(
object
sender, EventArgs e)
{
{
string
strConnection
=
System.Configuration.ConfigurationManager.AppSettings[
"
connString
"
];
//
string strConnection = System.Configuration.ConfigurationSettings.AppSettings["connString"];
//
DataSet
SqlConnection Conn;
SqlDataAdapter Adqt;
DataSet Ds;
string
strSql
=
"
select * from table_1
"
;
Conn
=
new
SqlConnection(strConnection);
Conn.Open();
Ds
=
new
DataSet();
Adqt
=
new
SqlDataAdapter(strSql, Conn);
Adqt.Fill(Ds,
"
table_1
"
);
GridView1.DataSource
=
Ds.Tables[
"
table_1
"
].DefaultView;
GridView1.DataBind();
Ds.Clear();
Conn.Close();
//
DataReader
SqlCommand Cmd;
SqlDataReader Rd;
Conn
=
new
SqlConnection(strConnection);
Conn.Open();
Cmd
=
new
SqlCommand(strSql, Conn);
Rd
=
Cmd.ExecuteReader();
int
i
=
0
;
while
(Rd.Read())
{
i
++
;
//
i = i + 1
Response.Write(i);
Response.Write(
"
"
+
Rd[
"
aaa
"
].ToString);
//
为什么不能这样 Response.Write( i.ToString + Rd["aaa"].ToString);
}
Rd.Close();
Conn.Close();
}
}
查看全文
相关阅读:
冲刺第一天(补发)
进度条05
npm start问题
Spring Boot 默认配置无法访问静态资源
Spring Boot 返回Html界面
阿里云配置tomcat后不能访问问题
Spring Boot Web开发中Thymeleaf模板引擎的使用
tomcat官网改版后下载方式
Ubuntu16.04进入无限登录状态的解决办法
Ubuntu16.04安装MySql5.7
原文地址:https://www.cnblogs.com/LCX/p/372450.html
最新文章
练习题:随机生成20个学生的成绩; 判断这20个学生成绩的等级;
使用python函数持续监控电脑cpu使用率、内存、c盘使用率等
2017.11.14
2017.11.13
2017.11.12
2017.11.10
2017.11.8
趣味案例理解朴素贝叶斯
2017.11.6
2017.11.4
热门文章
2017.11.3
图解机器学习
评估输入法(搜狗)
进度条11
典型用户和用户场景
进度条10
进度条09
进度条08
进度条07
冲刺第二天
Copyright © 2011-2022 走看看