SQL错误26 [英] sql error 26

查看:450
本文介绍了SQL错误26的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我在C#程序中与Sql Server的连接中有错误

这是连接的代码

hello

I have error in the connection to Sql server in C# program

this is the code of connection

SqlConnection connection = new SqlConnection();
connection.ConnectionString = 
@"Data Source=D:\NewCode\DataBaseWin.sdf;Integrated Security=SSPI";
connection.Open();



这是错误



and this is the error

provider sql network interfaces error 26 - error locating server/instance specified




我该怎么办?
Oo




what I have to do ?
Oo

推荐答案

为什么要使用SqlConnection连接到SDF文件?为什么不使用SqlCeConnection?
Why are you using an SqlConnection to connect to an SDF file? Why not use an SqlCeConnection?
SqlCeConnection connection = new SqlCeConnection();
connection.ConnectionString = 
@"Data Source=D:\NewCode\DataBaseWin.sdf;Integrated Security=SSPI";
connection.Open();


这篇关于SQL错误26的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆