的体内我写了一个数据库连接的脚本功能 -包含HTML
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head2" runat="server">
<title>SQL Authentication</title>
<h1>title</h1>
</head>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyDbConn"].ToString()))
{
SqlCommand cmd = new SqlCommand("SELECT * FROM dbo.table", cn);
...etc...
...etc...
</script>
<html>
如何使用网页的HTML中这个功能,因为它是目前从数据库中把所有的结果,它正在填充整个页面,以及我对html所做的任何修改数据库结果表下出现<h1>Title</h1>
?
从这里开始 - http://www.asp.net/web-forms/overview/aspnet-data-controls – jrummell 2012-02-29 15:27:33