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

Sdílet
Vložit
  • čas přidán 23. 03. 2022
  • #windowsfrom #form #programming #csharp #database #db #access
    Database: www.yazilimkodlama.com/wp-con...
  • Věda a technologie

Komentáře • 47

  • @unknow5600
    @unknow5600 Před 3 měsíci

    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

  • @338madison
    @338madison Před 2 měsíci

    THANK YOU SO MUCH, DUDE

  • @mohammedaminetniouni8816

    thank you so much !

  • @raduluchian7008
    @raduluchian7008 Před rokem +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 Před rokem +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  Před rokem +1

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

    • @TKcode
      @TKcode  Před rokem

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

    • @Mysticalsword5
      @Mysticalsword5 Před rokem

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

  • @MaxBarylko
    @MaxBarylko Před rokem

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

  • @Orionpaxx723
    @Orionpaxx723 Před 6 měsíci +1

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

  • @meowmeowwwwwwehsg
    @meowmeowwwwwwehsg Před rokem

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

  • @WILLFACTOR11
    @WILLFACTOR11 Před 2 lety

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

  • @nikolas276
    @nikolas276 Před rokem

    adapter.Fill(dt); not working(

  • @tradetkm
    @tradetkm Před 2 lety

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

    • @TKcode
      @TKcode  Před 2 lety

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

    • @tradetkm
      @tradetkm Před 2 lety

      @@TKcode Veriyi alabiliyor sadece insert veya update almiyor bende

    • @ac6014
      @ac6014 Před 2 lety

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

  • @momusicph9304
    @momusicph9304 Před rokem

    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  Před rokem +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 Před rokem

      @@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  Před rokem

      @@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 Před rokem +1

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

  • @OggyOggy-n8n
    @OggyOggy-n8n Před 10 dny

    Please tell me how about code Search Number or ID

  • @ayeshamishree
    @ayeshamishree Před rokem +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 Před rokem

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

    • @ayeshamishree
      @ayeshamishree Před rokem

      @@liahimmihail5819 yes! I have made this application.

    • @sharina2849
      @sharina2849 Před 11 měsíci

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

  • @MMiranda3
    @MMiranda3 Před rokem +1

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

    • @raduluchian7008
      @raduluchian7008 Před rokem

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

    • @raduluchian7008
      @raduluchian7008 Před rokem

      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;

  • @lwiimbokasweshi
    @lwiimbokasweshi Před 2 lety +1

    When was dgwCustomers created? @ 4:38

  • @ferhatokuyan7658
    @ferhatokuyan7658 Před 2 lety

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

    • @TKcode
      @TKcode  Před 2 lety +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 Před rokem +1

    Bilgisayarı şarja tak

  • @libertalia1561
    @libertalia1561 Před 2 lety

    Neden Türkçe anlatımı yok

  • @georgihristov2553
    @georgihristov2553 Před rokem

    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 Před rokem

      SAME PROBLEM IM HAVING

    • @yojieazenila7239
      @yojieazenila7239 Před 8 měsíci

      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 Před 8 měsíci

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