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!
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.
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.
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;
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?
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; }
@@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;
@@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.
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.
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
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!
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.
@@raduluchian7008 DataView dv = dt.DefaultView;
dv.RowFilter = "Name LIKE '%" + txtSearch.Text + "%'";
dgwCustomers.DataSource = dv;
DataView dv = dt.DefaultView;
dv.RowFilter = "Name LIKE '%" + txtSearch.Text + "%'";
dgwCustomers.DataSource = dv;
@@TKcode What if I have two fields for First name (Fname) and Last name (Lname)?
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
ı couldnt get the data from x64 file because it is not exist .
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.
I have the same problem, did you find a solution?
@@liahimmihail5819 yes! I have made this application.
@@liahimmihail5819 Make sure you put everything in C file to avoid data confusion
adapter.Fill(dt); not working(
Please tell me how about code Search Number or ID
When was dgwCustomers created? @ 4:38
Okay got it. It's the name of the grid
Please provide the codes to filter data in data grid view. Thanks. Unable to view the codes on this video. Thanks.
Hi,
Did someone answer your request? Because I would have the same problem.
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;
mine is having a syntax error in update statement, someone pls?
hello, my update button dopesnt work it says, System.Data.OleDb.OleDbException: 'No value given for one or more required parameters.' anyhelp?
same in me
Merhaba hocam benimki insertte hata veriyor. Hep yazdigimda o hatayi aliyor. "mismatch of data types in the selection condition expression" neden ?
Veri uyuşmazlığı sorun sanırım
@@TKcode Veriyi alabiliyor sadece insert veya update almiyor bende
@@tradetkm int, double vb kayıt yapıyorsan çevirmek gerekiyor. Convert.ToInt32(..) gibi
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?
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;
}
@@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;
}
@@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.
@@TKcode i have solved my problem. thankyouu so much for this! godbless!
THANK YOU SO MUCH, DUDE
Projelerin %90 aynı ID yazmak zorundamıyız. ID otomatik artsın.
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.
thank you so much !
omg im so grateful... this video helped me a lot
Bilgisayarı şarja tak
Neden Türkçe anlatımı yok
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();
SAME PROBLEM IM HAVING
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
by the way Thanks , I'm so lazy to type so I copy this