最新下载
热门教程
- 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() + "
" ); } }
相关文章
- 斗罗大陆诛邪传说建造如何玩 10-14
- 洛克王国世界弗达怎么打 10-14
- 怪物猎人旅人大剑强度如何 10-14
- 荒原曙光吞噬者怎么捕捉 10-14
- 崩坏因缘精灵大海龟有什么玩法技巧 10-14
- 斗罗大陆诛邪传说炼魂如何玩 10-14