| | |
To Search a record in datagridview
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Aug 2007
Posts: 1
Reputation:
Solved Threads: 0
Ok, what's the problem? Assume you want your users to enter a term in a textbox then you will search for that term. Is that correct? Give a little more info on the issue and what you need.
You could loop through the rows in the datagridview ? Or maybe re-query the datasource?
Dim intcount As Integer = 0
For Each Row As DataGridViewRow In DataGridView1.Rows
If DataGridView1.Rows(intcount).Cells(0).Value = "StringSearch" Then
'Do Something
intcount +=1
End If
Next Row
Dim intcount As Integer = 0
For Each Row As DataGridViewRow In DataGridView1.Rows
If DataGridView1.Rows(intcount).Cells(0).Value = "StringSearch" Then
'Do Something
intcount +=1
End If
Next Row
Last edited by Triss; Nov 5th, 2007 at 4:41 am.
You Can use something like this using DataView
Dim dv As New DataView(ds.Tables(0))
dv.RowFilter = "FirstName = '" & TextBox1.Text & "'"
DataGrid1.DataSource = dv
You can replace the Textbox2.text to the value returned from the inputbox.
Dim dv As New DataView(ds.Tables(0))
dv.RowFilter = "FirstName = '" & TextBox1.Text & "'"
DataGrid1.DataSource = dv
You can replace the Textbox2.text to the value returned from the inputbox.
![]() |
Similar Threads
- Search records in a database (ASP.NET)
- How to Search record from the Sql Server Database (ASP.NET)
- Search record from SQLDatabase (ASP.NET)
- Search facility for a drop down box (MySQL)
- search record using search button from database (ASP)
Other Threads in the VB.NET Forum
- Previous Thread: extract data
- Next Thread: Large Database record editing recommendation
| Thread Tools | Search this Thread |
"crystal .net .net2005 .net2008 2008 access add application array assignment basic beginner box browser button buttons click code combo convert cpu cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationthesis dissertationtopic dosconsolevb.net editvb.net exists fade filter firewall forms html image images input isnumericfuntioncall listview math mobile module mssqlbackend mysql navigate number opacity open panel picturebox picturebox2 port print printing printpreview record regex reports" reuse right-to-left savedialog serial settings shutdown socket sqldatbase sqlserver storedprocedure string temp temperature textbox timer timespan transparency txttoxmlconverter useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vbnet vista visual visualbasic.net visualstudio.net web winforms wpf wrapingcode xml year





