using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace Taller_1_Sql
{
class Conexion
{
protected SqlConnection cnn;
protected void conectar()
{
try
{
cnn = new SqlConnection(@"data source=NOMBRE SERVIDOR;initial catalog=BASEDEDATOS;integrated security = true;");
cnn.Open();
}
catch (Exception ex)
{
throw ex;
}
}
protected void desconectar()
{
try
{
cnn.Close();
}
catch (Exception ex)
{
throw ex;
}
}
}
}
No hay comentarios:
Publicar un comentario