J
jhcorey
I have the code below that works fine. Note that CellSet does not have
a constructor, so I don't have a default way of initializing it.
If I try to do something else in the catch block, either
ExceptionManager.Publish(ex);
or simply commenting out the line, I get a compile error:
"Use of unassigned local variable myCellSet".
Can anybody explain what is going on?
TIA,
Jim
....
using Microsoft.AnalysisServices.AdomdClient;
....
public CellSet GetCellSet(string MDXQuery)
{
CellSet myCellSet;
try
{
AdomdConnection myConnection = new
AdomdConnection(GetConnectionString());
myConnection.Open();
AdomdCommand myCommand = new AdomdCommand(MDXQuery, myConnection);
myCellSet = myCommand.ExecuteCellSet();
myConnection.Close();
}
catch (Exception ex)
{
throw(ex);
}
return (myCellSet);
}
a constructor, so I don't have a default way of initializing it.
If I try to do something else in the catch block, either
ExceptionManager.Publish(ex);
or simply commenting out the line, I get a compile error:
"Use of unassigned local variable myCellSet".
Can anybody explain what is going on?
TIA,
Jim
....
using Microsoft.AnalysisServices.AdomdClient;
....
public CellSet GetCellSet(string MDXQuery)
{
CellSet myCellSet;
try
{
AdomdConnection myConnection = new
AdomdConnection(GetConnectionString());
myConnection.Open();
AdomdCommand myCommand = new AdomdCommand(MDXQuery, myConnection);
myCellSet = myCommand.ExecuteCellSet();
myConnection.Close();
}
catch (Exception ex)
{
throw(ex);
}
return (myCellSet);
}