| | |
search record from database
Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Nov 2008
Posts: 19
Reputation:
Solved Threads: 0
hai friends ,,
in monster/naukri we have a search button is there.using that we can search the record from there.
in my project also we have a registration form .
if we wants any customer details just we enters the customer id or name that customer details can retrieved.
i want the code to do like that .i am thinking from 4 days onwards but i am not getting .i am trying using the select command but it is retrieved
please send me a correct to that
Thanks & Regards,
A.Kranti Kumar
in monster/naukri we have a search button is there.using that we can search the record from there.
in my project also we have a registration form .
if we wants any customer details just we enters the customer id or name that customer details can retrieved.
i want the code to do like that .i am thinking from 4 days onwards but i am not getting .i am trying using the select command but it is retrieved
please send me a correct to that
Thanks & Regards,
A.Kranti Kumar
•
•
Join Date: Sep 2007
Posts: 66
Reputation:
Solved Threads: 12
Pls. use SQL query viz
strQuery = "Select * from customers where customer name like '%" textbox1.text &" %'"
Pls. make sure to change your approriate db connection string
The above will return the dataset. bind this dataset to your grid
Pls. mark as solved if it helps you.
strQuery = "Select * from customers where customer name like '%" textbox1.text &" %'"
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
The above will return the dataset. bind this dataset to your grid
ASP.NET Syntax (Toggle Plain Text)
dim ds as new dataset ds = LoadData(strQuery ) grid.datasource = ds grid.databind()
Pls. mark as solved if it helps you.
Last edited by reach_yousuf; Nov 23rd, 2008 at 1:25 am.
![]() |
Similar Threads
- Search code in a database (Visual Basic 4 / 5 / 6)
- Search records in a database (ASP.NET)
- How to Search record from the Sql Server Database (ASP.NET)
- To Search a record in datagridview (VB.NET)
- Search record from SQLDatabase (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: oledbDataAdapter.update exception: No value given for one or more required parameter
- Next Thread: richtextbox in asp.net
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 beginner bottomasp.net browser businesslogiclayer c# cac checkbox class commonfunctions compatible content contenttype countryselector courier dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deployment development dgv dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv formatdecimal formview gridview gudi iframe iis javascript listbox menu microsoft mouse mssql multistepregistration nameisnotdeclared news opera panelmasterpagebuttoncontrols problem redirect registration relationaldatabases reportemail rotatepage schoolproject security serializesmo.table sessionvariables silverlight smartcard smoobjects software sql sql-server sqlserver2005 ssl textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webapplications webarchitecture webdevelopemnt webdevelopment webprogramming webservice youareanotmemberofthedebuggerusers





