【心得】create a data table in webMatrix is very easy!

本文介绍使用WebMatrix工具轻松读取数据库的方法。通过简单的设置,即可实现数据的自动读取,无需编写复杂的连接字符串或卸载子程序。文中详细展示了自动生成的数据读取代码示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我是刚 downloaded这个工具,现在正在testing……,发现他的确很好用,比如现在你要读取数据

你首先在data窗口设置好你需要读取的数据库,然后你把目标表直接拖到页面中,然后你什么也不做,这个时候,直接运行该页面,webmatrix会自动启动web matrix server,你发现数据已经读出来了,你根本不需要设置连接字符,也不要在unload里写sub,就可以直接读出数据来了,是不是很easy…………

浏览code,发现他已经自动完成了数据度曲的代码,代码如下:
None.gif < form runat = " server " >
None.gif        
< wmx:AccessDataSourceControl id = " AccessDataSourceControl1 "  runat = " server "  ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=F:\Test\webmatrix\Dqsm.mdb "  SelectCommand = " SELECT * FROM [AllStore] " ></ wmx:AccessDataSourceControl >
None.gif        
< wmx:MxDataGrid id = " MxDataGrid1 "  runat = " server "  AllowPaging = " True "  CellPadding = " 3 "  BorderStyle = " None "  DataSourceControlID = " AccessDataSourceControl1 "  AllowSorting = " True "  BorderWidth = " 1px "  BackColor = " White "  DataMember = " AllStore "  BorderColor = " #CCCCCC "  DataKeyField = " StoreID " >
None.gif            
< FooterStyle forecolor = " #000066 "  backcolor = " White " ></ FooterStyle >
None.gif            
< SelectedItemStyle forecolor = " White "  font - bold = " True "  backcolor = " #669999 " ></ SelectedItemStyle >
None.gif            
< PagerStyle backcolor = " White "  mode = " NumericPages "  horizontalalign = " Center "  forecolor = " #000066 " ></ PagerStyle >
None.gif            
< HeaderStyle forecolor = " White "  font - bold = " True "  backcolor = " #006699 " ></ HeaderStyle >
None.gif            
< ItemStyle forecolor = " #000066 " ></ ItemStyle >
None.gif        
</ wmx:MxDataGrid >
None.gif        
<!--  Insert content here  -->
None.gif    
</ form >
None.gif


运行的结果如下:

data.gif

好了,先到这里,因为我也正在学习中

如果想要得到更多的学习资源,请到 这里

转载于:https://www.cnblogs.com/yang_sy/archive/2004/12/03/72467.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值