|
thankx a lot....
any example ?????
Koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
|
thankx
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
hai,
currently i m using asp.net with c# (.net 2005, 2.0 framework)
i have stored a image to my database (sql server 2000) and want to retrive it and display in a image control.
i use the below code..
using (BinaryReader reader = new BinaryReader(BrowseImg.PostedFile.InputStream))
{
byte[] image = reader.ReadBytes(BrowseImg.PostedFile.ContentLength);
conn.Open();
cmd = new SqlCommand("INSERT INTO tbl_test(my_image) VALUES (@Photo)",conn);
cmd.Parameters.AddWithValue("@Photo", image);
rowsAffected = MyLib.cmd.ExecuteNonQuery();
conn.Close();
} - FOR insert image into database
Response.Clear();
Response.ContentType = "image/jpeg";
Image image = null;
conn.Open();
cmd = new SqlCommand ("SELECT my_image from tbl_test",MyLib.conn);
byte[] imageData = (byte[])MyLib.cmd.ExecuteScalar();
MemoryStream memStream = new MemoryStream(imageData);
image = Image.FromStream(memStream);
image.Save(Response.OutputStream, ImageFormat.Jpeg); - for display image
but its displaying in my page itself... i need to display on an image control or in some control..
how to implement this? - KARAN
|
|
|
|
|
You need to write a HTTP handler that takes on the URL an ID that tells it what image to load and send back. Then you use IMG tags that have that URL as their src
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
this coding i got from google....
can u provide the exact code to fulfil my process?
|
|
|
|
|
Dude ..
byte[] photo = (byte[])dr[0];
MemoryStream ms = new MemoryStream(photo);
//Image im = new Image();
//Icon.ImageUrl =
Bitmap bt = new Bitmap(ms);
....> Response.OutputStream.Write(photo, 0, photo.Length);
here dr is a data row
take a aspx page ... in that write this code
Now to the image control add the image url as the aspx page
This will work
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
thanks for u r coding krazy... but i m getting error Invalid attempt to read when no data is present.
my code:
conn.Open();
cmd = new SqlCommand("SELECT my_image from test123",conn);
dr = cmd.ExecuteReader();
byte[] photo = (byte[])dr[0];
MemoryStream ms = new MemoryStream(photo);
Bitmap bt = new Bitmap(ms);
Response.OutputStream.Write(photo, 0, photo.Length);
|
|
|
|
|
Not sure what the other dude gave you, looks like a mess to me.
You write a HTTP handler, and it does the response.binarywrite. I'm sure there are examples here on CP
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks for u r reply chris...
can i get a sample coding atleast?
since i m not familiar with http process and imaging
|
|
|
|
|
http://www.codeproject.com/KB/web-image/thumbnailer.aspx[^]
seems like a place to start.
But, it's really as simple as placing the code you have, in a HTTP handler, and doing what I said.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
|
i am using the following code in page load event
<br />
dim CurrentPageURL<br />
<br />
CurrentPageURL= Request.UrlReferrer.ToString()<br />
is it correct?
|
|
|
|
|
Trial and Error?
Response.Write("URL I'm Testing: " + CurrentPageURL);
-= Reelix =-
|
|
|
|
|
Hello Friends
i m working on gridview.
my gridview is consist of two dropdown and six textbox in a row.
now at runtime i want to disabled 1 column textboxes.
how can i do that..
if anybody knows pls respond...
thanks
|
|
|
|
|
Hi Ankit,
what do you mean by disable the grid view? by default all the cell are readonly. only the time of editing in grid view all the text box will become editable.
so do you need it at the time of edit of grid view or what ?
please clear .
Thanks !!!!
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
hi Abhijit
actually my gridview is not binded with any data
it is blank.
and at runtime the textbox of one column i want to disabled..
how can i do it.
the gridview i m using is for the getting data to fed up into database.
any idea
thanks
|
|
|
|
|
you can get the control using FindControls() methods.
try to find the control of rows like
textbox t= (textbox)gridviewRow.findControl("txtbox1");
t.Enabled=flase.
kinldy check the syntax . This the way that you can acheive.....
Good luck....
let me know when done
Thanks !!!!
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
hi Abhijit
thanks
u Have given right answer to my question it is working..
thanks again
|
|
|
|
|
you are welcome !!!
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
hai,
currently i m using asp.net with c# (.net 2005, 2.0 framework)
here i would like to display the records which is fetched from database (in gridview).
while user update a particular record, the columns which is affected should be shown in a different color in gridview.
how to achieve it?
for example,
consider the below as Columns and values in a table (sql server 2000)
rollno:1
name:codeproject
site:www.codeproject.com
status:famous
and after user updation the above record changed as...
rollno:1
name:codeproject
site:www.codeproject.com
status:too famous
The gridview should display all values and the "too famous" should have a different background (since its updated) (this process will continue for many values)
how to achieve this? - KARAN
Note : the update and gridview are in separate page.
|
|
|
|
|
I have set up a virtual directory on ISS 6.0 to store the all .jpg and .swf
files which i use in my project
It is alias name is "OutSrc"
Is it possible to acquire a list of files which exist in that virtual
directory ?
For my default project directory, i can get list of the specific files like
that;
*******************
DirectoryInfo drc = new DirectoryInfo("~/banners");
FileInfo[] FileLst = drc.GetFiles("*.swf");
*******************
But, how about for the virtaul directory, Is there a way to do this?
Thanks,
N/A
|
|
|
|
|
you can use the HttpContext.Current.Server.MapPath("~/banners") to get the physical directory.
|
|
|
|
|
try to find the files from the physical location.
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|