sql >> Base de Datos >  >> RDS >> Sqlserver

Recuperar imágenes de la base de datos del servidor sql

este es un ejemplo de Sql Server

        connection.Open();
        SqlCommand command1 = new SqlCommand("select imgfile from myimages where [email protected]", connection);
        SqlParameter myparam = command1.Parameters.Add("@param", SqlDbType.NVarChar, 30);
        myparam.Value = txtimgname.Text;
        byte[] img = (byte[])command1.ExecuteScalar();
        MemoryStream str = new MemoryStream();
        str.Write(img, 0, img.Length);
        Bitmap bit = new Bitmap(str);
        connection.Close();

mire aquí http://www.akadia.com/services/dotnet_read_write_blob.html