Rai_87
04-23-2008, 02:32 AM
I need help to solve this error (must declare scalar variable "@UserId")
this is my coding:
connect.Open();
cmd.Parameters.AddWithValue("@UserId", userid);
MemoryStream stream = new MemoryStream();
cmd = new SqlCommand(commandString.ToString(), connect);
SqlCommand command = new SqlCommand("SELECT CompanyLogo" + " from CompleteUserDetails where userid= @UserId", connect);
byte[] storedImage = (byte[])command.ExecuteScalar();
stream.Write(storedImage, 0, storedImage.Length);
Bitmap bitmap = new Bitmap(stream);
Response.ContentType = "Image/jpeg";
bitmap.Save(Response.OutputStream,System.Drawing.Imaging.ImageFormat.Jpeg);
cmd.Parameters.AddWithValue("@CompanyLogo", image);
cmd.ExecuteNonQuery();
connect.Close();
Pls help me to solve this problem, if u know how to solve this problem and i will apprieciate if u help =D
this is my coding:
connect.Open();
cmd.Parameters.AddWithValue("@UserId", userid);
MemoryStream stream = new MemoryStream();
cmd = new SqlCommand(commandString.ToString(), connect);
SqlCommand command = new SqlCommand("SELECT CompanyLogo" + " from CompleteUserDetails where userid= @UserId", connect);
byte[] storedImage = (byte[])command.ExecuteScalar();
stream.Write(storedImage, 0, storedImage.Length);
Bitmap bitmap = new Bitmap(stream);
Response.ContentType = "Image/jpeg";
bitmap.Save(Response.OutputStream,System.Drawing.Imaging.ImageFormat.Jpeg);
cmd.Parameters.AddWithValue("@CompanyLogo", image);
cmd.ExecuteNonQuery();
connect.Close();
Pls help me to solve this problem, if u know how to solve this problem and i will apprieciate if u help =D