protected void Page_Load(object sender, EventArgs e) { haberID = Convert.ToInt32(Request.QueryString["haberID"]); if (Page.IsPostBack == false) { ////SqlConnection baglanti = new SqlConnection(@"Data Source=HALE-BILGISAYAR\SQLEXPRESS; initial Catalog=atak_testcase; integrated security=true; uid=HALE-BILGISAYAR\SQLEXPRESS; pwd=NULL"); ////// SqlConnection baglanti = new SqlConnection("Data Source=.; Initial Catalog=siteDB; Integrated Security=true"); ////baglanti.Open(); ////SqlConnection.ClearPool(baglanti); ////SqlConnection.ClearAllPools(); ////SqlCommand cmdkguncelle = new SqlCommand("select * from haber where haberID='" + haberID + "'", baglanti); ////SqlDataReader drkguncelle = cmdkguncelle.ExecuteReader(); //DataRow row = dt.Rows[0]; //txt_haberbaslik.Text = row["haberBaslik"].ToString(); //txt_habericerik.Text = row["haberIcerik"].ToString(); //txt_habertag.Text = row["haberTag"].ToString(); using (atak_testcaseEntities1 db = new atak_testcaseEntities1()) { Haber h = et1.Haber .First(i => i.haberID == haberID);//Id = 1 olan kaydı bul txt_haberbaslik.Text = h.haberBaslik; txt_habericerik.Text = h.haberIcerik; txt_habertag.Text = h.haberTag; } } }
protected void Page_Load(object sender, EventArgs e) { fotografID = Convert.ToInt32(Request.QueryString["fotografID"]); if (Page.IsPostBack == false) { using (atak_testcaseEntities1 db = new atak_testcaseEntities1()) { Fotograf f = et1.Fotograf .First(i => i.fotografID == fotografID);//Id = fotografID olan kaydı bul txt_fotoaciklama.Text = f.fotografAciklama; } } }
protected void Page_Load(object sender, EventArgs e) { videoID = Convert.ToInt32(Request.QueryString["videoID"]); if (Page.IsPostBack == false) { using (atak_testcaseEntities1 db = new atak_testcaseEntities1()) { Video v = et1.Video .First(i => i.videoID == videoID);//Id = videoID olan kaydı bul txt_videoAciklama.Text = v.videoAciklama; } } }
protected void Page_Load(object sender, EventArgs e) { string kullaniciadi = Convert.ToString(Session["yoneticiKullaniciAdi"]); if (Session["yoneticiKullaniciAdi"] == null) { Response.Redirect("giris.aspx"); } if (Page.IsPostBack == false) { using (atak_testcaseEntities1 db = new atak_testcaseEntities1()) { Yonetici y = et1.Yonetici .First(i => i.yoneticiKullaniciAd == kullaniciadi);// kullanici adi session'dan geleni al txt_adsoyad.Text = y.yoneticiAdSoyad; txt_email.Text = y.yoneticiEmail; txt_kullaniciadi.Text = y.yoneticiKullaniciAd; } } }