Q: how could i store docs pdf image files in database using stored procedure in C# i have written code following code to store the pdf/docs/image files in database, using c#.net
and sql server 2008 stored procedure but i am unable to do that after converted file in byte array. 
Code:
 private void bttnSave_Click(object sender, EventArgs e)
        {
            FrmAccept sForm = new FrmAccept();
            sForm.ShowDialog();
            if (FrmAccept.strMsg == "YES")
            {
                sFunctionQuotationSave();
                MessageBox.Show("Data Saved Successfully", "Insert Record", MessageBoxButtons.OK, MessageBoxIcon.Information);

            }
            else
            { return; }
        }

        public void sFunctionQuotationSave()
        {
            SERIALNUMBER = 1;
            Int32 Id = Convert.ToInt32(sSearch);

            String bytestring = null;
            for (int i = 0; i < dgvQuotationVouchers.Rows.Count; i++)
            {
                string filename = dgvQuotationVouchers.Rows[i].Cells[5].Value.ToString();
                MessageBox.Show("FIlePAth>>" + filename);


                byte[] bytes = File.ReadAllBytes(dgvQuotationVouchers.Rows[i].Cells[5].Value.ToString());
                SqlParameter fileP = new SqlParameter("Upload", SqlDbType.VarBinary);
                fileP.Value = bytes;
                SqlCommand myCommand = new SqlCommand();


                SqlCommand sqlcomm = new SqlCommand();
                sqlcomm.Parameters.Add(new SqlParameter("@Upload", SqlDbType.VarBinary)).Value = bytes;

                dt = sFunctions.ExecuteQuery(Variables.con, "Quotation_Master", "usp_Quotation_Master " + Id + ",'" + dgvQuotationVouchers.Rows[i].Cells[1].Value + "'," + Variables.sTendercode + "," + txtIndentNo.Text + ",'" + dgvQuotationVouchers.Rows[i].Cells[3].Value + "','" + dgvQuotationVouchers.Rows[i].Cells[4].Value + "','" + dgvQuotationVouchers.Rows[i].Cells[1].Value + "','" + dgvQuotationVouchers.Rows[i].Cells[5].Value + "'," + + ",'" + Variables.LocationId + "'," + false + ",'" + Variables.Layer + "'," + rbtnLocal.Checked + "," + rbtnGlobal.Checked + "," + false + "");
                }
            }
             MessageBox.Show("BYTE_DATA>>\n"+bytestring);
       }


A: You have 2 SqlCommand objects in your code.. And none has the command text property set..
You should have something like this instead:
SqlParameter fileP = new SqlParameter("@Upload", SqlDbType.VarBinary);
fileP.Value = bytes; //Here, you're assigning the value to the parameter.
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = someSqlConnection;
myCommand.CommandText = "YOUR UPDATE STATEMENT";
myCommand.Parameters.Add(fileP);
myCommand.ExecuteNonQuery();

