0

I have a problem with interbase database and sqldependency c#. I want to detect changes in database. When I run code:

public Form1()
        {
            InitializeComponent();

            DbConnection c = new TAdoDbxInterBaseConnection();
            c.ConnectionString = @"Database=C:\MeronaSoft\MSDB.gdb;User=SYSDBA;Password=masterkey";
            SqlDependency.Start(c.ConnectionString);

    }

I get: An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll

Additional information: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL.

Maybe it is not possible to us interbase with sqldependency?

user3455769
  • 49
  • 1
  • 7
  • try this http://stackoverflow.com/questions/18060667/cannot-connect-to-server-a-network-related-or-instance-specific-error – Pradnya Bolli May 20 '15 at 09:40
  • [`SqlDependency`](https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldependency%28v=vs.110%29.aspx): "The SqlDependency object represents a query notification dependency between an application and an instance of **SQL Server**..." (My emphasis) – Damien_The_Unbeliever May 20 '15 at 10:06

1 Answers1

0

check these things

  1. Make sure your database engine is configured to accept remote connections(I you are using centralized database)

    •Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration
    •Click on Surface Area Configuration for Services and Connections
    •Select the instance that is having a problem > Database Engine > Remote Connections
    •Enable local and remote connections
    •Restart instance

  2. Check the SQL Server service account

    •If you are not using a domain account as a service account (for example if you are using NETWORK SERVICE), you may want to switch this first before proceeding

3.If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your ASweb P.NET application

•Usually the format needed to specify the database server is machinename\instancename
•Check your connection string as well

Check this link A network-related or instance-specific error

Other wise go Control Panel\All Control Panel Items\Administrative Tools\services and start SQL SERVER(SQLEXPRESS).

Pradnya Bolli
  • 1,915
  • 1
  • 19
  • 37
  • There are quite a few clues in the question that they're not working against a SQL Server instance at all (i.e. multiple references to [tag:interbase], `TAdoDbxInterBaseConnection`, the connection string is trying to access a file with a `.gdb` extension, etc) – Damien_The_Unbeliever May 20 '15 at 10:10