locked
Data Source to Dataset Connection Problem RRS feed

  • Question

  • I have formulated SQL-Server-12 DBs as data sources for VB.Net Datasets.  The datasets have connected properly to their respective databases.  When I refresh them, they indicate of having refreshed properly.  Upon attempting to preview the data of e.g. FinanceDataDataset.tblAssetAction, I get the following message: "FinanceDataDataset.tblAssetAction.Fill,Get_Data() could not be previewed.

    A network related or instance-specific error occured 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 Server is configured to allow remote connections.  (provider: SQL Network interfaces, error 26 - Error Locating Server/Instance specified) at DataObjectSupport (422,6)"

    How do I go about the verification suggestions and for what should I be looking?

    Thanks


    DAllenCohen

    Thursday, May 7, 2015 4:32 AM

Answers

All replies

  • This is an Sql Connection error, you need first to verify that you are able to connect to these DBs via management studio. And then double check the connection string values in your app.config and don't check only the username and password also check the instance name and DB name.

    Fouad Roumieh

    Sunday, May 17, 2015 2:34 PM
  • Thanks, Rouad

    All of what you suggest I had already done.  The Data Connections on Server Explorer Refresh properly.  I am getting my data from my SQL Server to the databases of Server Explorer.  The problem is that I am not getting data into my datasets under Data Sources.

    Thanks again, Allen


    DAllenCohen

    Sunday, May 17, 2015 9:38 PM
  • This sounds very odd... can you please verify the circumstances?

    Are you saying that you can open the DataSet Designer window and refresh the table schema from the table adapters you've defined and that all works perfectly.  But if you try to preview the data from the Data Sources window, then you get the error message?

    I can think of reasons why you might be able to browse the database from the Server Explorer but then have trouble creating a new DataSet from the wizard (e.g. wrong provider type) but I'm not sure about the DataSet Designer working fine and the Data Sources window having a problem...

    Did you save the database credentials in the connection string?  If not, I'm not sure if the Data Sources preview would prompt for a password or just fail to run...


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Monday, May 18, 2015 4:18 AM
  • Please send us a sample of the code that is causing the above error to verify, do you have your connection string stored in different places? Like app.config for DataSets and at class object for code? Was this working at any stage and then it breaks?

    Check the below blog, its focusing on instance name as a fix for this error:

    http://blogs.msdn.com/b/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx


    Fouad Roumieh

    • Proposed as answer by Youjun Tang Wednesday, May 20, 2015 6:14 AM
    • Marked as answer by Youjun Tang Monday, May 25, 2015 9:12 AM
    Monday, May 18, 2015 5:53 AM
  • Thanks, Kimble

    I like your quote.

    Concerning my problem, what you stated is correct:  

    "Are you saying that you can open the DataSet Designer window and refresh the table schema from the table adapters you've defined and that all works perfectly.  But if you try to preview the data from the Data Sources window, then you get the error message?"

    I am traveling now and not in a position to send you a sample.  This worked fine on my main computer.  I transfered the SQL Server DBs to my portable (backup and restore) and I copied my VB program to the portable.  I have Visual Studio 2010 and SQL Server 2012 on my portable as well as on my main computer.  I re-established the connection string on the portable so that the DBs refresh and do display the data.  I will check the URL that you sent once I am settled at my destination.  Thanks again, Allen


    DAllenCohen

    • Marked as answer by Youjun Tang Monday, May 25, 2015 9:12 AM
    • Unmarked as answer by Youjun Tang Monday, May 25, 2015 9:12 AM
    Monday, May 18, 2015 4:14 PM