السلام عليكم
بدي اضيف شغلة داخل جمل ال sql يحيث انه لما اكتب بالتكس بوكس بال upper ما يعطيني الا ال upper
وال lower ما يعطيني الا ال lower
Dim connectionStre As String = ConfigurationManager.ConnectionStrings("evaluatorConnectionString").ConnectionString
Dim Conne As New SqlConnection(connectionStre)
Conne.Open()
Dim cmde As New SqlCommand()
cmde.Connection = Conne
cmde.CommandText = "select * from Employee where 1 = 1 "
If TextBox4.Text <> "" Then
cmde.CommandText = cmde.CommandText + " and Name LIKE '%" + TextBox4.Text + "%' or LatName LIKE '%" + TextBox4.Text + "%'"
End If
If TextBox2.Text <> "" Then
cmde.CommandText = cmde.CommandText + " and DeptId LIKE '%" + TextBox2.Text + "%' "
End If
If TextBox3.Text <> "" Then
cmde.CommandText = cmde.CommandText + " and BranchId LIKE '%" + TextBox3.Text + "%' "
End If
If TextBox5.Text <> "" Then
cmde.CommandText = cmde.CommandText + " and LatName LIKE '%" + UCase(TextBox5.Text) + "%' or {fn ucase(Name)} LIKE '%" + UCase(TextBox5.Text) + "%'"
End If
If TextBox6.Text <> "" Then
cmde.CommandText = cmde.CommandText + " and Ext LIKE '%" + TextBox6.Text + "%' "
End If
If TextBox7.Text <> "" Then
cmde.CommandText = cmde.CommandText + " and dPhone LIKE '% " + TextBox7.Text + "%' "
End If
If TextBox8.Text <> "" Then
cmde.CommandText = cmde.CommandText + " and Phone LIKE '%" + TextBox8.Text + "%' "
End If
If TextBox9.Text <> "" Then
cmde.CommandText = cmde.CommandText + " and email LIKE '%" + TextBox9.Text + "%' "
End If
Response.Write(cmde.CommandText)
Dim dr As SqlClient.SqlDataReader
dr = cmde.ExecuteReader
GridView7.Visible = True
GridView7.DataSource = dr
GridView7.DataBind()