定阅RSS 繁体中文 设为首页 加入收藏
站内搜索
黑客文章 黑客下载
您所在的位置: 广西安全网络 >> 黑客文讯 >> 操作技巧 >> 正文
使用aspx操作mysql
作者:Gxfa 来源:本站原创 更新:2008-8-18 0:38:00  点击:

今天遇到一个iis只支持aspx的,禁用了asp,服务器装了mysql odbc驱动,想在那个iis上操作另一个服务器的mysql,可没现成的aspx操作mysql的程序,找了一下午,在msdn上找到个.net的sqldatasource类可以操作.
测试成功了,留在这里备忘一下.

ASPX代码
  1. <%@ Page Language="VB" %>   
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"  
  3. "http://www.w3.org/TR/xhtmlll/DTD/xhtmlll.dtd">   
  4. <script runat="server">   
  5. </script>   
  6. <html xmlns="http://www.w3.org/1999/xhtml" >   
  7. <head runat="server">   
  8. <title>asp.net to mysql</title>   
  9. </head>   
  10. <body>   
  11. asp.net connect mysql   
  12. <form id="forml" runat="server">   
  13. <div>   
  14. <asp:GridView ID="GridViewl" Runat="server"  
  15. DataSourceID="SqlDataSourcel">   
  16. </asp:GridView>   
  17. <asp:SqlDataSource ID="SqlDataSourcel" Runat="server"  
  18. ProviderName="System.Data.Odbc"  
  19. ConnectionString= "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=test;UID=test;PASSWORD=testtest;"  
  20. SelectCommand="Select * from dede_admin"  
  21. >   
  22. </asp:SqlDataSource>   
  23. </div>   
  24. </form>   
  25. </body>   
  26. </html  

转截请注明:来自 广西安全网络 Http://www.gxfa.com
在百度搜索:使用aspx操作mysql相关文章
在Google搜索:使用aspx操作mysql相关文章
在雅虎搜索:使用aspx操作mysql相关文章

数据载入中,请稍后……