DATALIST绑定数据是不是这个样子??
SqlConnection cn = new SqlConnection("Data Source=localhost;Initial Catalog=PubNews;User Id=sa;Password=;");
cn.Open();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("select * from NewsTable", cn);
DataSet ds = new DataSet();
da.Fill(ds, "News");
this.DataList1.DataSource = ds.Tables["News"];
this.DataList1.DataBind();
cn.Close();
谢谢指教!