public static void connect()
{
try
{
string connectionStringStaging = @"Data Source=<server_name>;Catalog=<catalog_name>;User ID=<user_name>;Password=<my_password>";
string commandText = @"SELECT NON EMPTY { [Measures].[# Opptys moved to Committed] } ON COLUMNS FROM [Model]
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS";
AdomdConnection connection = new AdomdConnection(connectionStringStaging);
connection.Open();
AdomdCommand cmd = new AdomdCommand(commandText);
cmd.Connection = connection;
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine(reader[0]);
}
}
}
catch (AdomdConnectionException ex)
{
Console.WriteLine("Error : " + ex.ToString());
}
}
I am using the above code to connect to server and then I am further running MDX queries using this.The problem is the error I am getting - "The connection string is not valid" at line
connection.open();
Are the settings name incorrect which I am using in my connection string?Can someone help me figure out what is wrong in my connection string ?