Subrati
Subrati

Reputation: 27

can not search in sql using arabic language

i have a problem with searching in sql and show data in gridview, i want to search using arabic language but no data show in gridview, although if i search using IDNo= int, it is working ok.

zz = "SELECT Name, IDNo, birthplace, Nationality, Mobile, Occupation From PersonalData where Name Like  '%" & TextBox1.Text & "%'"
        Dim dataadapter As SqlDataAdapter = New SqlDataAdapter(zz, myConnection)
        Dim dt As New DataTable("PersonalData")
        Dim dsview As New DataTable
        Dim bs As New BindingSource
        dataadapter.Fill(dt)
        DataGridView1.DataSource = dt

Upvotes: 1

Views: 179

Answers (1)

Royi Namir
Royi Namir

Reputation: 148514

You should add N before the Like in (N'%"...)

"SELECT ...where Name Like  N'%" & TextBox1.Text & "%'"

Also - be aware of sql injection because it seems you're not doing it.

Upvotes: 3

Related Questions