•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 456,554 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,485 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 1559 | Replies: 2
![]() |
•
•
Join Date: Dec 2006
Location: United States
Posts: 613
Reputation:
Rep Power: 3
Solved Threads: 15
This is pretty easy to do. You can tie the DataGrid to the filter function and pass textbox as a paramter to filter records on the Grid
just paste this code:::
Protected Sub btnchk_name_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnchk_name.Click
Dim str As String = "select ID from table1 where ID = '" & txtid.Text & "'"
Dim con As String = ConfigurationManager.AppSettings("preeconn")
Dim com As New SqlCommand(str, New SqlConnection(con))
com.Connection.Open()
Dim da As New SqlDataAdapter(str, con)
Dim dr As SqlDataReader
dr = com.ExecuteReader 'where sqldatareader ain't run without using
If Not dr.Read() Then
datagrid.datasource=com.executereader()
datagrid.databind()
End If
End Sub
-----------
Protected Sub btnchk_name_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnchk_name.Click
Dim str As String = "select ID from table1 where ID = '" & txtid.Text & "'"
Dim con As String = ConfigurationManager.AppSettings("preeconn")
Dim com As New SqlCommand(str, New SqlConnection(con))
com.Connection.Open()
Dim da As New SqlDataAdapter(str, con)
Dim dr As SqlDataReader
dr = com.ExecuteReader 'where sqldatareader ain't run without using
If Not dr.Read() Then
datagrid.datasource=com.executereader()
datagrid.databind()
End If
End Sub
-----------
![]() |
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net .net framework 3.0 access adsense advertising asp blogging bomb book business code combo copyright custom data development dropdownlist earth engine failure forum google internet malware marketing mcafee microsoft module monetization news operating phishing privacy publishing reuse revenue search security seo skin software spyware support system technical theme web webmaster wiki yahoo
- problem clicking on button (Perl)
- Could somebody write code for my project plz... (Visual Basic 4 / 5 / 6)
- Search code ... (Visual Basic 4 / 5 / 6)
- search record using search button from database (ASP)
- Where, oh where has my search button gone? (DaniWeb Community Feedback)
- help please cannot use search button on ie6 (Web Browsers)
Other Threads in the VB.NET Forum
- Previous Thread: Audio file
- Next Thread: Generic List Grouping


Linear Mode