|
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Threading;
namespace Hosca.SQLExcelMail
{
/// <summary>
/// Summary description for Service1.
/// </summary>
[WebService(Namespace="http://www.hosca.com/webservices/SQLExcelMail")]
public class SQLExcelMail : System.Web.Services.WebService
{
public SQLExcelMail()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}
#region Component Designer generated code
//Required by the Web Services Designer
private IContainer components = null;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion
[WebMethod]
public void SendQueryResultsAsSpreadSheet(string ConnectString, string SQLQuery, string EmailAddress)
{
// create our worker class
ExcelQueryProcessor eqp = new ExcelQueryProcessor(ConnectString,SQLQuery,EmailAddress);
// queue it
ThreadPool.QueueUserWorkItem(new WaitCallback(ProcessRequest),eqp);
}
private void ProcessRequest(Object stateInfo) {
// cast stateInfo back to an ExcelQueryProcessor
ExcelQueryProcessor eqp = (ExcelQueryProcessor)stateInfo;
// off we go ...
eqp.GenerateExcelSheet();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.