Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void LoadData()
- {
- string connStr = "Data Source=WOJTEK-LAPTOP\\SQLEXPRESS;Initial Catalog = TestDB;Integrated Security = true;";
- using (var conn = new SqlConnection(connStr))
- {
- SqlCommand cmd = new SqlCommand("SELECT * FROM Videos",conn);
- conn.Open();
- DataTable dt = new DataTable();
- dt.Load(cmd.ExecuteReader());
- GridView1.DataSource = dt;
- GridView1.DataBind();
- conn.Close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement