1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
//Déclaration Using Sql.
using System.Data.SqlClient;
public partial class sql_connect : System.Web.UI.Page
{
//Déclaration Connection Sql.
private System.Data.SqlClient.SqlConnection sqlConnect;
public System.Data.SqlClient.SqlConnection SqlConnect
{
get { return sqlConnect; }
set { sqlConnect = value; }
}
private System.Data.SqlClient.SqlCommand sqlCde;
public System.Data.SqlClient.SqlCommand SqlCde
{
get { return sqlCde; }
set { sqlCde = value; }
}
#region Méthodes Connection Sql.
#region Initialisation Connection SQL à la base.
public void SqlChaineCo()
{
sqlConnect = new SqlConnection();
string strCnx = "Server=PC0018\\SQL2005;Database=DB_ETG;Trusted_Connection=True;MultipleActiveresultSets = True"; //failover partner = ???
sqlConnect.ConnectionString = strCnx;
}
#endregion
#endregion
#region Load
protected void Page_Load(object sender, EventArgs e)
{
}
#endregion
} |
Partager