aspx中的mysql操作类sqldatasource使用示例分享
程序员文章站
2024-02-27 21:50:51
复制代码 代码如下:<%@ page language="vb" %>
<%@ 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>
复制代码 代码如下:
<%@ 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>
下一篇: asp.net弹出窗口 返回值