SqlConnection conn = new SqlConnection("server=.;database=RestOL;uid=sa;pwd=123456;");
conn.Open();
SqlCommand sql = new SqlCommand("select * from Dishes ", conn);
//有6列
SqlDataAdapter sda = new SqlDataAdapter(sql);
DataSet ds = new DataSet();
sda.Fill(ds);
int n = ds.Tables[0].Rows.Count;
for (int i = 0; i < n; i++)
{
this.Image1.ImageUrl = ds.Tables[0].Rows[i][0].ToString();
......................
阅读全部 | 2017年4月5日 22:17