Click here to Skip to main content
15,904,655 members
Home / Discussions / C#
   

C#

 
QuestionDownloading & Executing an Installer - User Cancels Pin
Kevin Marois13-Mar-23 12:52
professionalKevin Marois13-Mar-23 12:52 
AnswerRe: Downloading & Executing an Installer - User Cancels Pin
Dave Kreskowiak13-Mar-23 17:43
mveDave Kreskowiak13-Mar-23 17:43 
AnswerRe: Downloading & Executing an Installer - User Cancels Pin
Graeme_Grant14-Mar-23 5:39
mvaGraeme_Grant14-Mar-23 5:39 
AnswerRe: Downloading & Executing an Installer - User Cancels Pin
Alan N14-Mar-23 10:00
Alan N14-Mar-23 10:00 
GeneralRe: Downloading & Executing an Installer - User Cancels Pin
Kevin Marois14-Mar-23 11:15
professionalKevin Marois14-Mar-23 11:15 
QuestionLooking to hire a programmer Pin
Thomas Matson10-Mar-23 6:33
Thomas Matson10-Mar-23 6:33 
AnswerRe: Looking to hire a programmer Pin
OriginalGriff10-Mar-23 6:34
mveOriginalGriff10-Mar-23 6:34 
GeneralRe: Looking to hire a programmer Pin
Thomas Matson10-Mar-23 6:46
Thomas Matson10-Mar-23 6:46 
GeneralRe: Looking to hire a programmer Pin
Graeme_Grant14-Mar-23 5:20
mvaGraeme_Grant14-Mar-23 5:20 
GeneralOff topic: New icon in Reply - View Thread line in messages Pin
jsc4213-Mar-23 23:16
professionaljsc4213-Mar-23 23:16 
GeneralRe: Off topic: New icon in Reply - View Thread line in messages Pin
OriginalGriff14-Mar-23 0:15
mveOriginalGriff14-Mar-23 0:15 
GeneralRe: Off topic: New icon in Reply - View Thread line in messages Pin
jsc4214-Mar-23 4:00
professionaljsc4214-Mar-23 4:00 
AnswerRe: Looking to hire a programmer Pin
jschell10-Mar-23 11:05
jschell10-Mar-23 11:05 
GeneralRe: Looking to hire a programmer Pin
Thomas Matson10-Mar-23 11:58
Thomas Matson10-Mar-23 11:58 
GeneralRe: Looking to hire a programmer Pin
jschell13-Mar-23 6:21
jschell13-Mar-23 6:21 
GeneralRe: Looking to hire a programmer Pin
Thomas Matson10-Mar-23 11:57
Thomas Matson10-Mar-23 11:57 
AnswerRe: Looking to hire a programmer Pin
Gerry Schmitz13-Mar-23 7:32
mveGerry Schmitz13-Mar-23 7:32 
QuestionLooking for programmers for 8Bit Music Studio in C# (.Net) Pin
kiri0086-Mar-23 21:56
kiri0086-Mar-23 21:56 
AnswerRe: Looking for programmers for 8Bit Music Studio in C# (.Net) Pin
Richard MacCutchan6-Mar-23 22:10
mveRichard MacCutchan6-Mar-23 22:10 
AnswerRe: Looking for programmers for 8Bit Music Studio in C# (.Net) Pin
OriginalGriff6-Mar-23 22:25
mveOriginalGriff6-Mar-23 22:25 
AnswerRe: Looking for programmers for 8Bit Music Studio in C# (.Net) Pin
Gerry Schmitz7-Mar-23 6:03
mveGerry Schmitz7-Mar-23 6:03 
AnswerRe: Looking for programmers for 8Bit Music Studio in C# (.Net) Pin
jschell8-Mar-23 6:54
jschell8-Mar-23 6:54 
QuestionC# config file stopped working Pin
Ismael_19991-Mar-23 3:11
Ismael_19991-Mar-23 3:11 
Hi, everyone.

I´ve developped a C# program and I have a problem with configuration file.
I use Visual Studio 2022 and Windows 10.
To start, the program acesses the configuration file to read some information, then, after the user enters username and password the program grants (or not) use and opens main screen.
In config file there are information about server name and DB name. Everything worked fine until some days ago. I made some changes in config file (I removed a variable) and, in my computer it works, but in another computer it does't anymore.An exception appears about connection to DB which is closed. After many prints I foud out that the program is using variables not from the config file, and I don1t know where it comes from. I have also another program which deals with this config file. This file also can't access config file correctly.
Here is a snippet of the code of this second file:


ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();
fileMap.ExeConfigFilename = Base.caminho + Base.nomeArquivo + ".exe.config";
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);
string Banco = config.AppSettings.Settings["Tipo"].Value;
string Servidor = config.AppSettings.Settings["Servidor"].Value;
string Empresa = config.AppSettings.Settings["Empresa"].Value;
string Local = config.AppSettings.Settings["Local"].Value;
string Diretorio = config.AppSettings.Settings["Pasta"].Value;
MessageBox.Show("Arquivo de configuração = " + fileMap.ExeConfigFilename + "\nServidor = " + Servidor + "   Empresa = " + Empresa + "   Local = " + Local +
           "\nDiretório = " + Diretorio + "   Banco = " + Banco);
if (!VerificaBasedeDados(Banco))
{
    MessageBox.Show("Base de dados  " + Banco + "  inexistente!");
    return;
}


In the first MessageBox.Show, the variable Banco (which is the DB name) is different from what is in the config file!
The 'if' after tests if the DB exists, but the program crashes before it.
The curious thing here is that in my computer it runs OK. In other computers it doesn't (I tried in 2). And before that change it ran OK too!
I tried to include back the variable but it didn't work.
Does anyone have any ideas?
Thanks.
AnswerRe: C# config file stopped working Pin
Richard Deeming1-Mar-23 3:25
mveRichard Deeming1-Mar-23 3:25 
GeneralRe: C# config file stopped working Pin
Ismael_19992-Mar-23 10:01
Ismael_19992-Mar-23 10:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.