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();
}
}
查看全文
相关阅读:
逗号表达式
Windows UninstallTool(右键卸载工具) 方便、快捷卸载电脑中的软件
获取 Python 模块的路径
Py2exe 打包后图标不显示[转载]
获取系统文件关联图标
py2exe 打包的exe,添加管理员权限
获取注册表某键下的所有子键
[已解决]Python脚本运行出错:libs\chardet\universaldetector.py:90: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode
Git使用
SQL Server获取指定行(如第二行)的数据
原文地址:https://www.cnblogs.com/LCX/p/372450.html
最新文章
一些优美的css设计
在 Asp.net 中使用 FCKEditor
Asp.Net MVC 自定义的MVC框架(非EF操作数据库)
Asp.net WebForm DropDownList 无限极联动(不需要写C#代码,不需要写JS,只是配置属性)
在 Asp.net 中使用 SVG生成家族树图形
SSIS 组件使用 (2)
要结果,不要借口
SSIS介绍以及应用场景
SSIS DataFlow组件使用
从今天开始写博客了
热门文章
SSIS 组件使用 (1)
收集ast文章
节点属性们做浅层检查
eval还原
前端js获取真实ip
解16进制
js hook dom
作用域内变量替换
运算结果
三元表达式转if
Copyright © 2011-2022 走看看