Last post Mar 02, 2010 09:09 AM by Mistery1
Mar 02, 2010 08:04 AM|Mistery1|LINK
Please assist with accessing parameter from codebehind. I'm connecting via a table adapter and my parameter is a textbox that loads on page preLoad. Here's my code but no matter what I try, error occurs. "Conversion from string "@projectIDtxtb" to type
'Integer' is not valid."
I know I'm missing something just not sure what.
Dim MyInteger As Integer = Convert.ToInt16(projectIDtxtb.Text)
project = SalesAdapter.GetDatabyID"@projectIDtxtb")
Any assistance in this regard will be greatly appreciated.
Mar 02, 2010 08:47 AM|adeelehsan|LINK
You need to pass a value for the parameter @projectIDtxtb.
Whereas you are passing the parameter name as it is. Try passing some numeric value.
Mar 02, 2010 09:00 AM|Mistery1|LINK
I have hard coded a number into that space, and it works but I need to pull the value from that textbox so what would my code be then?
Mar 02, 2010 09:04 AM|adeelehsan|LINK
Use the following:
project = SalesAdapter.GetDatabyID(CInt(TextBox1.Text))
Mar 02, 2010 09:09 AM|Mistery1|LINK
thank you so much ADEEL, it worked.