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();
}
}
查看全文
相关阅读:
[Ramda] Getter and Setter in Ramda & lens
[Angular2 Router] Index router
[TypeScript] Using Interfaces to Describe Types in TypeScript
[RxJS] ReplaySubject with buffer
[Ramda] Declaratively Map Predicates to Object Properties Using Ramda where
[Ramda] Pluck & Props: Get the prop(s) from object array
[Ramda] Complement: Logic opposite function
[TypeScript] Distinguishing between types of Strings in TypeScript
[NodeJS] Use Now alias for custom sub-domains
[CSS3] Create a fixed-fluid-fixed layout using CSS calc()
原文地址:https://www.cnblogs.com/LCX/p/372450.html
最新文章
CF 338E Optimize! (线段树)
Linux下搭建Hadoop集群
poj 1155 TELE (树形背包dp)
求 n! (大数问题)----------HDOJ1042
在Myeclipse中安装java Decompiler
hdu 3917 (最大权闭合图)
JDBC连接SQL server与ADO.NET连接Sql Server对比
BIRT使用2:安装、一般使用顺序
Android Camera系列开发 (二)通过Intent录制视频
Learning Lua Programming (4) Cocos2d-x中Lua编程(一)
热门文章
静态代理的代理模式
介绍MFC参与设计模式框架(一个)
HDU 4279 Number(2012天津网络游戏---数论分析题)
Cocos2d-x3.1颗粒使用
vi学习(1)
Android学习路径(22)应用Fragment建立动态UI——构建一个灵活UI
vim for windows download and installation
从入门机器学习的零单排:OctaveMatlab经常使用绘图知识
企业网络推广方法,通常用于(总结)
Android
Copyright © 2011-2022 走看看