Reply
Mon 24 May, 2010 03:27 pm
hi everyone. i have a technical question to ask.
i have run into a problem while doing a search program. please help me.
i am trying to search a database and return the results in a datagrid view. my webform contains a text box txtsearch and a button btnSearch and a datagrid view grdoutput. the problem is i can not get anything to display. here is the code
Imports System.Data
Imports System.data.OleDb
Partial Class search
Inherits System.Web.UI.Page
Dim myDataTable As New DataTable
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Dim strSQL As String
strSQL = "select Pin from Credentials where Gpa > " & txtSearch.Text & ""
Dim conConnection As New OleDbConnection
conConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=" & System.AppDomain.CurrentDomain.BaseDirectory() & "\App_Data\sh.mdb"
conConnection.Open()
Dim myDataAdapter As New OleDbDataAdapter(strSQL, conConnection)
myDataAdapter.Fill(myDataTable)
grdoutput.DataSource = myDataTable
conConnection.Close()
myDataAdapter.Dispose()
End Sub
End Class
can someone please help?
no vb.net guys/girls here?
Does anyone at least know of a online source?