int docId = Convert.ToInt32(Request.QueryString["Id"]);
if (cls.con.State == ConnectionState.Closed)
{
cls.con.Open();
}
SqlCommand cmd = new SqlCommand();
cmd.Connection = cls.con;
cmd.CommandText = "Select * from mail where Id = @Id";
cmd.Parameters.Add("@Id", SqlDbType.Int);
cmd.Parameters[0].Value = docId;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
b = ((byte[])(dr["FileContent"]));
}
cls.con.Close();
Response.BinaryWrite(b);
Response.End();
1 comment:
here class file and database is not available and because of that there's error in connection string. so please upload/provide whole solution.
Post a Comment