Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8627095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:11:31+00:00 2026-06-12T08:11:31+00:00

I have a database in Analysis Services on a remote server. This contains a

  • 0

I have a database in Analysis Services on a remote server. This contains a data source for another database located on another remote server.

I am trying to write a connectivity test using C# which will check the database connection between the two databases.

I have been unable to do this using ADOMD.NET. I’m currently looking at using SMO to do this but I haven’t had any luck so far.

I would greatly appreciate any advice or suggestions.

Update:

After further research, I have come up with the below test (Please note that I intend to add more try..catch blocks and Assertions later).

Also, this uses C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.AnalysisServices.DLL to access the Server, Database and
DataSource classes.

class ConnectivityTests
{
    // Variables
    String serverName = "";
    String databaseName = "";
    String dataSourceName = "";

    [Test]
    public void TestDataSourceConnection()
    {
        // Creates an instance of the Server
        Server server = new Server();
        server.Connect(serverName);

        // Gets the Database from the Server
        Database database = server.Databases[databaseName];

        // Get the DataSource from the Database
        DataSource dataSource = database.DataSources.FindByName(dataSourceName);

        // Attempt to open a connection to the dataSource.  Fail test if unsuccessful
        OleDbConnection connection = new OleDbConnection(dataSource.ConnectionString);
        try
        {
            connection.Open();
        }
        catch (OleDbException e)
        {
            Assert.Fail(e.ToString());
        }
        finally
        {
            connection.Close();
        }

    }

I believe that this test is sufficient for my testing (Once I’ve added some more try..catch blocks and Assertions). If the test passes, it means there are no connectivity issues between my machine and both servers, which implies that there shouldn’t be any connectivity issues between the servers.

However, I have been unable to work out how to test the connection between the two servers directly and I am interested if anyone knows a way of doing this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:11:32+00:00Added an answer on June 12, 2026 at 8:11 am

    The best solution I have come across to doing this connectivity test is below:
    Please note that this requires the Microsoft.AnalysisServices.DLL to be added as a reference.

    class ConnectivityTests
    {
        // Variables
        String serverName = "";
        String databaseName = "";
        String dataSourceName = "";
    
        [Test]
        public void TestDataSourceConnection()
        {
            try
            {
    
                // Creates an instance of the Server
                Server server = new Server();
                server.Connect(serverName);
    
                // Gets the Database from the Server
                Database database = server.Databases[databaseName];
    
                // Get the DataSource from the Database
                DataSource dataSource = database.DataSources.FindByName(dataSourceName);
    
                // Attempt to open a connection to the dataSource.  Fail test if unsuccessful
                OleDbConnection connection = new OleDbConnection(dataSource.ConnectionString);
    
                connection.Open();
            }
            catch (Exception e)
            {
                Assert.Fail(e.ToString());
            }
            finally
            {
                connection.Close();
            }
    
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a cube in SQL Server Analysis services 2008 that contains a time
I have an analysis services cube in SQL server 2005 which I'm connecting to
We have a WPF application which gets data from an Analysis Services Cube. The
We have a analysis services olap cube (SSAS 2008) deployed at a test server
My environment: SQL Server 2005 for database and SQL Server 2005 Analysis Services. I
I have data analysis application and I need to be able to export database
I'm using VB.NET to connect to and parse data from an Analysis Services database.
I have database with multiple tables in Microsoft SQL Server with schema in tables
i have database table like this +-------+--------------+----------+ | id | ip | date |
I have have a R script which queries a database, runs some analysis, plots

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.