Author: Jackxxx | Posted on: 9/8/2010 7:39:43 PM | Views : 310

The following code pulls data from a table writes it to a csv file and then prompts a user to open or save the file.
What I need to do is pull the data to the csv file and send it to a predetermined email address, without prompting the user or saving it.
How can I do this?
Dim MySQL As String = "" MySQL = "SELECT TOP 1 * FROM [tblSurvey] ORDER BY SurveyID DESC" Dim MyConn As New SqlConnection(ConnectStr) Dim cmd As New SqlCommand _ (MySQL, MyConn) 'Set the appropriate ContentType. Dim filename As String = "Data_" & txtName.Text & "_" & System.DateTime.Now & ".txt" cmd.CommandType = CommandType.Text cmd.Connection.Open() Dim myReader As SqlDataReader = _ cmd.ExecuteReader _ (CommandBehavior.Clos ...

Go to the complete details ...