shamim khan

shamim khan

  • NA
  • 1
  • 2.5k

Must Declare Scalar variable "@photo"

Feb 20 2013 12:10 PM
Hi..

sir have used the code from your Artical(

Inserting & Retrieving Images from SQL Server Database without using Stored Procedures)..

without any changes..

But sir it works for My Insert Query

"insert into Student values('" + txtStudentReg.Text.ToString() + "','" + txtStudentName.Text.ToString() + "',@photo,'" + comboDescipId.SelectedItem.ToString() + "','" + txtFatherName.Text + "')";

But Does't Work for My Update Query

 "Update  Student set StudentName='" + txtstdName.Text.ToString() + "', StudentImage=@photo, DescipId='" + comboDescipline.SelectedItem.ToString() + "', FatherName='" + txtFatherName.Text + "' where StudentRegNo='" + txtStdRegno.Text + "'";

StudentImage is my table field in Student Table of type Image....

please Please Sir Help me..... I need it Urgently...

Thanks in advance

Answers (2)