Get single value from dictionary by key

It really does seem like you’re overcomplicating this issue. You can just use the indexer ([]) of the Dictionary class along with the .ContainsKey() method. If you use something like this: You should achieve the effect that you want.

C# – Illegal characters in path

Whether you do this or this the string stored in memory is just C:\Temp\My Excel File.xls, whatever the debugger may tell you. So when you read some string from somewhere (database, file, user input, …) you don’t need to “escape” backslashes. So just use that string.

SQL Insert Query Using C#

I assume you have a connection to your database and you can not do the insert parameters using c #. You are not adding the parameters in your query. It should look like: Updated: