我有一张包含姓名、姓氏和电子邮件的表格。我想从表中检索它们,所以我写:
if (LoginAs.SelectedValue == "Administrator")
{
string result;
string query = "Select * from AdminTable where ID='"+ idBox.Text +"'";
cmd1 = new SqlCommand(query, con);
result = Convert.ToString(cmd1.ExecuteScalar());
Response.Redirect("Admin.aspx");
//Admin user = new Admin(idBox.Text, "Active", mail, firstName, LastName, passwordBox.Text);
}
问题是,即使我写了“Select *”,它也只返回指定行的名称字段。这里有什么问题?