This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//List<string> result = new List<string>( | |
// from x in config.AppSettings.Settings.AllKeys | |
// where x.ToLower().StartsWith("or") && x.ToLower().EndsWith("connectionstring") | |
// select config.AppSettings.Settings[x].Value); | |
this query returns all the values for the keys that start with "or" and end with "connectionstring", this part I understand. | |
but now I want to do the same thing but for different prefixes so I've done this: | |
foreach (var Prefix in Prefixes) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ConnectionStringList ConnectionStrings(string Path_Config) | |
{ | |
var result = new List<string>(); | |
var MyConnectionList = new ConnectionStringList(); | |
MyConnectionList.OrcaReorcaConnectionsList = new List<string>(); | |
MyConnectionList.OrcaConnectionsList = new List<string>(); | |
MyConnectionList.ReorcaConnectionsList = new List<string>(); | |
ExeConfigurationFileMap configOld = new ExeConfigurationFileMap(); | |
configOld.ExeConfigFilename = Path_Config; | |
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configOld, ConfigurationUserLevel.None); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class Form1 : Form | |
{ | |
bool VersaoValida = false; | |
bool cliValido = false; | |
bool ServiçoValido = false; | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
Funcoes Funcoes = new Funcoes(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void buttonExecScript_Click(object sender, EventArgs e) | |
{ | |
var ConnectionStrings = new List<string>(); | |
if (buttonExecScript.Text == "Terminar Update") | |
{ | |
DialogResult Result = new DialogResult(); | |
Result = MessageBox.Show(@"Deseja terminar o assistente de update do Orca ++ ?", | |
@"Assitente de Update Orca ++", MessageBoxButtons.YesNo, MessageBoxIcon.Information); | |
if(Result == DialogResult.Yes) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is my function, it returns a struct with the number of successful commands, the number of the ones with errors and also the total | |
of both and also the file path from wich they are being exectued. | |
public void ExecuteCommands(string Directories, CdpsiUpdateSql Updater, CdpsiUpdateSqlparser parser, string Log, IProgress<Result> progress) | |
{ | |
Result FinalResult = new Result(); | |
int totalWithErrors = 0; | |
int totalSuccess = 0; | |
string[] numArray1 = new string[3]; | |
List<string> list = ((IEnumerable<string>)Directory.GetFiles(Directories, "*.sql", SearchOption.TopDirectoryOnly)).Select(f => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ExecuteCommands(string Directoria, CdpsiUpdateSql Updater, CdpsiUpdateSqlparser parser, string Log, IProgress<Result> progress) | |
{ | |
string[] numArray1 = new string[3]; | |
List<string> list = ((IEnumerable<string>)Directory.GetFiles(Directoria, "*.sql", SearchOption.TopDirectoryOnly)).Select(f => | |
{ | |
string[] strArray = Path.GetFileName(f).Split('_'); | |
int result; | |
if (strArray.Length < 1 || !int.TryParse(strArray[0], out result)) | |
result = -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is my function, I need to return the struct at every foreach iteration. | |
public void ExecuteCommands(string Directoria, CdpsiUpdateSql Updater, CdpsiUpdateSqlparser parser, string Log, IProgress<Result> progress) | |
{ | |
string[] numArray1 = new string[3]; | |
List<string> list = ((IEnumerable<string>)Directory.GetFiles(Directoria, "*.sql", SearchOption.TopDirectoryOnly)).Select(f => | |
{ | |
string[] strArray = Path.GetFileName(f).Split('_'); | |
int result; |
NewerOlder