A few errors in your code:
ConfigurationManager.ConnectionStrings refers to a specific configuration section of your application that stores data for accessing your databases (one or more). The section contains lines like these
<connectionStrings> <add name="MyDataBase" connectionString="Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\myFolder\myAccess2007file.accdb; Persist Security Info=False"/> </connectionStrings>
(To create a valid connection string for your application, see www.connectionstrings.com )
Thus, your code refers to these section voices using the "name" key with
string connString2 = ConfigurationManager.ConnectionStrings["MyDataBase"].ConnectionString;
It is said that the text of your query will fail because you are using extensive column names with spaces. In this case, each column name must be enclosed in square brackets.
string query2 = @"SELECT [Manager ID], [Manager FName], [Manager LName], .....
Steve source share