我写这个代码只能获取当前列的名字
我想获得列里面的内容
应该怎么修改
public partial class _Default : System.Web.UI.Page
{
string chaxun = "select * from biaoge";
string str = string.Empty;
string con = "Password=.net; Pooling=true;min pool size=1;max pool size=10000;Persist Security Info=True;User ID=sa;Initial Catalog=zuoye;Data Source=201.1.1.90;";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
SqlConnection Conn = new SqlConnection(con);
SqlDataAdapter myDA = new SqlDataAdapter(chaxun, Conn);
DataTable dt = new DataTable();
str += "<select>";
Conn.Open();
try
{
DataSet myds = new DataSet();
myDA.Fill(myds);
dt = myds.Tables[0];
for (int w = 0; w < dt.Columns.Count; w++)
str += "<option value='" + dt.Columns[w].ColumnName + "'>'" + dt.Columns[w].ColumnName + "'</option>";
}
finally
{
Conn.Close();
str += "<select>";
}
Response.Write("'" + str + "'");