07-08-23, 01:45 AM
ان شاء الله
تم تصحيح الكود واصبح شغال كالاتي
تم تصحيح الكود واصبح شغال كالاتي
كود :
dt.Clear()
Label1.Hide()
Dim txt As String = ""
For Each s As Char In textSerch.Text
If s = "أ" Or s = "إ" Or s = "آ" Or s = "ا" Then
txt &= "[أإآا]"
ElseIf s = "ه" Or s = "ة" Then
txt &= "[هة]"
ElseIf s = "ى" Or s = "ي" Then
txt &= "[ىي]"
ElseIf s = "و" Or s = "ؤ" Then
txt &= "[وؤ]"
Else
txt &= s
End If
Next
If textSerch.Text.Trim = "" Then
Label1.Visible = False
Exit Sub
End If
If textSerch.Text.Trim.Length < 3 Then
Label1.Visible = True
Exit Sub
End If
da.SelectCommand.Parameters.Clear()
da.SelectCommand.Parameters.AddWithValue("@c", "%" & txt.Trim & "%")
da.Fill(dt)
DataGridView1.DataSource = Nothing
DataGridView1.DataSource = dt
DataGridView1.ClearSelection()
If dt.Rows.Count = 0 Then
Label1.Show()
End If
If textSerch.Text = "" Then
Label2.Show()
Else
Label2.Hide()
End If
اللهمّ بعلمك الغيب وقدرتك على الخلق، أحييني ما علمت الحياة خيراً لي، وتوفّني ما علمت الوفاة خيراً لي.

