|
как извлечь фото из поле IMAGE и вставить в picturebox?
|
|||
---|---|---|---|
#18+
Создал таблицу с полем IMAGE для хранения фоток. Фотки вставляю через запрос INSERT . Image img = pictureBox1.Image; MemoryStream stream = new MemoryStream(); img.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] data = stream.GetBuffer(); con = new SqlConnection("Server=KKK\\KKKSERVER; Integrated Security=SSPI; Database=NISIKR"); con.Open(); SqlParameter p = new SqlParameter("@img", SqlDbType.Image); p.Value = data; string s = @"insert into fio(photo)values(@img)"; SqlCommand comm = new SqlCommand(s,con); comm.Parameters.Add(p); comm.ExecuteNonQuery(); con.Close(); Написал запрос для извлечение фотки. Где условия while Не знаю что писать? ВОПРОС как извлечь из БД фотки ? И как вставит в pictureBox1 извлеченный фото ПОМОГИТЕ ПОЖАЛУЙСТА? con = new SqlConnection("Server=KKK\\KKKSERVER; Integrated Security=SSPI; Database=NISIKR"); con.Open(); string s = @"select photo from fio where id_fio=4"; SqlCommand comm = new SqlCommand(s, con); comm.ExecuteNonQuery(); while (dr.Read()) { ВОТ СЮДА ЧТО ПИСАТ Я НЕЗНАЮ! ПОМОГИТЕ } con.Close(); ... |
|||
:
Нравится:
Не нравится:
|
|||
26.06.2011, 18:24 |
|
как извлечь фото из поле IMAGE и вставить в picturebox?
|
|||
---|---|---|---|
#18+
Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12.
... |
|||
:
Нравится:
Не нравится:
|
|||
28.06.2011, 07:01 |
|
|
start [/forum/topic.php?fid=17&fpage=43&tid=1350716]: |
0ms |
get settings: |
11ms |
get forum list: |
12ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
38ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
32ms |
get tp. blocked users: |
2ms |
others: | 296ms |
total: | 414ms |
0 / 0 |