| | |
Passing parameter to datagridview
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2007
Posts: 4
Reputation:
Solved Threads: 0
Hi all,
I need help in passing parameter value to a datagridview control on my form. I have a form with a textbox control, a datagridview control and a button. When the user enters in the title of a movie in the textbox and clicks on the OK button, I would like that record to be retrieved from the database into the datagridview control. The datagridview is bound to a database table. Can someone please help. Sample code will be greatly appreciated.
Regards
I need help in passing parameter value to a datagridview control on my form. I have a form with a textbox control, a datagridview control and a button. When the user enters in the title of a movie in the textbox and clicks on the OK button, I would like that record to be retrieved from the database into the datagridview control. The datagridview is bound to a database table. Can someone please help. Sample code will be greatly appreciated.
Regards
what your asking is a pretty easily completed task. what you need to do make a new select statement with a user defined variable. see below
that @myTitle tells the TableAdapter that the value of @myTitle will be sent in, meaning it can be the text value of the text box. once you have created this new query you can then create a grid view from it, during the creation of the grid view it will ask you to assign any user defined parameters. select control as the type, and then the name of the text box as the value. should work easy enough.
hope that helps.
Select MovieId, MovieTitle, MovieDesc
From Movies
Where MovieTitle = @myTitlethat @myTitle tells the TableAdapter that the value of @myTitle will be sent in, meaning it can be the text value of the text box. once you have created this new query you can then create a grid view from it, during the creation of the grid view it will ask you to assign any user defined parameters. select control as the type, and then the name of the text box as the value. should work easy enough.
hope that helps.
- mike mclennan
•
•
Join Date: May 2007
Posts: 4
Reputation:
Solved Threads: 0
Hi All,
I need help in passing data from a datagridview control to textboxes control. When the user doubleclick a value from a datagridview control in form1, I want the record to be displayed in the texboxes of form2. How do I go about coding this? Any help would be highly welcome.
I need help in passing data from a datagridview control to textboxes control. When the user doubleclick a value from a datagridview control in form1, I want the record to be displayed in the texboxes of form2. How do I go about coding this? Any help would be highly welcome.
Last edited by olodu; Jun 30th, 2007 at 2:53 am. Reason: Bad
![]() |
Similar Threads
- Passing Parameter in Data Reports (Visual Basic 4 / 5 / 6)
- Issue about passing parameter to Crystal Report 11.. (Visual Basic 4 / 5 / 6)
- Passing data from datagridview to textboxes (VB.NET)
- passing parameter to Store Procedure in SqlDataAdapter (VB.NET)
- Having trouble passing bool type to function....need help (C++)
- problem passing parameter to crystal from .net (VB.NET)
- Need help passing a multi-dimensional array (C++)
Other Threads in the VB.NET Forum
- Previous Thread: Datagridview question
- Next Thread: Type 'application.dataset' not defined in vb net
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 30minutes 2005 2008 access account application arithmetic array arrays basic binary bing button buttons c# center check checkbox code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy image images inline insert intel internet listview mobile monitor ms net networking output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project reports" save searchbox searchvb.net select serial server soap sorting table tcp text textbox timer toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





