Click here to Skip to main content
15,900,907 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionERROR:The test form is only available for requests from the local machine Pin
Sebastian T Xavier11-Jul-07 3:31
Sebastian T Xavier11-Jul-07 3:31 
AnswerRe: ERROR:The test form is only available for requests from the local machine Pin
Vasudevan Deepak Kumar11-Jul-07 3:44
Vasudevan Deepak Kumar11-Jul-07 3:44 
GeneralRe: ERROR:The test form is only available for requests from the local machine Pin
Sebastian T Xavier11-Jul-07 3:55
Sebastian T Xavier11-Jul-07 3:55 
QuestionExport a table to a csv Pin
Senseicads11-Jul-07 3:10
Senseicads11-Jul-07 3:10 
AnswerRe: Export a table to a csv Pin
Vasudevan Deepak Kumar11-Jul-07 3:24
Vasudevan Deepak Kumar11-Jul-07 3:24 
GeneralRe: Export a table to a csv Pin
Senseicads11-Jul-07 4:02
Senseicads11-Jul-07 4:02 
GeneralRe: Export a table to a csv Pin
ednrgc11-Jul-07 5:29
ednrgc11-Jul-07 5:29 
GeneralRe: Export a table to a csv Pin
Senseicads11-Jul-07 5:36
Senseicads11-Jul-07 5:36 
yeah I can do all that I can put the csv file using streamwriter...i just need to know where to put the file that streamwriter creates and how do i access it!

At the moment I am attempting to place the file on the server and then redirect the browser to the file name. This isn't working for me yet however, and I am not sure that this is even the best way to do it. I was asking which is the best way.

Here is my code, so you can see where I am currently coming from, it don't work like but it should give you an idea as to where i am coming from. But don't forget I am enquiring about best practices here, not how to fix this specific bit of code.

  Protected Sub btExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btExport.Click<br />
<br />
        Dim datTable As DataTable = gvReport.DataSource<br />
<br />
        ' Create a directory for the file to be stored on the server<br />
        ' Check whether a directory exists in the first place. If not create it.<br />
        If Not Directory.Exists(Server.MapPath("CSV")) Then<br />
            Directory.CreateDirectory(Server.MapPath("CSV"))<br />
        End If<br />
<br />
        ' Create a unique identifier.<br />
        Dim strFileName As String<br />
        strFileName = Server.MapPath("CSV") & "\" & GetTempName()<br />
<br />
        Dim objStreamWriter As StreamWriter<br />
        objStreamWriter = File.AppendText(strFileName)<br />
        ' Code to write the csv file to the writer.<br />
        objStreamWriter.Close()<br />
End Sub



Cheers

Ian
AnswerRe: Export a table to a csv Pin
martin_hughes11-Jul-07 8:59
martin_hughes11-Jul-07 8:59 
GeneralRe: Export a table to a csv Pin
Senseicads12-Jul-07 1:11
Senseicads12-Jul-07 1:11 
Questionhow can v write html tags in asp.net +c# code?? Pin
regin11-Jul-07 2:57
regin11-Jul-07 2:57 
AnswerRe: how can v write html tags in asp.net +c# code?? Pin
gauthee11-Jul-07 3:07
gauthee11-Jul-07 3:07 
AnswerRe: how can v write html tags in asp.net +c# code?? [modified] Pin
N a v a n e e t h11-Jul-07 3:07
N a v a n e e t h11-Jul-07 3:07 
GeneralRe: how can v write html tags in asp.net +c# code?? Pin
regin11-Jul-07 3:16
regin11-Jul-07 3:16 
GeneralRe: how can v write html tags in asp.net +c# code?? Pin
N a v a n e e t h11-Jul-07 3:21
N a v a n e e t h11-Jul-07 3:21 
GeneralRe: how can v write html tags in asp.net +c# code?? Pin
Vasudevan Deepak Kumar11-Jul-07 3:25
Vasudevan Deepak Kumar11-Jul-07 3:25 
QuestionPop Up Window Pin
gauthee11-Jul-07 2:53
gauthee11-Jul-07 2:53 
AnswerRe: Pop Up Window Pin
Vasudevan Deepak Kumar11-Jul-07 3:46
Vasudevan Deepak Kumar11-Jul-07 3:46 
GeneralRe: Pop Up Window Pin
gauthee11-Jul-07 4:00
gauthee11-Jul-07 4:00 
QuestionCSV Field Issue Pin
Brendan Vogt11-Jul-07 2:31
Brendan Vogt11-Jul-07 2:31 
AnswerRe: CSV Field Issue Pin
Christian Graus11-Jul-07 2:34
protectorChristian Graus11-Jul-07 2:34 
GeneralRe: CSV Field Issue Pin
Brendan Vogt11-Jul-07 2:38
Brendan Vogt11-Jul-07 2:38 
GeneralRe: CSV Field Issue Pin
Christian Graus11-Jul-07 2:40
protectorChristian Graus11-Jul-07 2:40 
GeneralRe: CSV Field Issue Pin
Brendan Vogt11-Jul-07 2:45
Brendan Vogt11-Jul-07 2:45 
QuestionAdd LoginStatus control to validation Pin
AvidOn-Tech11-Jul-07 2:25
AvidOn-Tech11-Jul-07 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.