Kod Akademi

Kod Akademi

Share

C#, ASP.NET, ASP.NET MVC, .Net Mobil Uygulamalar, Java, Oracle, MSSQL 2008, Grafik Tasarım, Web Tasarım derslerin eğitimine başladık.

24/09/2026
26/08/2026

24/08/2026

#

Photos from Kod Akademi's post 19/08/2026

Photos from Kod Akademi's post 08/07/2026

Snh firmasında kkd eğitimi İlkyardım ve alt yapıda alınması gereken güvenlik eğitimi

30/05/2012

ASP.NET Silme

protected void btnsil_Click(object sender, EventArgs e)
{
SqlConnection bag = new SqlConnection();
bag.ConnectionString = "Data Source=(local);Initial Catalog=candeneme;Integrated Security=True";
SqlCommand sil = new SqlCommand();
sil.CommandText = "delete from carikart where Ckod=";
sil.Parameters.AddWithValue("", TextBox4.Text);
sil.Connection = bag;
bag.Open();
int sonuc = sil.ExecuteNonQuery();
if (sonuc > 0)
{
Label1.Text = "Kayıt Silindi...";
TextBox4.Text = "";
}
else
{
Label1.Text = "Hata oluştu...";
}
bag.Close();
sil.Dispose();
Response.Redirect("default.aspx");
}
}

30/05/2012

ASP.NET Kayıt Arama ve TextBox lara yazdırma
protected void btnara_Click(object sender, EventArgs e)
{
SqlConnection bag = new SqlConnection();//Bağlantı nesnesi tanımı
bag.ConnectionString = "Data Source=(local);Initial Catalog=candeneme;Integrated Security=True";//Bağlantı tanımlandı
SqlCommand sorgu = new SqlCommand();//Seçmek için nesne tanımlandı
sorgu.CommandText = "select Ckod,ad,soyad from carikart where Ckod=";//Seçim iilemi sorgusu oluşturuldu
sorgu.Parameters.AddWithValue("", TextBox4.Text);//Seçim için parametre gönderildi.
sorgu.Connection = bag;//Bağlantı nesnesi seçildi
bag.Open();//Bağlantı açıldı
SqlDataReader oku = sorgu.ExecuteReader();//Tüm bilgiler oku değişkenine aktarıldı

if (oku.HasRows)//Şayet kayıt varsa
{
oku.Read();//Oku ve bilgileri aşağıdaki kutulara yaz
TextBox1.Text = oku["Ckod"].ToString();
TextBox2.Text = oku["ad"].ToString();
TextBox3.Text = oku["soyad"].ToString();

}
else
{
Label1.Text = "Kayıt Bulunamadı...";
}
bag.Close();
sorgu.Dispose();
}

28/05/2012

"PAYLAŞMAK GÜZELDİR. PAYLAŞMAK KENDİNE OLAN GÜVENDİR. BİLGİ PAYLAŞIMI ÜLKEMİZİN GELECEĞİDİR. ÜLKEMİZİN GELECEĞİ İÇİN PAYLAŞALIM."

Checkbox

Örnek
Dropdownlist ilk seçenek seçildiğinde "CheckBox" lart seçli hala gelecek,
ikinci seçenek seçlidiğinde ise "CheckBox" lardan biri seçili diğeri pasif hale gelecektir.

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (Convert.ToInt32(DropDownList1.SelectedItem.Value) == 0)
{
CheckBox1.Checked = true;
CheckBox2.Checked = true;
}
else if(Convert.ToInt32(DropDownList1.SelectedItem.Value)==1)
{
CheckBox1.Checked = true;
CheckBox2.Checked = false;
}
}

RadioButton

RadioButton kontrolü

protected void Button1_Click(object sender, EventArgs e)
{
if (RadioButton1.Checked == true)
{
Literal1.Text = "Seçtiğiniz Cinsiyet " + RadioButton1.Text.ToString();
}
else if (RadioButton2.Checked == true)
{
Literal1.Text="Seçtiğiniz Cinsiyet "+RadioButton2.Text.ToString();
}
RadioButton1.Checked = false;
RadioButton2.Checked = false;

}

FileUpload
Bir dosya sunucuya yüklemek için aşağıdaki kot kullanılır.

protected void Button2_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string yukle = FileUpload1.FileName;
Literal1.Text = yukle;
FileUpload1.SaveAs(Server.MapPath(yukle));
Response.Write("Yüklendi");
}
else
{
Response.Write("Yüüklenmedi...");


}
}

28/05/2012

ListBox

ListBox ta girilen valu değerini alıp formatlı bir biçimde kontrole yazdırıyoruz.

protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
int deger = Convert.ToInt32(ListBox1.SelectedItem.Value);
Literal1.Text = string.Format("{0:N} YTL", deger);
}

Want your school to be the top-listed School/college in Adana?
Click here to claim your Sponsored Listing.

Category

Address


Adana
01130

Alerts

Be the first to know and let us send you an email when Kod Akademi posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Subscribe

We will notify you when anything happens in Adana.