的體內我寫了一個數據庫連接的腳本功能 -包含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