User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Sep 2007
Posts: 69
Reputation: geetajlo is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
geetajlo geetajlo is offline Offline
Junior Poster in Training

Search Button..Plz Help

  #1  
Oct 16th, 2007
hi can anyone help me . when the user enter the name in a textbox and click the search button, the output should be display in the datagrid... Help plz have to submit my project in 8 days
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2006
Location: United States
Posts: 613
Reputation: binoj_daniel is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 15
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: Search Button..Plz Help

  #2  
Oct 16th, 2007
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
Reply With Quote  
Join Date: Jun 2007
Posts: 82
Reputation: preetham.saroja is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
preetham.saroja's Avatar
preetham.saroja preetham.saroja is offline Offline
Junior Poster in Training

Re: Search Button..Plz Help

  #3  
Oct 18th, 2007
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
-----------
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 5:25 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC