Hi everyone..
Need help to upload picture from C# windows application. Unlucky me.. ive got error --> string or binary data would be truncated.the statement has been terminated
try
{
//Read Image Bytes into a byte array
byte[] imageSampleData = ReadImageToBytes(txtImagePath.Text);
//Initialize SQL Server Connection
SqlConnection con = new SqlConnection(txtConnectionString.Text);
//Set insert query
string query = "INSERT INTO p (ee,i1) values(@ee,@i1)";
//Initialize SqlCommand object for insert.
SqlCommand cmd = new SqlCommand(query, con);
cmd.Parameters.Add(new SqlParameter("@ee",
(object)txtImagePath.Text));
cmd.Parameters.Add(new SqlParameter("@i1",
(object)imageSampleData));
//Open connection and execute insert query.
con.Open();
cmd.ExecuteNonQuery();---> error occur here!
con.Close();
Please help me.