|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
asp,你就只能等着微软给你解决,它不乐意你就只好悲催。而且asp跑在windows服务器上,windows服务器跟linux比起来简直弱爆了!asp+|datagrid|select|程序|数据|实行------------------c#源程序----------------
<%@ImportNamespace="System.Data"%>
<%@ImportNamespace="System.Data.SQL"%>
<html>
<scriptlanguage="C#"runat="server">
protectedvoidPage_Load(ObjectSrc,EventArgsE)
{
SQLConnectionmyConnection=newSQLConnection("server=localhost;uid=sa;pwd=;database=pubs");
SQLDataSetCommandmyCommand=newSQLDataSetCommand("select*fromAuthors",myConnection);
DataSetds=newDataSet();
myCommand.FillDataSet(ds,"Authors");
MyDataGrid.DataSource=ds.Tables["Authors"].DefaultView;
MyDataGrid.DataBind();
}
</script>
<body>
<h3><fontface="Verdana">SimpleSelecttoaDataGridControl</font></h3>
<ASP:DataGridid="MyDataGrid"runat="server"
Width="700"
BackColor="#ccccff"
BorderColor="black"
ShowFooter="false"
CellPadding=3
CellSpacing="0"
Font-Name="Verdana"
Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd"
MaintainState="false"
/>
</body>
</html>
------------#VB源程序---------------
<%@ImportNamespace="System.Data"%>
<%@ImportNamespace="System.Data.SQL"%>
<html>
<scriptlanguage="VB"runat="server">
SubPage_Load(SrcAsObject,EAsEventArgs)
DimDSAsDataSet
DimMyConnectionAsSQLConnection
DimMyCommandAsSQLDataSetCommand
MyConnection=NewSQLConnection("server=localhost;uid=sa;pwd=;database=pubs")
MyCommand=NewSQLDataSetCommand("select*fromAuthors",MyConnection)
DS=newDataSet()
MyCommand.FillDataSet(ds,"Authors")
MyDataGrid.DataSource=ds.Tables("Authors").DefaultView
MyDataGrid.DataBind()
EndSub
</script>
<body>
<h3><fontface="Verdana">SimpleSelecttoaDataGridControl</font></h3>
<ASP:DataGridid="MyDataGrid"runat="server"
Width="700"
BackColor="#ccccff"
BorderColor="black"
ShowFooter="false"
CellPadding=3
CellSpacing="0"
Font-Name="Verdana"
Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd"
MaintainState="false"
/>
</body>
</html>
</p>由于ASP提供的是一对多的服务,所以用户的一些特殊需求很难得到满足。 |
|