C# Form Application - Insert Delete Update and Search in MS Access Database with Sample DB File

Поділитися
Вставка
  • Опубліковано 25 лип 2024
  • #windowsfrom #form #programming #csharp #database #db #access
    Database: www.yazilimkodlama.com/wp-con...
  • Наука та технологія

КОМЕНТАРІ • 47

  • @unknow5600
    @unknow5600 3 місяці тому

    adam ya aga bir türlü çözemediğim ve çözümünü bulamadığım şey bu kadar basitmiş sen adamsın tek sorun any cpu da çalışmasıymış deliricektim

  • @MaxBarylko
    @MaxBarylko Рік тому

    omg im so grateful... this video helped me a lot

  • @338madison
    @338madison 2 місяці тому

    THANK YOU SO MUCH, DUDE

  • @mohammedaminetniouni8816
    @mohammedaminetniouni8816 Рік тому

    thank you so much !

  • @Orionpaxx723
    @Orionpaxx723 6 місяців тому +1

    ı couldnt get the data from x64 file because it is not exist .

  • @meowmeowwwwwwehsg
    @meowmeowwwwwwehsg Рік тому

    mine is having a syntax error in update statement, someone pls?

  • @raduluchian7008
    @raduluchian7008 Рік тому +2

    Thanks to the suggestions that appear for the next clip, the area where you write "dv.RowFilter = "NameFirstname LIKE ... ;" is covered.
    So please complete this line of code here.
    Thank you in advance!

    • @raduluchian7008
      @raduluchian7008 Рік тому +1

      That's what I did and it's not ok:
      dv.RowFilter = "lastName LIKE '%"+txtLastNume.Text+"%'";
      Where am I wrong?
      Again, I can't see your entire line because of the windows that pop up to suggest the other tutorials.

    • @TKcode
      @TKcode  Рік тому +1

      @@raduluchian7008 DataView dv = dt.DefaultView;
      dv.RowFilter = "Name LIKE '%" + txtSearch.Text + "%'";
      dgwCustomers.DataSource = dv;

    • @TKcode
      @TKcode  Рік тому

      DataView dv = dt.DefaultView;
      dv.RowFilter = "Name LIKE '%" + txtSearch.Text + "%'";
      dgwCustomers.DataSource = dv;

    • @Mysticalsword5
      @Mysticalsword5 Рік тому

      @@TKcode What if I have two fields for First name (Fname) and Last name (Lname)?

  • @nikolas276
    @nikolas276 Рік тому

    adapter.Fill(dt); not working(

  • @WILLFACTOR11
    @WILLFACTOR11 2 роки тому

    hello, my update button dopesnt work it says, System.Data.OleDb.OleDbException: 'No value given for one or more required parameters.' anyhelp?

  • @OggyOggy-n8n
    @OggyOggy-n8n 9 днів тому

    Please tell me how about code Search Number or ID

  • @momusicph9304
    @momusicph9304 Рік тому

    How about if you have two colums being search at the same time in the textbox? like for example we have first name and last name. What is the proper way to do it?

    • @TKcode
      @TKcode  Рік тому +1

      Hello, If understood you true. There are a few different ways to handle searching for data in a textbox across multiple columns in a DataGridView in a Windows Forms application, but one common approach is to use the DataView.RowFilter property.
      First, you would need to create a DataView object for the DataTable or DataSet that is being displayed in the DataGridView. Then, you can use the DataView's RowFilter property to filter the data based on the text entered in the textbox and the column names of the first name and last name columns.
      Here's an example of how you might set the RowFilter property in a button click event handler
      private void searchButton_Click(object sender, EventArgs e)
      {
      string searchText = searchTextBox.Text;
      string filter = "(firstName LIKE '%" + searchText + "%') OR (lastName LIKE '%" + searchText + "%')";
      DataView dv = new DataView(yourDataTable);
      dv.RowFilter = filter;
      dataGridView1.DataSource = dv;
      }

    • @momusicph9304
      @momusicph9304 Рік тому

      @@TKcode I want to ask some. I think this will work if you have only one textbox intended for typing keyword as such as searchText. right? what if you have two textbox intended for searching namely "First name" and "Last Name", how do I approach that? i dont know how to do it right. this is my sample code but it only reads the last line of code which is the last name. thankyouu in advanced.
      private void btnSearch_Click(object sender, EventArgs e)
      {
      DataView dv = dt.DefaultView;
      dv.RowFilter = "FIRST_NAME LIKE '%" + txtSearch.Text + "%'";
      dv.RowFilter = "LAST_NAME LIKE '%" + txtSearch2.Text + "%'";
      dgwVaccinee.DataSource = dv;

      }

    • @TKcode
      @TKcode  Рік тому

      @@momusicph9304
      private void txtSearch_TextChanged(object sender, EventArgs e)
      {
      DataView dv = dt.DefaultView;
      dv.RowFilter = "Name + Country LIKE '%" + txtSearch.Text + "%'";
      dgwCustomers.DataSource = dv;
      }
      The filter is set using a combination of the "Name" and "Country" columns, and the search criteria is taken from the Text property of a TextBox (txtSearch). The filter uses the LIKE operator to match any rows where the combination of the "Name" and "Country" columns contains the search criteria as a substring.

    • @momusicph9304
      @momusicph9304 Рік тому +1

      @@TKcode i have solved my problem. thankyouu so much for this! godbless!

  • @ayeshamishree
    @ayeshamishree Рік тому +2

    I am having error "Microsoft ACE OleDb.16.0 is not registered on the local machine". please help me I have to submit project in university. I have changed any CPU to Configuration, same as you did, but still its showing an error.

    • @liahimmihail5819
      @liahimmihail5819 Рік тому

      I have the same problem, did you find a solution?

    • @ayeshamishree
      @ayeshamishree Рік тому

      @@liahimmihail5819 yes! I have made this application.

    • @sharina2849
      @sharina2849 11 місяців тому

      @@liahimmihail5819 Make sure you put everything in C file to avoid data confusion

  • @lwiimbokasweshi
    @lwiimbokasweshi Рік тому +1

    When was dgwCustomers created? @ 4:38

  • @MMiranda3
    @MMiranda3 Рік тому +1

    Please provide the codes to filter data in data grid view. Thanks. Unable to view the codes on this video. Thanks.

    • @raduluchian7008
      @raduluchian7008 Рік тому

      Hi,
      Did someone answer your request? Because I would have the same problem.

    • @raduluchian7008
      @raduluchian7008 Рік тому

      If it's still useful, I'll send you the solution in my case.
      So, it looks like this:
      DataView dv = dt.DefaultView;
      dv.RowFilter = "NameFirstName LIKE '" + txtSearchEmployee.Text + "%'";
      dgvEmployees.DataSource = dv;

  • @tradetkm
    @tradetkm 2 роки тому

    Merhaba hocam benimki insertte hata veriyor. Hep yazdigimda o hatayi aliyor. "mismatch of data types in the selection condition expression" neden ?

    • @TKcode
      @TKcode  2 роки тому

      Veri uyuşmazlığı sorun sanırım

    • @tradetkm
      @tradetkm 2 роки тому

      @@TKcode Veriyi alabiliyor sadece insert veya update almiyor bende

    • @ac6014
      @ac6014 2 роки тому

      @@tradetkm int, double vb kayıt yapıyorsan çevirmek gerekiyor. Convert.ToInt32(..) gibi

  • @ferhatokuyan7658
    @ferhatokuyan7658 2 роки тому

    Projelerin %90 aynı ID yazmak zorundamıyız. ID otomatik artsın.

    • @TKcode
      @TKcode  2 роки тому +3

      Bir veritabanında, bir kaydı birbirinden ayırt etmek için, genellikle Birincil Anahtar olarak bilinen benzersiz bir tanımlayıcıya ihtiyaç duyarız. Burada ki Id alanı otomatik artan olarak ayarlanmış. Yani benzersiz olması sağlanmış durumda. Benzersiz bir alanın olması tablolar arası ilişki kurma, güncelleme, silme gibi konularda kolaylık sağlar. Mesela bu örnekte Id alanına göre silme ve güncelleme işlemi yapılıyor. Örneğin isme göre silme işlemi gerçekleştirmek istersek adı John olan kaydı sil dediğimizde varsa tüm John isimli kayıtlar silinecektir.

  • @GameShorts484
    @GameShorts484 Рік тому +1

    Bilgisayarı şarja tak

  • @libertalia1561
    @libertalia1561 2 роки тому

    Neden Türkçe anlatımı yok

  • @georgihristov2553
    @georgihristov2553 Рік тому

    help
    System.Data.OleDb.OleDbException: 'Syntax error in INSERT INTO statement.'
    string query = "INSERT INTO data (tik, nk, top, np, tipo, npo, na, ka, kp, dp, dpo) VALUES" +
    "(@tik, @nk, @top, @np, @tipo, @npo, @na, @ka, @kp, @dp, @dpo)";
    cmd = new OleDbCommand(query, conn);
    cmd.Parameters.AddWithValue("@tik", textBox6.Text);
    cmd.Parameters.AddWithValue("@nk", maskedTextBox1.Text);
    cmd.Parameters.AddWithValue("@top", textBox2.Text);
    cmd.Parameters.AddWithValue("@np", maskedTextBox2.Text);
    cmd.Parameters.AddWithValue("@tipo", textBox3.Text);
    cmd.Parameters.AddWithValue("@npo", maskedTextBox3.Text);
    cmd.Parameters.AddWithValue("@na", textBox4.Text);
    cmd.Parameters.AddWithValue("@ka", textBox5.Text);
    cmd.Parameters.AddWithValue("@kp", maskedTextBox4.Text);
    cmd.Parameters.AddWithValue("@dp", dateTimePicker1.Text);
    cmd.Parameters.AddWithValue("@dpo", dateTimePicker2.Text);
    conn.Open();
    cmd.ExecuteNonQuery();
    conn.Close();
    MessageBox.Show("data inserted.");
    GetCustomers();

    • @tabiosluisfranco5657
      @tabiosluisfranco5657 Рік тому

      SAME PROBLEM IM HAVING

    • @yojieazenila7239
      @yojieazenila7239 8 місяців тому

      string query = "INSERT INTO data (tik, nk, top, np, tipo, npo, na, ka, kp, dp, [dpo]) VALUES" +
      "(@tik, @nk, @top, @np, @tipo, @npo, @na, @ka, @kp, @dp, @dpo)";
      I add this [ ] and it work i don't know to others , GL

    • @yojieazenila7239
      @yojieazenila7239 8 місяців тому

      by the way Thanks , I'm so lazy to type so I copy this