G
Guest
Below is similar code that I am have and the line "myDataConnect mydata = new
myDataConnect(ConfigurationSettings.AppSettings["connectSQL"]);" is what I am
having trouble with.
The syntax is correct and I get no errors, but it is not finding the Key
“connectSQL†or any key for that matter in my app.config. It returns a NULL
value. Besides the Namespace imports I have defined, I also have 4
references set up to:
System
System.Data
System.Data.OracleClient
System.XML
I am using a Windows test App solution with Framework 1.1 to test my Class
Library Project that has been added to the solution, which contains the
App.config, myDataConnect.cs, and myClass.cs.
#region Namespace imports
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.IO;
using System.Text;
using System.Xml;
#endregion
public class MyClass
{
#region Public Methods
public void myFunction()
{
myDataConnect mydata = new
myDataConnect(ConfigurationSettings.AppSettings["connectSQL"]);
myDataSet datData =
mydata.getSqlDataSet("sp_myStoredProcedure");
}
#endregion
}
I am not sure why it’s not finding my Key in the app.config file.
Thanks for the help in advance.
myDataConnect(ConfigurationSettings.AppSettings["connectSQL"]);" is what I am
having trouble with.
The syntax is correct and I get no errors, but it is not finding the Key
“connectSQL†or any key for that matter in my app.config. It returns a NULL
value. Besides the Namespace imports I have defined, I also have 4
references set up to:
System
System.Data
System.Data.OracleClient
System.XML
I am using a Windows test App solution with Framework 1.1 to test my Class
Library Project that has been added to the solution, which contains the
App.config, myDataConnect.cs, and myClass.cs.
#region Namespace imports
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.IO;
using System.Text;
using System.Xml;
#endregion
public class MyClass
{
#region Public Methods
public void myFunction()
{
myDataConnect mydata = new
myDataConnect(ConfigurationSettings.AppSettings["connectSQL"]);
myDataSet datData =
mydata.getSqlDataSet("sp_myStoredProcedure");
}
#endregion
}
I am not sure why it’s not finding my Key in the app.config file.
Thanks for the help in advance.