persian_l
چهارشنبه 30 مرداد 1387, 17:18 عصر
من برای اینکه دیتا لیست رو به دیتابیس وصل کنم این کد رو نوشتم ولی دیتا لیست هیچ چیزی به من نشون نمی ده مشکل من کجاست؟
string connectionstring = "Data Source=.;Initial Catalog=a;Integrated Security=True";
string selectSQL;
SqlConnection con = new SqlConnection(connectionstring);
selectSQL = "SELECT * FROM table ";
SqlCommand cmd = new SqlCommand(selectSQL, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "table");
DataList1.DataSource = ds;
DataList1.DataBind();
string connectionstring = "Data Source=.;Initial Catalog=a;Integrated Security=True";
string selectSQL;
SqlConnection con = new SqlConnection(connectionstring);
selectSQL = "SELECT * FROM table ";
SqlCommand cmd = new SqlCommand(selectSQL, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "table");
DataList1.DataSource = ds;
DataList1.DataBind();