Showing posts with label programmatically. Show all posts
Showing posts with label programmatically. Show all posts

Sunday, March 25, 2012

Connectivity Issues in AMO

Hi,

I am using AMO to connect to SSAS 2005 and programmatically create objects. currently I am specifying only the ServerName in the connection string. Please see the code below:

<code>

Server SSASServer = new Microsoft.AnalysisServices.Server();
SSASServer.Connect("DataSource=" + ServerName);

</code>

The above code works fine and I am able to connect. Now I want to provide the instance name of the server and also the server name. because tomorrow we will have multiple instances of Analysis server running on the same server. I read somewhere that we need to specify ServerName\InstanceName.

SSASServer.Connect(ServerName + "\\" + InstanceName);

So I tried the above, with both the serverName and InstanceName being the same for now. (currently only one instance is running). but that is not working, whenever I do that I get the error: I also removed the string "DataSoruce=", still I get the same error.

{"A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running."}

1. How to identify the ServerName and the InstanceName?

2. How to specify them in the connection string?

3. Currently I am using Windows Integrated Authentication, how do i specify username and password to connect to SSAS 2005.

Please do provide any information possible.

Thanks and Regards

Vijay R

Connection to the default instance could only be made by using ServerName.

Anything you specify after the '\' will be considered as an instance name. meaning client will try to find an AS named instance with such name.

In your experiment above, it will try to find a named instance and will fail because you dont have it installed.

Get your named instance installed and connect to it using ServerName\InstanceName where InstanceName you provide during setup of Analysis Server.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hi,

Thanks a lot Melomed,

That certainly helped me.

But what about specfying the Username and password for connection.

That is if I do not want to use Windows Integrated Authentication for SSAS in AMO.

Regards

Vijay R

|||

When using TCP/IP to connect to Analysis Server , Windows authentication is your only choice.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hi Melomed,

I was succesful in implementing and executing teh AMO based app that creates Cubes, Dimensions, MeasureGroups, Measures and Partitions.

but I still have the problem of connecting to an named instance of the SSAS server. I now have a named instance of SSAS.

I am also able to conect to it using the BI studio /Visual Studio 2005. After connecting the summary/properties display ServerName\InstanceName.

but when i try this programmatically using AMO, it throws the below error. (the same one!)

{"A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running."}

Here is the code:

string tempConnstring = "DataSource=" + SSASServerName + @."\" + SSASInstanceName;

SSASServer.Connect(tempConnstring);

-

Please do help me as to how I should be doing this?

Thanks and Regards

Vijay R

|||

It is not "DataSource="

But rather "Data Source="

You are missing a space there.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

sqlsql

Tuesday, February 14, 2012

Connection string

hi. I have trying to load packages from SQL server using "load from SQL comman" and then programmatically changing the connection manager's certain properties(as this property has to be changed in run time.

It works fine when these packages are running from same database but when programmatically I am changing its initial catalogue to some other database, then this is not reflecting even after changing the initial catalogue. Its referring to database which these are created upon. If anyone has some idea please reply back

Is your catalog hardcoded somewhere in the package (like in a table name)?

I would suggest you open your package, try to change the connection string manually and then debug your package step by step.

HTH.

|||

thanks for your reply ,

Well yes the database name is getting added along with the table name.

is ther any way to place just table name or a way to remove the database name ?

Thanks,

|||

Could you give us more details? What component are you referring to? Is it OLE DB Source/Destination?

Most probably it can be fixed; just tell us what component has the catalog name hard-coded.

Thanks.

|||

Anshu nautiyal wrote:

thanks for your reply ,

Well yes the database name is getting added along with the table name.

is ther any way to place just table name or a way to remove the database name ?

Thanks,

That is your problem; make sure all sql statements in the package do not have the dabase name as they may be diffrent when you change the connection strings. Just edit the sql statements and remove the database part of the name.

|||

Anshu nautiyal wrote:

thanks for your reply ,

Well yes the database name is getting added along with the table name.

is ther any way to place just table name or a way to remove the database name ?

Thanks,

That is your problem; make sure all sql statements in the package do not have the dabase name as they may be diffrent when you change the connection strings. Just edit the sql statements and remove the database part of the name.