-
Notifications
You must be signed in to change notification settings - Fork 0
/
HakkimizdaAdmin.aspx.cs
35 lines (31 loc) · 988 Bytes
/
HakkimizdaAdmin.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class HakkimizdaAdmin : System.Web.UI.Page
{
sqlsinif bgl = new sqlsinif();
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == false)
{
SqlCommand komut = new SqlCommand("select * from tbl_hakkimizda", bgl.baglanti());
SqlDataReader dr = komut.ExecuteReader();
while (dr.Read())
{
TextBox1.Text = dr[0].ToString();
}
bgl.baglanti().Close();
}
}
protected void Button3_Click(object sender, EventArgs e)
{
SqlCommand komut = new SqlCommand("update tbl_hakkimizda set metin=@p1", bgl.baglanti());
komut.Parameters.AddWithValue("@p1", TextBox1.Text);
komut.ExecuteNonQuery();
bgl.baglanti().Close();
}
}