.cs sayfası
SqlConnection baglanti = new SqlConnection("Data Source=xxx-PC;Initial Catalog=xxx;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False");
string sorgu = "select * from label_resim";
SqlCommand cmd = new SqlCommand(sorgu, baglanti);
baglanti.Open();
SqlDataReader dr = cmd.ExecuteReader();
lstResimler.DataSource = dr;
lstResimler.DataBind();
baglanti.Close();
.aspx sayfası