|
Hi,
I didnt come across any such method ? But you can acieve it using this code.
-----------------------------------------------------------------------
string s = "select * from person";
DataSet ds = GetDataSet(s);
GridView1.DataSource = ds;
GridView1.DataBind();
Response.ContentType = "application/ms-excel";
Response.AddHeader("Content- Disposition", "inline;filename=ExcelFile.xls");
------------------------------------------------------------------------
I am not convince with Christian Graus answer.
Excel is optional at Server. But it is required at Client Machine. If it is not installed
at Client Machine, user cannot display the excel file, but he can download.
|
|
|
|
|
The original post said " export it to Excel file(the function that set the width of each field is needed)"
Christian is quite correct, to do this you need Excel installed on the server. What you are proposing is to display the data as Excel in a web page - not the same thing, but a viable work around as long as the fiel does not need writing to the server for some reason.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
|
Reethika wrote: URgently needed
Yeah, I bet.
You can play videos through embedding the windows media control. ASP.NET can't help you.
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 )
|
|
|
|
|
How to identify two colors are similler or not. What make both color as simillar color. How to specify range of color for similler color.
|
|
|
|
|
This question is unlikely to have anything to do with ASP.NET. Did you mean to ask in the C# or VB forums ?
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 )
|
|
|
|
|
Sorry Friend but I am not getting anything.
|
|
|
|
|
hi all,
Can any guide me to send values to stored procedure using paramenters dynamically.
Thanks in advance
Senthil.S
Senthil.S
Software Engineer
|
|
|
|
|
All this time, and you still have no idea how to ask in the right forum ?
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 )
|
|
|
|
|
Hi,
I am using Obout splitter. I want to collapse and expand panel left using java script in to child page. I had written following code for javascript function. I perfectly get the object of splitter and check box, but whenever I click that check box it display error that Error:45 Object doesn't supporting this property or method.
So ,how i remove this error and collapse panel.
function chk_changed()
{
var mySpl1 = window.parent.document.getElementById ('mySpl');
var check = window.document.getElementById('header1_chkenable');
alert(mySpl1);
if (check != null)
{
if (check.Checked() == "true")
mySpl1.CollapsePanel("left");
}
}
|
|
|
|
|
Hi,
I would like to know if it's safe to program a site with members where I use usernames rather than user id in the querystring to retrieve user information from a database.
I see some sites have user ids nad some usernames.
Any response is appreciated.
|
|
|
|
|
Hi,
User Id is obviously prefered and secure choice, because username is understandable to others.
But Whether its Id or Name both must be associated with Password and without the combination of both,access of applicaiton is not possible.
But if i know the username,databasename, and tablename and i have the access of Database server, i can fetch the user information from database.
Same is possible with user Id as well. But its diffcult to guess which Id belong to which User.
Hope this will bring u decide ID or Name.
|
|
|
|
|
Thanks a lot for the useful information. One thing though is that user id is just as visible as a username in the querystring when you for example click on a profile of a certain user. Also assuming that a person have logged in to a certain site how can he possibly retrieve the database name and a table name, and also have an access to a database server? is it easy possible to do or it's extremly difficult to retrieve that?
Thanks again.
|
|
|
|
|
Albert, you are correct, User id is just as visible as a username. But statement ?UserID=1234 or ?UserName='Albert' makes difference in visibility.
For a end user its impossible to retrieve information from database.
All the best for endeavour.
|
|
|
|
|
|
Hi to all,
I am using ajax calendat in my textbox...,
After that textbox one dropdown list box is there...,
Whenever my calendar control getting view the dropdowwnlist over on my calendar control...
I tried all type of css:
These are the css i got from net, those i include eventhough its getting over...,
.ajax__calendar_container { z-index : 1000 ; }
.ajax__calendar {
position: relative;
}
.ajax__calendar iframe {
left: 0px !important;
top: 0px !important;
}
But the control working cool in my ie7 but its giving probs in ie6...,
How do I get the CalendarExtender to show over a dropdown
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
This is a problem with IE. You'll need to use a different control that renders differently to achieve this.
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 )
|
|
|
|
|
It mean what the final solution for this one?,
I am using ajax 3.5, for ie6 broswer how to load another control for that textbox?,
Its not correct solution to solve this
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
In my c# form i have added a Acrobat Reader ActiveX control in runtime. when I added its not appearing in the form.
when i minimize and maximize the control is appear.
How Can I solve this proble
Thanks in Advance
|
|
|
|
|
|
I am creating in run time
modified on Friday, June 20, 2008 6:01 AM
|
|
|
|
|
Hi,
Let me go straight to the point.
I am doing a something like a wizard we use to setup some programs or system. I have 5 pages which all 5 pages is link together with 'Back' and 'Next' button. It was working fine until I tried the Back button and click Next again. I find it some what difficult to detect that the user clicked back and therefore when the user click next again, I suppose to do 'Update' and not 'Add' and also sometimes what the user typed in the form is not there any more.
I'd tried a few solutions such as putting in checks whether the user already entered data by taking the primary key after inserting the data and put into a invincible label, so when the user press back, the system can check the label whether there is any value in it.
I find it a bit tedious to do so, so I decided to come here to seek some expert advice on the best practice to do this - How to Add and Update respectively and keep everything on the page no matter the user click Back and Next how many times.
This is what I did on the Back button
this.btnBack.Attributes.Add("onclick", "javascript:history.back();return false;");
|
|
|
|
|
Is this a ASP.NET question?
If so, what Framework you are using?
If the Framework you are using is 2.0, then ASP.NET is providing with a nice Wizard Control which does all you need.
history.back() will be effect if your page postbacks to the same page.
|
|
|
|
|
Make all the pages controls, and put them on one form, just change which one is visible.
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 )
|
|
|
|