Click here to Skip to main content
15,913,199 members
Home / Discussions / C#
   

C#

 
GeneralRe: Print Message that is printed in Windows Service Application Pin
Abdul Rahman Hamidy7-Mar-10 17:24
Abdul Rahman Hamidy7-Mar-10 17:24 
QuestionAssembling bytes to an image Pin
Wamuti6-Mar-10 23:18
Wamuti6-Mar-10 23:18 
AnswerRe: Assembling bytes to an image Pin
OriginalGriff6-Mar-10 23:48
mveOriginalGriff6-Mar-10 23:48 
GeneralRe: Assembling bytes to an image Pin
Wamuti6-Mar-10 23:55
Wamuti6-Mar-10 23:55 
GeneralRe: Assembling bytes to an image Pin
OriginalGriff7-Mar-10 0:52
mveOriginalGriff7-Mar-10 0:52 
AnswerRe: Assembling bytes to an image Pin
dan!sh 6-Mar-10 23:49
professional dan!sh 6-Mar-10 23:49 
GeneralRe: Assembling bytes to an image Pin
Wamuti6-Mar-10 23:58
Wamuti6-Mar-10 23:58 
AnswerRe: Assembling bytes to an image Pin
DX Roster7-Mar-10 20:17
DX Roster7-Mar-10 20:17 
try following code:


private void Button2_Click(object sender, System.EventArgs e)
{
connection.Open();
SqlCommand command1 = new SqlCommand("select imgfile from myimages where imgname=@param", 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);
Response.ContentType = "image/jpeg";//or you can select your imagetype from database or directly write it here
bit.Save(Response.OutputStream, ImageFormat.Jpeg);
connection.Close();
}


change your database name, field name, image name, attribute name.

If You Get your answer then please Rating me...

Thanks..
"Are You Ready"
DX-ARMY
QuestionCreating Custom Encoding Pin
Xmen Real 6-Mar-10 19:08
professional Xmen Real 6-Mar-10 19:08 
AnswerRe: Creating Custom Encoding Pin
OriginalGriff6-Mar-10 21:45
mveOriginalGriff6-Mar-10 21:45 
GeneralRe: Creating Custom Encoding Pin
Xmen Real 6-Mar-10 22:32
professional Xmen Real 6-Mar-10 22:32 
GeneralRe: Creating Custom Encoding Pin
harold aptroot6-Mar-10 22:38
harold aptroot6-Mar-10 22:38 
GeneralRe: Creating Custom Encoding Pin
Xmen Real 6-Mar-10 22:41
professional Xmen Real 6-Mar-10 22:41 
GeneralRe: Creating Custom Encoding Pin
harold aptroot6-Mar-10 22:53
harold aptroot6-Mar-10 22:53 
GeneralRe: Creating Custom Encoding Pin
OriginalGriff6-Mar-10 22:47
mveOriginalGriff6-Mar-10 22:47 
GeneralRe: Creating Custom Encoding Pin
Xmen Real 6-Mar-10 22:51
professional Xmen Real 6-Mar-10 22:51 
GeneralRe: Creating Custom Encoding Pin
harold aptroot6-Mar-10 22:54
harold aptroot6-Mar-10 22:54 
GeneralRe: Creating Custom Encoding Pin
Xmen Real 6-Mar-10 22:57
professional Xmen Real 6-Mar-10 22:57 
GeneralRe: Creating Custom Encoding Pin
harold aptroot6-Mar-10 22:59
harold aptroot6-Mar-10 22:59 
GeneralRe: Creating Custom Encoding Pin
Xmen Real 6-Mar-10 23:45
professional Xmen Real 6-Mar-10 23:45 
GeneralRe: Creating Custom Encoding Pin
OriginalGriff6-Mar-10 22:57
mveOriginalGriff6-Mar-10 22:57 
GeneralRe: Creating Custom Encoding Pin
Xmen Real 6-Mar-10 23:45
professional Xmen Real 6-Mar-10 23:45 
Questionchange the cell type of a datagrid view in runtime Pin
TAFIN6-Mar-10 18:52
TAFIN6-Mar-10 18:52 
Questionstopping a waitcallback in a threadpool Pin
Jason Jerome6-Mar-10 12:18
Jason Jerome6-Mar-10 12:18 
AnswerRe: stopping a waitcallback in a threadpool Pin
Luc Pattyn6-Mar-10 16:25
sitebuilderLuc Pattyn6-Mar-10 16:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.