hello good I'm wanting to connect sql server in c # but in the form of checkbox esoty doing it I have a checkbox asks if authentication is by windows or is per user
At the moment of calling a string, you do not recognize it, I leave you the code beforehand thanks
if (tipoAuthentificacion == true) {
string connectionString0 = string.Format("Data Source={0};Initial Catalog={1};Integrated Security=True;", cbServer.Text, txtDataBase.Text);
}
else
{
string connectionString1 = string.Format("Data Source={0};Initial Catalog={1}; User Id={2};Password={3};", cbServer.Text, txtDataBase.Text, txtUsername.Text, txtPassword.Text);
}
string connections = connectionString0 /supuesto error que no reconoce
try
{
CapaNegocio.Conexion Heloper = new Conexion(connections);
if (Heloper.CheckConnection)
{
DevComponents.DotNetBar.MessageBoxEx.Show("Probando conexion exitosa");
}
}
catch (Exception ex)
{
DevComponents.DotNetBar.MessageBoxEx.Show(ex.Message);
}