Click here to Skip to main content
15,912,756 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
con.Open();         
cmd = new SqlCommand("sp_StudentDetails", con);         
cmd.CommandType = CommandType.StoredProcedure;          
cmd.Parameters.AddWithValue("Date_of_Joining", txtDateofJoining.Text);         
cmd.Parameters.AddWithValue("StudentID", txtStudID.Text);
cmd.Parameters.AddWithValue("Other_Certificates", txtOthersifAny.Text);
      
cmd.Parameters.AddWithValue("image", SqlDbType.Image);
       

cmd.Parameters.AddWithValue("@action", "i");
cmd.ExecuteNonQuery();
Response.Write("Records inserted successfully");
bind();
con.Close();
Posted
Updated 8-Nov-11 23:31pm
v2

1 solution

You are doing it wrong. You should specify value not the type.
cmd.Parameters.AddWithValue("@image", <big>imgByte</big>)

Check the samples in the answer to your previous question[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900