Imports System.Data.SqlClient Imports System.Configuration.ConfigurationManager Partial Class panel_sicil_islemleri Inherits System.Web.UI.Page Private Sub panel_sicil_islemleri_Init(sender As Object, e As EventArgs) Handles Me.Init Dim cookie As HttpCookie = Request.Cookies("kullanici") 'cookie silindi ise ana sayfaya döner If cookie Is Nothing Then Response.Redirect("default.aspx") End If '---------------------------------------------------------- If Page.IsPostBack = False Then 'sayfa ilk yüklendiğinde çalışıp bir daha bu koda girmemesi için Dim conn As New SqlConnection(ConnectionStrings("ConnectionString").ToString) Dim COMM As New SqlCommand Dim rdr As SqlDataReader conn.Open() COMM = conn.CreateCommand() COMM.CommandText = "SELECT SICILISLEMLERI FROM SABITLER" rdr = COMM.ExecuteReader If rdr.Read Then e_metin.Content = "" & rdr("SICILISLEMLERI").ToString & "" End If conn.Close() End If End Sub Private Sub kaydet_Click(sender As Object, e As EventArgs) Handles kaydet.Click On Error GoTo hata_kayit Dim conn As New SqlConnection(ConnectionStrings("ConnectionString").ToString) Dim COMM As New SqlCommand Dim sql1 As String mesaj1.Text = "" mesaj1.Visible = False mesaj2.Text = "" mesaj2.Visible = False conn.Open() COMM = conn.CreateCommand() sql1 = "UPDATE SABITLER SET SICILISLEMLERI = '" & e_metin.Content.Replace("'", Chr(180)) & "'" COMM.CommandText = sql1 COMM.ExecuteNonQuery() conn.Close() mesaj2.Text = "Bilgiler güncellendi." mesaj2.Visible = "true" Exit Sub hata_kayit: mesaj1.Text = "Kayıt işlemi sırasında bir hata oluştu, bilgi kaydedilemedi. Lütfen girişinizi kontrol ediniz!!!" mesaj1.Visible = "true" End Sub End Class