Программирование в IIS


Пример 3.3


public class Events : System.Web.Services.WebService

{

//locals to class

private System.Data.SqlClient.SqlConnection myConn;

public Events()

{

//CODEGEN: This call is required by the

//ASP.NET Web Services Designer

InitializeComponent();

System.Configuration.AppSettingsReader

myAppSettings =

new System.Configuration.AppSettingsReader();

//get the connection string from web.config

string sConnect =

((string)

(myAppSettings.GetValue

("ProductionDB.ConnectionString",

typeof(string))));

//make the DB connection

myConn = new System.Data.SqlClient.SqlConnection(sConnect);

}

#region Component Designer generated code

//Required by the Web Services Designer

private IContainer components = null;

///

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

///

private void InitializeComponent()

{

}

///

/// Clean up any resources being used.

///

protected override void Dispose( bool disposing )

{

if(disposing && components != null)

{

components.Dispose();

}

base.Dispose(disposing);

}

#endregion

}




- Начало -  - Назад -  - Вперед -



Книжный магазин