服务器之家

服务器之家 > 正文

aspx中的mysql操作类sqldatasource使用示例分享

时间:2019-11-26 13:39     来源/作者:ASP.NET教程网

代码如下:


<%@ Page Language="VB" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
"http://www.w3.org/TR/xhtmlll/DTD/xhtmlll.dtd"> 
<script runat="server"> 
</script> 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
<title>asp.net to mysql</title> 
</head> 
<body> 
asp.net connect mysql 
<form id="forml" runat="server"> 
<div> 
<asp:GridView ID="GridViewl" Runat="server" 
DataSourceID="SqlDataSourcel"> 
</asp:GridView> 
<asp:SqlDataSource ID="SqlDataSourcel" Runat="server" 
ProviderName="System.Data.Odbc" 
ConnectionString= "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=test;UID=test;PASSWORD=testtest;" 
SelectCommand="Select * from dede_admin" 

</asp:SqlDataSource> 
</div> 
</form> 
</body> 
</html>

标签:

相关文章

热门资讯

玄元剑仙肉身有什么用 玄元剑仙肉身境界等级划分
玄元剑仙肉身有什么用 玄元剑仙肉身境界等级划分 2019-06-21
男生常说24816是什么意思?女生说13579是什么意思?
男生常说24816是什么意思?女生说13579是什么意思? 2019-09-17
配置IIS网站web服务器的安全策略配置解决方案
配置IIS网站web服务器的安全策略配置解决方案 2019-05-23
Nginx服务器究竟是怎么执行PHP项目
Nginx服务器究竟是怎么执行PHP项目 2019-05-24
运维必须知道的关于云服务器的十个问题
运维必须知道的关于云服务器的十个问题 2019-05-24
返回顶部