| | |
Search an access database
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2008
Posts: 2
Reputation:
Solved Threads: 0
/
I'm using Microsoft Visual Web Developer 2008 to make a website and I have an access data source on the page linked to a table with a bunch of cities listed. There is a Grid View on the page linked to the data source. Also on the page I have a text box and a button. What I want to happen is the user to type in a zip code, press the button, and for it to update the grid view to show the results.
This is the code that I have:
However, this isn't working. Any help?
I'm using Microsoft Visual Web Developer 2008 to make a website and I have an access data source on the page linked to a table with a bunch of cities listed. There is a Grid View on the page linked to the data source. Also on the page I have a text box and a button. What I want to happen is the user to type in a zip code, press the button, and for it to update the grid view to show the results.
This is the code that I have:
ASP.NET Syntax (Toggle Plain Text)
Protected Sub Search_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Search.Click AccessDataSource1.InsertCommand = "SELECT * FROM [AvailRides] WHERE StartZip =" & ZipSearch.Text End Sub
However, this isn't working. Any help?
•
•
Join Date: Sep 2007
Posts: 80
Reputation:
Solved Threads: 14
Hi
Pls. use SQL query viz
strQuery = "Select Zipcode from Ziptable where Zipcode like '%" & your param &" %'"
Pls. make sure to change your approriate db connection string
Pls. mark as solved if it helps you.
Regards
Pls. use SQL query viz
strQuery = "Select Zipcode from Ziptable where Zipcode like '%" & your param &" %'"
Pls. make sure to change your approriate db connection string
ASP.NET Syntax (Toggle Plain Text)
Public Function LoadData(ByVal StrQuery As String) As DataSet Try Dim con As New MySqlConnection(GetConnection.ToString) Dim cmd As New MySqlCommand(StrQuery, con) Dim ds As New DataSet Dim da As New MySqlDataAdapter(cmd) If con.State = ConnectionState.Open Then con.Close() End If con.Open() da.Fill(ds) If IsNothing(ds) Then ds = Nothing Return ds Else Return ds End If Catch ex As Exception Throw ex End Try End Function
Pls. mark as solved if it helps you.
Regards
Last edited by reach_yousuf; Nov 23rd, 2008 at 12:56 am.
![]() |
Similar Threads
- Search of item in database (Visual Basic 4 / 5 / 6)
- Updating an Access database with a secondary form (VB.NET)
- MS Access database and java (Java)
- access database search and display (Visual Basic 4 / 5 / 6)
- From * Where =< in Access Database (ASP)
- Searching for a string in an access database (Visual Basic 4 / 5 / 6)
- search record using search button from database (ASP)
- able to search? (Visual Basic 4 / 5 / 6)
Other Threads in the ASP.NET Forum
- Previous Thread: C# equivalent for the PHP strip_tags()
- Next Thread: How to Search record from the Sql Server Database
| Thread Tools | Search this Thread |
.net 2.0 activexcontrol ajax alltypeofvideos appliances application asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox commonfunctions control dataaccesslayer database datagridview datagridviewcheckbox datalist deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose feedback fileuploader fill findcontrol flash form formatdecimal formview google gridview gudi iis image javascript listbox login microsoft mobile mono mouse mssql news novell numerical opera panelmasterpagebuttoncontrols parent radio redirect registration relationaldatabases reportemail save schoolproject search security select sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers





