T
Tarscher
Hi all,
I have a usercontrol that doesn't contain a control. When I try to
drop the control on a form I get an error:
Failed to create component'TestcaseUserControl'. The error message
follows: 'System.NullReferenceException: Object reference not set to
an instance of an object.' at Line 20
Line 20 is: TestService m_service = new
TestService(ConfigurationManager.ConnectionStrings["connectionString"].ToString());
I also get compile warning:
- Exception has been thrown by the target of an invocation.
When I remove TestService m_service = new
TestService(ConfigurationManager.ConnectionStrings["connectionString"].ToString());
from the class it works.
Someone knows what's wrong?
Thanks
Stijn
public partial class TestCaseUserControl : UserControl
{
public TestCaseUserControl()
{
InitializeComponent();
TestService m_service = new
TestService(ConfigurationManager.ConnectionStrings["connectionString"].ToString());
}
}
I have a usercontrol that doesn't contain a control. When I try to
drop the control on a form I get an error:
Failed to create component'TestcaseUserControl'. The error message
follows: 'System.NullReferenceException: Object reference not set to
an instance of an object.' at Line 20
Line 20 is: TestService m_service = new
TestService(ConfigurationManager.ConnectionStrings["connectionString"].ToString());
I also get compile warning:
- Exception has been thrown by the target of an invocation.
When I remove TestService m_service = new
TestService(ConfigurationManager.ConnectionStrings["connectionString"].ToString());
from the class it works.
Someone knows what's wrong?
Thanks
Stijn
public partial class TestCaseUserControl : UserControl
{
public TestCaseUserControl()
{
InitializeComponent();
TestService m_service = new
TestService(ConfigurationManager.ConnectionStrings["connectionString"].ToString());
}
}