protected void Page_Load(object sender, EventArgs e) { string connection = "Data Source=ip;Initial Catalog=commonlogin;User ID=sa;Password=; "; SqlConnection conn = new SqlConnection(connection); conn.Open(); SqlDataAdapter ad = new SqlDataAdapter("SELECT * FROM tbl_SqlImage", conn); //SqlCommand cmd = new SqlCommand("SELECT * FROM tbl_SqlImage", conn); //SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); ad.Fill(ds); if (ds.Tables[0].Rows.Count != 0) { GridView1.DataSource = ds; GridView1.DataBind(); }
GridView1.DataSource = ds;
GridView1.DataSource = ds.Tables[0];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)