Click here to Skip to main content
15,924,901 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionaspnet_wp and IBM Websphere MQ Pin
lijukv28-Nov-06 22:41
lijukv28-Nov-06 22:41 
AnswerRe: aspnet_wp and IBM Websphere MQ Pin
lijukv29-Nov-06 2:34
lijukv29-Nov-06 2:34 
QuestionColimns in Datagrid Pin
monika_vasvani28-Nov-06 22:39
monika_vasvani28-Nov-06 22:39 
AnswerRe: Colimns in Datagrid Pin
thomas_joyee28-Nov-06 23:05
thomas_joyee28-Nov-06 23:05 
AnswerRe: Colimns in Datagrid Pin
ruparanju29-Nov-06 0:25
ruparanju29-Nov-06 0:25 
QuestionImage Pin
AnhTin28-Nov-06 22:06
AnhTin28-Nov-06 22:06 
AnswerRe: Image Pin
Guffa29-Nov-06 0:04
Guffa29-Nov-06 0:04 
GeneralRe: Image Pin
Sandeep Akhare29-Nov-06 0:57
Sandeep Akhare29-Nov-06 0:57 
HI
If you want to get the image from the database which is in the bytes and want to show on aspx page in image control ok
then you can do that what you have to do is first get the image from the database and store it in some temporary folder with extension jpg for that you have to do some conversion look at the code below
System.Drawing.Image newImage;
SqlConnection conn = null;
SqlCommand cmd = null;
DataSet ds = new DataSet();
SqlParameter UserNamedb = null;
SqlParameter AlbumNamedb = null;

conn = new SqlConnection(ConnectionString);


conn.Open();

cmd = new SqlCommand("GetAlbum", conn);
cmd.CommandType = CommandType.StoredProcedure;

UserNamedb = new SqlParameter("@UserName", SqlDbType.VarChar);
UserNamedb.Value = "SandeepAkhare";
cmd.Parameters.Add(UserNamedb);


AlbumNamedb = new SqlParameter("@AlbumName", SqlDbType.VarChar);
AlbumNamedb.Value = "ccccccccccccc";
cmd.Parameters.Add(AlbumNamedb);


SqlDataAdapter ad = new SqlDataAdapter(cmd);
ad.Fill(ds);
conn.Close();

string path = @"c:\AlbumFromdatabase" + "\\" + "SandeepAkhare";
Directory.CreateDirectory(path);



foreach (DataRow dr in ds.Tables[0].Rows)
{
Byte[] imageData = (byte[])dr[0];
string FilaName = dr[1].ToString();
using (MemoryStream ms = new MemoryStream(imageData, 0, imageData.Length))
{

ms.Write(imageData, 0, imageData.Length);

// newImage = Image.FromStream(ms, true);
Bitmap bm = new Bitmap(new MemoryStream(imageData));
newImage = bm;
newImage.Save(path + "\\" + FilaName);

}

}

GeneralRe: Image Pin
Guffa29-Nov-06 1:18
Guffa29-Nov-06 1:18 
GeneralRe: Image Pin
AnhTin29-Nov-06 15:13
AnhTin29-Nov-06 15:13 
QuestionHow can i validate a checkbox control? Pin
just3ala228-Nov-06 20:58
just3ala228-Nov-06 20:58 
AnswerRe: How can i validate a checkbox control? Pin
thomas_joyee28-Nov-06 21:32
thomas_joyee28-Nov-06 21:32 
QuestionRe: How can i validate a checkbox control? Pin
just3ala228-Nov-06 21:43
just3ala228-Nov-06 21:43 
AnswerRe: How can i validate a checkbox control? Pin
needhelpinnet28-Nov-06 21:50
needhelpinnet28-Nov-06 21:50 
AnswerRe: How can i validate a checkbox control? Pin
just3ala228-Nov-06 22:04
just3ala228-Nov-06 22:04 
QuestionWeb service authentication Pin
Poovarasan Dharmalingam28-Nov-06 20:56
Poovarasan Dharmalingam28-Nov-06 20:56 
QuestionDropDownList Pin
aaraaayen28-Nov-06 20:54
aaraaayen28-Nov-06 20:54 
AnswerRe: DropDownList Pin
albCode28-Nov-06 21:47
albCode28-Nov-06 21:47 
GeneralRe: DropDownList Pin
aaraaayen28-Nov-06 22:42
aaraaayen28-Nov-06 22:42 
AnswerRe: DropDownList Pin
Imran Khan Pathan29-Nov-06 0:46
Imran Khan Pathan29-Nov-06 0:46 
QuestionWhy __VIEWSTATE comes in querystring? Pin
RSArockiam28-Nov-06 19:58
RSArockiam28-Nov-06 19:58 
AnswerRe: Why __VIEWSTATE comes in querystring? Pin
Eduard Keilholz28-Nov-06 20:34
Eduard Keilholz28-Nov-06 20:34 
GeneralRe: Why __VIEWSTATE comes in querystring? Pin
RSArockiam28-Nov-06 22:49
RSArockiam28-Nov-06 22:49 
AnswerRe: Why __VIEWSTATE comes in querystring? Pin
Guffa28-Nov-06 21:10
Guffa28-Nov-06 21:10 
QuestionHow to delete a row from datagrid using check box Pin
ravindradonkada28-Nov-06 19:46
ravindradonkada28-Nov-06 19:46 

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.