Click here to Skip to main content
15,891,926 members

VS2010 TableAdapter query, DataGridView

OGWHITIE asked:

Open original thread
I'm trying to create a TableAdapter query in my child form's load event that will show the data of a selected row the user chooses(when the DGV's row header is double clicked)from the parent form. I have everything working fine except the child form's TableAdapter query that should load data of an individually selected row from the parent form's DGV (child form is used for editing data from the parent's DGV).

The parent form uses DataGridView.SelectedRows(i).Index to recognize the selected row the user chooses. How can I integrate this into a query to tell SQL I want it to fill my table where column name Task_ID = the value of the selected row choosen by the user.

The child form is currently using the default fill function
Me.TasksTableAdapter.Fill(Me.TodolistDataSet.tasks)


The current SQL statement is
SQL
SELECT Task_ID, Project_ID, Description_, Priority_Level, Sub_Level, Requested_Date, Comments, Fixed_Date, Software_Version, Requested_By FROM dbo.tasks


I'm using VS2010 professional,.NET Framework 4 Client Profile,MySQL2010
Thanks in advance for any help.

[edit]Sql converted from inline code to code block, Tags - OriginalGriff[/edit]
Tags: Visual Basic (Visual Basic 8 (2005)), Visual Studio (Visual Studio 2010), MySQL

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900