We help IT Professionals succeed at work.

SQL in a DataGridView

bdb12
bdb12 asked
on
164 Views
Last Modified: 2012-06-21
With my DataGridView, I'm having trouble trying to pass a textbox value to a query as one of the parameters

I use the following query

SELECT     *
FROM         Timesheet
WHERE     UserID = txtID.Text

At run time it throws up an error

'No value given for one or more parameters'

Any help?
Comment
Watch Question

Tech Arch
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Went to the Dataset, then Query Builder & changed the syntax to what u said.

'SELECT     *
FROM         Timesheet
WHERE     UserID = ' + txtID.[Text]

Still not working tho...

thanks for your reply
Jai STech Arch
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Ok Im properly confused now...

What way were you describing? seems easier
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.