use this:

cmd.CommandText = "UPDATE products SET code= ' " +TextBox1.Text + " ',
price= " + Convert.toDecimal(TextBox2.Text )+" WHERE product="+
Convert.toInt64( TextBox1.Text ) "

On Fri, Dec 12, 2008 at 5:53 PM, sundar irene <[email protected]> wrote:

>
> use + instead of &
>
> On Thu, Dec 11, 2008 at 8:43 AM, Stephen Russell <[email protected]>
> wrote:
> > Are you sure that Price is a char?  I would think that it is numeric and
> you
> > need a conversion from the String in the textbox to the Value of the data
> > column.
> >
> >
> >
> > HTH
> >
> >
> >
> > …………………………………………………………………
> >
> > Stephen Russell –
> >
> > Senior Visual Studio Developer, DBA
> >
> >
> >
> > Memphis, TN
> >
> > 901.246-0159
> >
> >
> >
> >
> >
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of Vivek Vorani
> > Sent: Monday, December 08, 2008 12:58 PM
> > To: [email protected]
> > Subject: [DotNetDevelopment] SQL UPDATE query error
> >
> >
> >
> > Can someone please tell me why I'm getting an error - "No value given for
> on
> > more parameters when I execute this SQL query.
> >
> > cmd.CommandText = "UPDATE products SET code= '" & TextBox1.Text & "',
> price=
> > '" & TextBox2.Text & "' WHERE product= '" & TextBox1.Text & "'"
> >
> > Fonts kept large intentionally to differentiate between " and '
> >
> > Thanks,
> > Vivek.
> >
> > No virus found in this incoming message.
> > Checked by AVG - http://www.avg.com
> > Version: 8.0.176 / Virus Database: 270.9.15/1837 - Release Date:
> 12/9/2008
> > 9:59 AM
>

Reply via email to