|
I am able to save the csv file.
I want to convert the selected row from the gridview, which are selected on the selection of the checkbox of that particular row.
And i want to save the selected records in that CSV file which is getting saved at the specified location
I can do it by bytes of array.
But i don't know the procedure....
|
|
|
|
|
You can do something like this
protected void clientTeamList_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
StreamWriter write = new StreamWriter("c:\temp\test.csv");
for (int i = 0; i < gridTeamUserAccess.Rows[e.NewSelectedIndex].Cells.Count; i++)
{
write.Write(gridTeamUserAccess.Rows[e.NewSelectedIndex].Cells[i].Text + ",");
}
write.Close();
}
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
Thanks for help!
THE PROBLEM IS SOLVED!
|
|
|
|
|
Hello,
I have a default website on a server, Inside the default website I have a virtual directory setup which has a webservice hosted.
When I try to run the webservice in a virtual directory. It throw an error in web.config file item for a default website.
Why is the default website config file called when I am running a webserive URL in the default web site.
How can I resolve this issue?
Regards,
Pavas
|
|
|
|
|
This is how the configurations file works. I think you can override the settings written in root configuration file. Try overriding the section which causes error.
|
|
|
|
|
This means, The virtual directory web.config will not be considered for execution. How can I override them
Actally I have a below statement in website config file
<pages theme="IMF" validaterequest="false" enableeventvalidation="false" />
But the above entry is not there in virtual directory and this cause issue when I run the virtual directory code.
Regards,
Pavas
|
|
|
|
|
Try declaring the same tag in your web.config with a valid theme present in virtual directory.
|
|
|
|
|
ok. Let me check this thanks
Regards,
Pavas
|
|
|
|
|
Can I use the below in the "Default Web Site"
<location allowOverride="false" path="Default Web Site">
<add key="smtpServer" value="smtp.gmail.com"/>
...
</location>
Virtual directory setting:
<location allowOverride="false" path="Default Web Site">
<add key="smtpServer" value="smtp.ourmail.com"/>
...
</location>
But in this case I get the below error:
Parser Error Message: This configuration section cannot be used at this path. This happens when the site administrator has locked access to this
section using <location allowOverride="false"> from an inherited configuration file.
Regards,
Pavas
|
|
|
|
|
Hi all,
I want to upload one large image through one website, while uploading image, the session time is out before image uploaded.
how can i solve this problem.bcz my website session time is fixed.
what to do?
Pls help me.
|
|
|
|
|
ASP.NET has a default file upload size of 4MB. Read this[^] to get an idea about changing it.
|
|
|
|
|
Hi Friends,
I have one doubt,i have a web page which contains company details, in the url i m passing the id value ,when i run my application i m passing the id in the url and then press enter key which displaying the details correctly and now i m updating the details its getting updating
when i press the enter key in the url ,now its not displaying the updated value its getting previous value.
Kindly tell me how to do?
Thanks & Regards
Senthil Kumar
|
|
|
|
|
Hard to tell without seeing any code. Do you have caching ?
|
|
|
|
|
Hi Navaneeth,
Can i send the code?
|
|
|
|
|
hi
just show your both urla first in wchich u r trying to change the value and the original url
Jintal Patel
|
|
|
|
|
|
bhavna816 wrote: I know the openfiledialog available in Windows app.
But I want it in Web app. of ASP.NET2.0
You went out of concept. Take some books and learn how web applications works, and how ASP.NET works. You can't show a open file dialog in a web application. You can use upload control which shows a file select dialog box.
bhavna816 wrote: and save the selected data from the Gridview as CSV format
You need to save the file first on server and redirect user to the location where you saved the file. Alternatively you can add the file to response and set the headers. Check this[^] to get an idea.
|
|
|
|
|
yeah i have done it with these headers.
I am able to save the csv file.
I want to convert the selected row from the gridview, which are selected on the selection of the checkbox of that particular row.
And i want to save the selected records in that CSV file which is getting saved at the specified location
I can do it by bytes of array.
But i don't know the procedure....
|
|
|
|
|
Hmm, you replied to your own message, which you then deleted.
I guess you're not familiar with the finer points of forum etiquette, are you?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I didn't mean that....
If u can see I have replied my message as "I got the solution"
so i deleted the message....
i didn't know that I cannot delete the thread..
Actually i wanted to delete the thread
|
|
|
|
|
salon wrote: If u can see I have replied my message as "I got the solution"
so i deleted the message....
Which goes to prove my point.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
You can add a button to download the data as a CSV and use the response object to write the right headers and data for the user to download the data.
This will create a file dialog for them to select where to save the data.
Christian Graus - Microsoft MVP - C++
"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 populating DropDownList using Data Source, and assigning Value and binding it using following code.
ddlCustomer.DataSource = dsSeedData.Tables["Cust"];
ddlCustomer.DataTextField = dsSeedData.Tables["Cust"].Columns["CustomerName"].ColumnName.ToString();
ddlCustomer.DataValueField = dsSeedData.Tables["Cust"].Columns["Customer_ID"].ColumnName.ToString();
ddlCustomer.DataBind();
When i fetch value, it fetch first value from Dropdown, after click on Save button. After postback it reset all the value. To fetch i m using following code.
object[] param=new object[50];
param[0] = ddlCustomer.SelectedItem.Value;
What should be approach to Solve this problem.
Thanks.
|
|
|
|
|
Make sure you have viewstate turned on.
|
|
|
|
|
Yes, Navaneeth.
ViewState Property is True ( EnableViewState="True").
|
|
|
|