|
in aspx page add itemtemplet
|
|
|
|
|
I am tring to view an image from the SQL server, this is the error msg I get. Please help
this is my code:
string strSQL = "SELECT * FROM tblViewImage WHERE (ImageNumner= 1093414)";
SqlCommand cmd = new SqlCommand(strSQL, conn);
conn.Open();
SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
{
Response.ContentType = dr["ImageType"].ToString();
Response.BinaryWrite((byte[])dr["ViewImage"]);
}
|
|
|
|
|
Have you checked to see what the ImageType is ? You really have a column called ImageNumner ? Why are you hard coding the number ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
The image type is a image/pjpeg. I tried this too and it did not work.
Response.ContentType = dr["ImageType"].ToString();
Response.Expires = 0;
Response.Buffer = true;
Response.Clear();
Response.OutputStream.Write((byte[])dr["ViewImage"], 0, Convert.ToInt32(dr["ImageSize"].ToString()));
Response.End();
|
|
|
|
|
Anita_Kamat_inds wrote: Convert.ToInt32(dr["ImageSize"].ToString()));
Wow - that makes sense.
Did you try writing the bytes to the file system and seeing if they are really a jpeg ? Have you tried more than one image from your DB ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I'm trying to get the AJAX timer control to work. There is a very simple example of this found here:
http://www.asp.net/ajax/documentation/live/tutorials/IntroToTimerControl.aspx
I followed the example yet the timer event never fires. What am I missing?
I'm using VS2005.
|
|
|
|
|
Your code is broken ? Is there a download with the sample, and if so, have you tried that ?
Why do people need the AJAX library just to put a timer in their pages ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I do not want to use AJAX. How can a incorperate a timer on a page without AJAX?
Please refer to the link in the orginal question for the sample code.
|
|
|
|
|
AJAX is just javascript. AJAX exists without the stupid Microsoft AJAX toolkit. There is only one way to have a timer on a page - with javascript. The AJAX toolkit is just wrapping a very basic web dev task for you.
[^]
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks for that info. Can you point to a javascript timer example?
|
|
|
|
|
The ^ in my post is a link. Sorry, I dunno what happened, I just pasted and CP auto formatted, I must have hit space or something, I expected you'd see the URL as well as the ^ for a new window.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: Why do people need the AJAX library just to put a timer in their pages ?
Did I miss the CP announcement that today was Rhetorical Question Day?
The answer is that AJAX solves everything. One day it will discover the body of Jimmy Hoffa. I believe it will be found on an as yet undiscovered computing cloud.
|
|
|
|
|
led mike wrote: The answer is that AJAX solves everything. One day it will discover the body of Jimmy Hoffa
ROTFL !!!
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
|
I have generated dynamic database table in
which the colums will vary as per the selection
by the end user. Now, if my table name is car which
i have generated dynamically on the button save click
event it will have its colums like: colour, gears etc.
So can i generate a dynamic form by taking the cars id
and its column name as the textbox controls on the new
form. The new generated form will also have the basic
funtionality of add, edit,delete etc. If my table is car
then to generate dynamically car.aspx form or if table
is computer then
computer.aspx should be generated.
|
|
|
|
|
Sounds messy to me. I'd think you want to rewrite the URL, and have a common page that gets pointed to at the end of the day.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi
I have been scratching my head on this for days, but getting no where!
Using visual basic and a sqldatasource for my gridview, I need change the colour of a gridview row backcolour plus set a hidden checkbox to checked when the user clicks on an image button. I also need to grab a field value from a row in the gridview.
Now, everything works when I am on the first page, but when I page to the next page I get the following error message "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index".
My image buttons are connected to an onrowcommand in the gridview tag, which checks to see which image button has been called, gets the row number and then calls the appropriate method for that button.
Does anyone have a solution to set a hidden checkbox over a number of pages, grab a field value from the gridview and change the row back colour?
Thanks
|
|
|
|
|
If it works only on the first page, I guess you should post some code so we can look at it.
I'd never use a SQLDataSource tho, that stuff blows.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi
I have managed to crack the problem in so far by adding an onclick event to the image button, but if I page back the grid is refreshed and in turn the rows that have been clicked upon are changed back. Therefore, slightly modified question - how do you maintain those rows with post back?
Thanks
|
|
|
|
|
You need to store the selected page somewhere ( on the URL perhaps ) so you load the correct page when you do a postback.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Sorry, can you explain to me how you would this? I am not clear on what you mean.
|
|
|
|
|
Ideally, the control does no paging and you just pass it the data for the selected page. But, either way, however you get the data for page 2, say, what is needed is to store the selected page number so you can select that data on your postback. Perhaps a better idea is to look at the code that does the selecting, and just keep the data you had before, which will be in viewstate./
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi
I am developing a website using Visual Basic and NetFramework 3.5, and for my gridview I would to have a custom sort.
What I am looking for to control the sort on the columns. Therefore, if a user clicks on a column and puts into order, and then clicks another column, then the first column should remain in the sort order it was put by the user. However, I need to repeat this pattern over at least 3 columns.
Can anyone help me, please? I have tried every where for an answer.
|
|
|
|
|
Hi,
I have one application. I want to call method in that page again and again while Records are deleted. There are near about 10000 records in that table.
OR should I use multiple threading if yes then how can I write.
Thanks
sjs
|
|
|
|