从Win7启动位于NW驱动器上的C#exe时出现“错误26

编程入门 行业动态 更新时间:2024-10-11 07:25:30
本文介绍了从Win7启动位于NW驱动器上的C#exe时出现“错误26-错误定位服务器";微软SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有几个使用 LINQ to SQL类的C#程序.如果我将exe文件放在网络驱动器上并从那里执行它们,我会收到"错误26 ","",但只有当我从Win7中执行该操作时,.

I have several C# programs utilizing LINQ to SQL classes. If I put the exe files on a network drive and execute them from there, I get the ‘error 26’, but only when I do it from Win7.

逐步

  • 创建一个新的C#项目(我在XP计算机上使用VS 2010 Premium). 添加新的"LINQ to SQL类".将一些表格拖放到 数据上下文(来自服务器资源管理器).我正在使用的数据库 都是远程服务器上的MSSQL.

  • Create a new C# project (I use VS 2010 Premium on an XP machine). Add new ‘LINQ to SQL classes’. Drag and drop some table into the data context (from the server explorer). The database(s) I’m using are all MSSQL on remote servers.

    关于以下问题:连接字符串包含带有 明文密码且未使用集成安全性…",请选择 是

    On the question: "The connection string contains credentials with a clear text password and is not using integrated security…", select Yes

    利用数据上下文在程序中进行一些LINQ查询. 确保程序正常运行.

    Make some LINQ query in the program, utilizing the data context. Make sure the program works.

    将exe放在(映射的)网络驱动器上

    Put the exe on a (mapped) network drive

    (从NW位置)执行exe

    Execute the exe (from the NW location)

    连接字符串(由系统创建)如下所示(从VS项目中可以看到的位置;属性->设置):

    The connection string (as created by the system) looks as follows (from where it can be seen in the VS project; Properties -> Settings):

    数据源= SERVERNAME \ INSTANCE;初始目录= INITIAL_CATALOG;持久安全信息=正确;用户ID = USER_ID;密码=密码

    注释

    • [在XP计算机上]在本地启动exe(c驱动器)= 确定
    • [在XP计算机上]从NW驱动器启动exe = 确定
    • [在Win7机器上]在本地启动exe(C驱动器)= 确定
    • [在Win7计算机上]从NW驱动器启动exe = 不稳定(错误26…)
    • [On XP machine] Launch exe locally (c drive)= OK
    • [On XP machine] Launch exe from NW drive = OK
    • [On Win7 machine] Launch exe locally (c drive) = OK
    • [On Win7 machine] Launch exe from NW drive = NOT OK (error 26…)

    错误消息: 建立与SQL Server的连接时发生与网络相关或特定于实例的错误.服务器未找到或无法访问.验证实例名称正确,并且已将SQL Server配置为允许远程连接. (提供者:SQL网络接口,错误:26-指定服务器/实例时出错)

    Error message: 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 Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

    推荐答案

    没有.解决此错误的方法.然而.如果您使用的是64位(新的Windows 7系统,使用SQL BI Development Studio),则必须在SQL Native Client 10.0配置(32位)下添加别名.还要检查此链接.它可能会有所帮助: sqlerrormessages.blogspot.in/2009/12/specified-sql-server-not-found-or-error.html

    There are a no. of ways to solve this error. However. if you are using a 64 bit (new Windows 7 system, using SQL BI Development Studio)you must add your aliases under SQL Native Client 10.0 Configuration (32 bit). Check this link too.It may help : sqlerrormessages.blogspot.in/2009/12/specified-sql-server-not-found-or-error.html

  • 更多推荐

    从Win7启动位于NW驱动器上的C#exe时出现“错误26

    本文发布于:2023-11-13 06:02:55,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1583642.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:器上   错误   NW   exe

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!