| | |
Search an access database
![]() |
•
•
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: 119
Reputation:
Solved Threads: 19
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
- access database search and display (Visual Basic 4 / 5 / 6)
- 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)
- 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
Views: 663 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 2008 ajax ajax-doc appliances asp asp.net asp.net-mvc beginner blog box browser businesslogiclayer button c# chat checkbox class click control database datagrid datagridview datalist db delete deployment development dgv dialog dynamically edit editing embeddingactivexcontrol external feedback fileuploader flash form forms formview google gridview iframe iis iis-application image india javascript knowledge-required list locahost-email login mac migration mssql novell object opera pdf picturebox popup-page problem profile redirect registration reports running search security select server service session silverlight sql stop-sql-injection studio subdomain tracking translate translate-web-pages treeview trust-level update validatedate validation vb.net vista visualstudio vs2008 wcf web webarchitecture webdevelopment website xml youareanotmemberofthedebuggerusers





