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

Поділитися
Вставка
  • Опубліковано 15 січ 2025

КОМЕНТАРІ • 47

  • @unknow5600
    @unknow5600 9 місяців тому

    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

  • @raduluchian7008
    @raduluchian7008 2 роки тому +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 2 роки тому +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  2 роки тому +1

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

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

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

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

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

  • @lwiimbokasweshi
    @lwiimbokasweshi 2 роки тому +1

    When was dgwCustomers created? @ 4:38

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

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

  • @ayeshamishree
    @ayeshamishree 2 роки тому +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 Рік тому

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

  • @OggyOggy-n8n
    @OggyOggy-n8n 6 місяців тому

    Please tell me how about code Search Number or ID

  • @MMiranda3
    @MMiranda3 2 роки тому +1

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

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

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

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

      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;

  • @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?

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

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

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

    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  2 роки тому +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 2 роки тому

      @@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  2 роки тому

      @@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 2 роки тому +1

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

  • @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

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

    thank you so much !

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

    THANK YOU SO MUCH, DUDE

  • @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

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

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

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

    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 Рік тому

      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 Рік тому

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