最新下载
热门教程
- 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() + "
" ); } }
相关文章
- iwara网页版入口-iwara网页版访问地址 07-19
- 算力定价权的转移——从你有多少张卡到Token成本多少 07-19
- 在WAIC:第一次觉得AI不必那么聪明 07-19
- 天谱乐大模型发布4.7:让AI音乐更懂“二次创作”|独家 07-19
- 商汤发布旗舰级SenseNova U1 Pro:多模态智能体实现长程任务闭环 07-19
- 中科闻歌发布首个AI决策全家桶:企业决策卷入10分钟时代 07-19