G
Guest
Hi all,
I have a piece code like this:
static void Main()
{
Utility db;
try
{//create db connection, fill dataset...
db = new Utility();
}
catch(Exception e)
{
MessageBox.Show("Exit...");
}
if( db != null) <--- .net does not like it.
{
Application.Run(new DataForm(db));
}
}
When compiling, .NET complains that db at "if( db != null)" is undefined.
But that what I want to test. How could I get around of this problem?
Thanks,
Karl
I have a piece code like this:
static void Main()
{
Utility db;
try
{//create db connection, fill dataset...
db = new Utility();
}
catch(Exception e)
{
MessageBox.Show("Exit...");
}
if( db != null) <--- .net does not like it.
{
Application.Run(new DataForm(db));
}
}
When compiling, .NET complains that db at "if( db != null)" is undefined.
But that what I want to test. How could I get around of this problem?
Thanks,
Karl