byte[]text= File.ReadAllBytes(this.openFileDialog1.FileName);
SqlConnection con = new SqlConnection("data source=.;initial catalog=demo;user id=sa;pwd=");
SqlCommand comm = new SqlCommand("Insert Into c (s) Values (@Image)", con);
comm.Parameters.Add(new SqlParameter("@Image", text));
con.Open();
comm.ExecuteNonQuery();
con.Close();
string sql = "select s from c";
comm = new SqlCommand(sql, con);
con.Open();
byte[] s = (byte[])comm.ExecuteScalar();
this.textBox1.Text = System.Text.Encoding.Default.GetString(s, 0, s.Length);