Visual Basic.net: datagridview multiple columns search in database sql

Visual Basic.net: datagridview multiple columns search in database sql

Programming for Everybody

4 года назад

12,264 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@slimrekikslimrekik3404
@slimrekikslimrekik3404 - 02.12.2023 23:53

I need % to filter the parameter example like 12A%555, but by putting the % in serchtextbox an error triggers I need your help thank you, here is my code: Sub filterdg1()

If cbrech.Text = "Contient" Then
Dim dvccopy As DataTable = dtart.Copy
Dim dvc As DataView = dvccopy.DefaultView

dvc.RowFilter = "refart like '*" + T1.Text + "%' and desart like '%" + t2.Text + "%' and Marque like '%" + t3.Text + "%' and Famille like '%" + t4.Text + "%' "
DataGridView1.DataSource = dvc
ElseIf cbrech.Text = "Commence par" Then
Dim dvccopy As DataTable = dtart.Copy
Dim dvc As DataView = dvccopy.DefaultView
dvc.RowFilter = "refart like '" & T1.Text & "%' and desart like '" & t2.Text & "%' and Marque like '" & t3.Text & "%' and Famille like '" & t4.Text & "%' "
DataGridView1.DataSource = dvc
End If
TextBox1.Text = DataGridView1.RowCount.ToString
End Sub
my database is mysql

Ответить
@waelzad4655
@waelzad4655 - 11.11.2022 10:40

رائع ...

Ответить
@waelzad4655
@waelzad4655 - 04.10.2022 13:59

Good & Simple Code.

Ответить
@sumithach1634
@sumithach1634 - 23.09.2022 16:13

I got an error with "sda.Fill(dt)" As I think it is a data source problem, could you tell me how to get data source.

Ответить
@Koriell
@Koriell - 20.04.2022 16:55

i have an error The name 'Me' does not exist in the current context.
have any idea how to fix this? im using visual studio btw

Ответить
@ghassansalem1711
@ghassansalem1711 - 25.04.2021 05:25

Thanks for the video, great work, I am trying to write a similar function in VB, the editor does not accept sqlcommand . is the code in C# or in VB? can you please advise?, Thanks in advance

Ответить
@دانيةأبوبكر-ش9ن
@دانيةأبوبكر-ش9ن - 27.03.2021 03:47

If you please, what is the parm1

Ответить
@nitidogamer1992
@nitidogamer1992 - 08.12.2020 17:35

I have a question if its posible. I have a query with inners from several tables. i want to use it for this search. Example
i type a number on text box and it will look up this info into a few tables (more than 5 ) how do i configure de textbox search.? if i do just 1 table on my where on sql query is okay , but i need info from mor tables.

Ответить
@isarel5925
@isarel5925 - 14.07.2020 03:01

Can you help me I am getting an error when I run it says Incorrect syntax near the word 'like" and it highlights sda.Fill(dt) with a big X

Ответить