直播中
<html>
< script language="C#" runat="server">
'聲明C#
public DataSet dsCustomer;
protected void Page_Load(Object Src, EventArgs E )
{
'當(dāng)打開頁(yè)面時(shí)聯(lián)結(jié)數(shù)據(jù)庫(kù)
SQLConnection myConnection = new SQLConnection
("server=sql2.bitsonthewire.com;uid=joeuser;pwd=joeuser;database=northwind");
SQLDataSetCommand CustomersDSCommand = new SQLDataSetCommand("select * from customers", myConnection);
dsCustomer = new DataSet();
CustomersDSCommand.FillDataSet(dsCustomer,"Customers");
foreach (DataRow Customer in dsCustomer.Tables["Customers"].Rows)
{
Response.Write(Customer["CustomerId"].ToString() + "<br> " ); } }
</script>
<body>
</body>
</html>
</td>
</tr>
</table>
</body>