我有这个 ASPX 代码:
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.OleDb;
public partial class Default4 : System.Web.UI.Page
{int i;
public string strAdmin;
public string strPass;
public string strLname;
public string strEmail;
public string strFname;
public string str;
protected void Page_Load(object sender, EventArgs e)
{
string dbPath = Server.MapPath(@"App_Data") + "/my_site.mdb";
string connectionString = @"Data Source='" + dbPath + "';Provider='Microsoft.Jet.OLEDB.4.0';";
OleDbConnection con = new OleDbConnection(connectionString);
con.Open();
string QueryString = "SELECT * FROM tbl_users";
OleDbCommand cmd = new OleDbCommand(QueryString, con);
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "tbl");
con.Close();
strt =
for (i = 0; i < ds.Tables[0].Rows.Count; i++)
{
strFname = ds.Tables[0].Rows[i]["first_name"].ToString();
strLname = ds.Tables[0].Rows[i]["last_name"].ToString();
strEmail = ds.Tables[0].Rows[i]["user_email"].ToString();
strPass = ds.Tables[0].Rows[i]["user_password"].ToString();
strAdmin = ds.Tables[0].Rows[i]["is_admin"].ToString();
str += String.Format("{0} {1} {2} {3} {4}", strFname, strLname, strEmail, strPass, strAdmin);
}
}
}
如何在表格中显示此信息以便它更有用?
(我应该在这里添加哪些 html 标签?在哪里?)我希望得到帮助。