Login screen
Connectionconnectionscreen
CompanyRegistration
Mybank
SqlConnectionCON=newSqlConnection();//FazaconexãocomoBancodeDadosCON.ConnectionString=Properties.Settings.Default.csSistemaEstoque;//CriaumastringdeconexãoSqlCommandCM=newSqlCommand();//CM.CommandType=System.Data.CommandType.Text;CON.Open();CM.CommandText="INSERT INTO tbEmpresaUsuaria ([dtInclusao_emp], [razao_emp], [nomeFant_emp], [cnpj_emp], [inscEst_emp], [logradouro_emp], [endereco_emp], " +
" [numero_emp], [compl_emp], [bairro_emp], [cidade_emp], [uf_emp], [cep_emp], [tel_emp], [tel2_emp], [email_emp], [site_emp], [endLogo_emp])" +
" VALUES (@dtInclusao_emp, @razao_emp, @nomeFant_emp, @cnpj_emp, @inscEst_emp, @logradouro_emp, @endereco_emp, @numero_emp, " +
" @compl_emp, @bairro_emp, @cidade_emp, @uf_emp, @cep_emp, @tel_emp, @tel2_emp, @email_emp, @site_emp, @endLogo_emp)";
If anyone can help me thank you
code on login screen
private void cbbEmpresaUsuaria_SelectedIndexChanged(object sender, EventArgs e)
{
string myConnString = String.Empty;
codEmpUsuaria = Convert.ToString(cbbEmpresaUsuaria.SelectedValue);// pego o codigo empresa usuaria selecionado no ComboBox
var empresa = codEmpUsuaria;
if (empresa.Equals("1"))
{
myConnString = "Data Source=servidor;Initial Catalog=empresaA;User ID=teste;Password=123456";
} if (empresa.Equals("2"))
{
myConnString = "Data Source=servidor;Initial Catalog=empresaB;User ID=teste;Password=123456";
}
}
<connectionStrings>
<add name="Data Source=servidor;Initial Catalog=dbSistEstoqueEmp;User ID=teste;Password=123456"
providerName="System.Data.SqlClient" />