最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net数据连接代码
时间:2022-07-02 10:51:15 编辑:袖梨 来源:一聚教程网
数据连接代码,很简单的哦,如何用学了C#
' 声明C#
public DataSet dsCustomer;
protected void Page_Load(Object Src, EventArgs E )
{
' 在打开页面时连接
SQLConnection myConnection = new SQLConnection
("server=sql2.bitsonthewire.com;uid=joeuser;pwd=joeuser;database=northwind");
SQLDataSetCommand CustomersDSCommand = new SQLDataSetCommand("select * from customers", myConnection);
dsCustomer = new DataSet();
CustomersDSCommand.FillDataSet(dsCustomer,"Customers");
foreach (DataRow Customer in dsCustomer.Tables["Customers"].Rows)
{
Response.Write(Customer["CustomerId"].ToString() + "
" ); } }
相关文章
- 原神33-45级发展规划指南 12-01
- 英雄联盟手游狂潮裂变金克丝价格 12-01
- 无限暖暖2.0前瞻兑换码使用方法 12-01
- 洛克王国世界小绒茧怎么样 12-01
- 第五人格许愿码大全(2025) 第五人格许愿码最新可用汇总 12-01
- 铃兰之剑杰洛特有什么玩法技巧 12-01