|
in my app, i want to retrieve images from database for different users currently i m doing this with filestream but it not working properly so if there any other idea plz help me.[i m using c#]
|
|
|
|
|
If you're using C#, you are probably using ASP.NET, although it sounds like a general C# question to me.
What do you mean by 'not working properly' ? Obviously, there's no reason for it not to work if it's done right. If you explain your approach, and show some code, perhaps we can help.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi
thanx for response
here my code:
string strconapprove = ConfigurationSettings.AppSettings["connection"].ToString();
string strcmdapprove = "select * from coc_prayer_request_pending where ID='" + idi + "'";
SqlConnection conapprove = new SqlConnection(strconapprove);
conapprove.Open();
SqlCommand cmdapprove = new SqlCommand(strcmdapprove, conapprove);
SqlDataReader rd;
rd = cmdapprove.ExecuteReader();
if (rd.Read())
{
//picture#1:
string root = Server.MapPath("~");
try
{
byte[] barrImg1 = (byte[])rd.GetValue(rd.GetOrdinal("Picture"));
string strfn1 = root + @"\iimage\" + rd.GetValue(rd.GetOrdinal("Picture")).ToString() + ""+idi+".gif";
FileStream fs1 = new FileStream(strfn1, FileMode.Create, FileAccess.Write);
fs1.Write(barrImg1, 0, barrImg1.Length);
fs1.Flush();
string strpath1 = "~/iimage/" + rd.GetValue(rd.GetOrdinal("Picture")).ToString() +""+idi+ ".gif";
//thumbnail #1
if (fs1.Length != 0)
{
h1.Visible = true;
System.Drawing.Image img1 = System.Drawing.Image.FromFile(Server.MapPath(strpath1));
System.Drawing.Image thumbnailImage1 = img1.GetThumbnailImage(50, 50, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallBack), IntPtr.Zero);
MemoryStream imageStream1 = new MemoryStream();
thumbnailImage1.Save(Server.MapPath("~/image/thumb"+idi+".gif"), System.Drawing.Imaging.ImageFormat.Gif);
byte[] imageContant1 = new byte[imageStream1.Length];
Response.Clear();
h1.ImageUrl = "~/image/thumb"+idi+".gif";
h1.NavigateUrl = "show_picture.aspx?id=" + idi + "&type=pp&name=prayer&profile=aapprove";
fs1.Close();
}
else
{
h1.Visible = false;
}
fs1.Dispose();
}
catch (Exception ex)
{
h1.Visible = false;
}
conapprove.Close();
//problem is that some times it gives the error of GDI.
or outOf memory.
|
|
|
|
|
What's the error ? One possibility is that you never dispose of your resources, and if you open an image you opened before and has not been garbage collected, the file could still be locked.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
This could be the problem, although I don't know what your path and file names are:
string strfn1 = root + @"\iimage\" + rd.GetValue(rd.GetOrdinal("Picture")).ToString() + ""+idi+".gif";
string strfn1 = root + @"\image\" + rd.GetValue(rd.GetOrdinal("Picture")).ToString() + ""+idi+".gif";
You spelt image as iimage. All other places in code you spelt it correctly.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
code is not a problem frnd. that's a folder and i think folder's name does't make a problem
|
|
|
|
|
I was just double checking. What is the error you are recieving, you never specified that.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
hi,
i want to replace the message [Java Applcation]from the confirm box.
i have implmented a confirmation on a button click as shown below.
Button1.Attributes.Add("onClick","return confirm(Do you want to quit?')");
Its working but im not able to edit the title of the popup window. If anyone have any idea or any alternative method than this..pls help me.
Thanks in advance
arun
|
|
|
|
|
arun rajappan wrote: any alternative method than this..pls help me.
As an alternative you could use a popup window in place of the confirm dialog.
|
|
|
|
|
Hi,
How can i provide reference path for a web application, I know that web app can get the references from Bin and GAC,but can i provide path other than BIN and GAC.
Warm Regards,
Mushq
|
|
|
|
|
If you have a special path you need to use perhaps you should consider putting it in the web.config file? You could put it in appSettings.
Ben
|
|
|
|
|
Thanks for the reply Yes I found the appSettings in web.config file
can you please tell more about it that what should i insert inside AppSetting tag, so that special folder can be used for references.
Best Regards,
Mushq
|
|
|
|
|
You put an entry like this:
<add key="FileDirectory" value="c:\order\Working" />
And access it like this:
In .net 1.1 it looks like this.
string val = System.Configuration.ConfigurationSettings.AppSettings["FileDirectory"];
It is a little different for .net 2.0
Let me know if you need to know how that looks.
Ben
|
|
|
|
|
Hi all,
I built a website by asp.net, and now i want to test it's performance when many users access it.
And i know i must use a tool called "Thread test" to test performance. But i don't know where to download "thread test" tool.
Please give me a link to download "thread test" tool or some guide to test it's performance.
|
|
|
|
|
ctlqt12 wrote: "Thread test"
or stress test tool...???
<< >>
|
|
|
|
|
Hi Guys,
I have a problem. I develop my asp.net website under windows xp using visual web developer 2005. When browsing the website from Mac safari, mac firefox, mac E52, the images are all displayed and some letters were gone.
I hope you can help me if what do I need to add in order for me to avoid re-coding everything to java.
Thanks in advance Guys
hifiger2004
|
|
|
|
|
hifiger2004 wrote: avoid re-coding everything to java.
Well, that would be silly.
Look at the HTML being generated, see if you've got characters that are not being sent to safari, or if you have CSS issues, or whatever.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christ,
Yes you're right re-coding is really big job to do.
I made sa sample website that will simulate my problem.
Try accessing my sample site http://cvd.harnesstheweb.com.
Try accessing it thur IE6 or IE7 they have the same result, and that's fine.
But when accessing it thru mozilla firefox you will noticed here that the yellow stripe on the header image is gone.
I simulate it using mozilla firefox, because it says that safari, firefox and IE5 is at the same level of the browser used in mac machine.
My problem is I don't know if how to resolve this problem.
I hope you can help me with this.
Thanks
hifiger2004
|
|
|
|
|
|
Hi Jimmy,
Thanks for the information.
I am actually made some adjustment on my asp.net code because I have found out that there are some colors in clone pc that doesn't recognize by mac. And in this case, instead of re-coding everything, I only made some modifications on the colors. And I am using now the universal color combinations that gives the same result to any browser including mac. So working fine now when I'm running it thur firefox, the yellow stripe below is now displaying.
And also I have just read an article about the new framework that soon to be released this year. It's about the WPF/E. And the good thing about it is that, it will work for both clone pc and mac.
Thanks Jim
hifiger2004
|
|
|
|
|
Hi all,
Did any one come across displaying custom tool box on a webpage in asp.net ?
Example: just like we have toolbox visual studio 2005 where we can drag controls on designer page.
We need similar functionality to do on a webpage where we have to create a user controls and these user controls has to be populated on a toolbox inturn users will drag and drop those controls on a certain location on a webpage.
How cane we handle this situation on a webpage? Is it through AJAX?
Please help me in putting down your ideas here. Appreciate your help on this.
Krishna
From DE
|
|
|
|
|
Its sounds to me like you want something similar to the WebParts framework. Although I don't care for it much myself you might have a look at that.
|
|
|
|
|
hmm not exactly webparts! because at the same time we need to handle control resizing as well. What if we need to place many controls over the webparts. Can it handle ?
|
|
|
|
|
Hello all,
I m using 12 SP, 7 include files in a ASP file.
Now problem is that, that page is not opening or its takeing 2much time to open & some times my server shows 100% CPU usage.
What should i do to make it fast??????
Thanks,
Ankur Bakliwal
|
|
|
|
|
It is unlikely to be the includes - I often have ten or more.
Can you add timing code around the stored procedure calls to confirm how long each one takes?
|
|
|
|