void
|
btn_add_Click(object
|
sender,
|
EventArgs
|
e)
|
2. {
|
3. try
|
4.
|
{
|
25
|
5.
|
6. connect.Open();
|
7. OleDbCommand cmd = new OleDbCommand();
|
8. cmd.Connection = connect;
|
9. cmd.CommandText = "insert into Phone (FirstName,La stName,MobileNo,EmailId) values('" + txt_fname.Text + "',' " + txt_lname.Text + "','" + txt_mobile.Text + "','" + txt
_email.Text + "')";
|
10. cmd.ExecuteNonQuery();
|
11. MessageBox.Show("Data Inserted");
|
12. connect.Close();
|
13. }
|
14. catch (Exception ex)
|
15. {
|
16. MessageBox.Show("Error" + ex);
|
17. }
|
18. }
|
19
19.O'chirish tugmasi uchun
20. private void btn_delete_Click(object sender, EventArg
s e)
|
21. {
|
22. try
|
23. {
|
24. connect.Open();
|
25. OleDbCommand cmd = new OleDbCommand();
|
26. cmd.Connection = connect;
|
27. string query = "delete from Phone where First
Name='" + txt_fname.Text + "'";
|
28. cmd.CommandText = query;
|
29. MessageBox.Show(query);
|
30. cmd.ExecuteNonQuery();
|
31. MessageBox.Show("Data Deleted");
|
32. connect.Close();
|
33. }
|
34. catch (Exception ex)
|
35. {
|
36. MessageBox.Show("Error" + ex);
37. }
38. }
Yangilash tugmasi uchun
private void btn_update_Click(object sender, EventArg s e)
41. {
42. try
43. {
connect.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = connect;
string query = "update Phone set FirstName='"
+ txt_fname.Text + "' ,LastName='" + txt_lname.Text + "'
,MobileNo='" + txt_mobile.Text + "' ,EmailId='" + txt_emai l.Text + "' where FirstName='" + txt_fname.Text + "'";
cmd.CommandText = query;
|
49.
|
|
MessageBox.Show(query);
|
50.
|
|
cmd.ExecuteNonQuery();
|
51.
|
|
MessageBox.Show("Data Updated");
|
52.
|
|
connect.Close();
|
53.
|
}
|
|
54.
|
|
catch (Exception ex)
|
55.
|
|
{
|
56.
|
|
MessageBox.Show("Error" + ex);
|
57.
|
|
}
|
58.
|
}
|
|
59.Yuklash uchun tugma
20
|
60. private void btn_load_Click(object sender, EventArgs
e)
|
61.
|
{
|
|
|
62.
|
|
try
|
|
63.
|
|
{
|
|
64.
|
|
|
connect.Open();
|
65.
|
|
|
OleDbCommand cmd = new OleDbCommand();
|
66.
|
|
|
cmd.Connection = connect;
|
67.
|
|
|
27
|
68. string query = "select * from Phone";
|
69. cmd.CommandText = query;
|
70. OleDbDataAdapter da = new OleDbDataAdapter(cm
d);
|
71. DataTable dt = new DataTable();
|
72. da.Fill(dt);
|
73. dataGridView1.DataSource = dt;
|
74. MessageBox.Show("Data Loaded");
|
75. connect.Close();
|
76. }
|
77. catch (Exception ex)
|
78. {
|
79. MessageBox.Show("Error" + ex);
|
80. }
|
81. }
|
rasm: ma'lumotlarni qo'shing
21
Ma'lumotlaringiz kiritilganmi yoki yo'qmi, uni jadvalda ko'rishingiz mumkin.
rasm: Ma'lumotlarni kiritish
29
Hozirgi zamonda yurtimizda Axborat Texnologiyalarini rivojlantirish
yo‘lida juda ko‘p ishlar amalga oshirilmoqda. Bu borada davlatimiz ko‘p ishlarni amalga oshirmoqda. Xususan ko‘p joylarga dasturlash orqali ko‘p loyihalarni oson va qulay bajarilyapti.Dasturlash chet davlatlarida anchagina rivojlangan masalan Amerika,Malayziya, Koreya,Hindiston.Hozirgi kunda har-xil dasturlash tillari mavjud C++,C#,Java, va hokozo. Shularning orasidan C# Windows muhitida ishlaydigan dastur tuzish uchun qulay vosita bo‘lib,kompyuterda dastur yaratish ishlarini avtomatlashtiradi, xatoliklarni kamaytiradi va dastur tuzuvchi ishini kamaytiradi. C# dastur zamonaviy visual loyihalash texnalogiyasi asosida obyektga yo‘naltirilgan dasturlash tili hisoblanadi.
Men bu kurs ishi davomida C# dasturlash tilida kataloglar ,ularning turlari,telefon kataloglari va ularning turlari ular bilan C# dasturlash tilida foydalanish haqida ko‘nikmalarni oldim.
Yana bir bor takidlab o‘tish joizki men bu kurs ishi bajarish davomida o‘zim uchun murakkab deb keraksiz deb o‘ylagan fikrlarim noto‘g‘ri ekanligini tushunib yetdim. Dasturdagi barcha element va hodisalar bekordan emasligni va hammasining o‘z joyi va vazifasi bor ekanligini yaxshi tushunib yetdim. O‘zimni bilimlarimni yanda oshira oldim deb o‘ylayman.
30
Foydalanilgan adabiyotlar
Troelsen Endryu, Jeppiks Fillip | Язык программирования C# 7 и платформы .NET и .NET Core. Вилcямсю. 2018
Albaxari Ben, Albaxari Jozef. C# 7.0 .справочникю Полное описание языка.
С англ.- СПБ: “ Алфа книга”, 2018, 1024 c.
Ю.С. Магда С# . Язык программирования С #. –изд. ДМК пресс, 2013, 190 сю
Christian Nagel , PROFESSIONAL C# 7 and .NET Core 2.0 Wrox, 2018.
31
Do'stlaringiz bilan baham: |