Database Search

Database Search (ing) ASP.NET ile veritabanında arama nasıl arama yapıldığını gösteren örnek bir kod***********************************************************     Sub btnSearch_OnClick(sender as Object, e as EventArgs)        Dim objConnection As SqlConnection        Dim objCommand    As SqlCommand        Dim objAdapter    As SqlDataAdapter        Dim objDataSet    As DataSet        Dim strSearch    As String        Dim strSQLQuery As String        "search stringini al        strSearch = txtSearch.Text        "kontrol        If Len(Trim(strSearch))> 0 Then            " bağlantı            objConnection = New SqlConnection("Data Source=serveradı;" _            & "Initial Catalog=databaseadı;User Id=kullanıcı;Password=şifre;" _            & "Connect Timeout=15;Network Library=dbmssocn;")            " SQL query              strSQLQuery = "SELECT * FROM table " _            & "WHERE fieldLIKE "%" & Replace(strSearch, """, """) & "%" " _            & "ORDER BY field;" objCommand = New SqlCommand(strSQLQuery, objConnection) objAdapter = New SqlDataAdapter(objCommand) objDataSet = New DataSet() objAdapter.Fill(objDataSet) dgPaging.DataSource = objDataSet            dgPaging.DataBind()            objConnection.Close()        Else            txtSearch.Text = "Arama Kelimelerini Giriniz"        End If    End Sub  

Döküman Arama

Başlık :

Kapat