紧急求助

yuliang2987780 2010-01-04 05:11:25
为什么会报这个问题呢?都有什么情况呢?
一开始是因为链接字符串而报了相同的问题。。。现在我改了字符串还是一样的问题。。。
...全文
108 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuyq11 2010-01-04
  • 打赏
  • 举报
回复
连接字符串
在安全性里看看用户
打开SQL Server Management Studio Express,
右键点击服务器,选择Properties(属性),在弹出窗口中点击Security(安全)切换到安全面板,
将server authentication服务器认证从windows authentication mode(windows用户认证模式)
修改为Sql Server and Windows Authentication mode(Sql server和windows认证模式),ok。
打开security(安全性) -- logins(登录名) ,右键选中sa,选择properties(属性),点击Status(状态)切换到状态面板,将Login(登录)设置为Enabled(启用)。
flyerwing 2010-01-04
  • 打赏
  • 举报
回复
mappath("相路");
Lovely_baby 2010-01-04
  • 打赏
  • 举报
回复
检查数据库连接
直接使用IP访问试试~~
yuliang2987780 2010-01-04
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 cswdcswd 的回复:]
你的路径问题,要弄成相对路径或者直接打IP地址!
[/Quote]

是图片的路径还是数据库的路径?
cswdcswd 2010-01-04
  • 打赏
  • 举报
回复
你的路径问题,要弄成相对路径或者直接打IP地址!
md198687 2010-01-04
  • 打赏
  • 举报
回复
数据库没有连接上
yuliang2987780 2010-01-04
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 yuliang2987780 的回复:]
引用 7 楼 xupeihuagudulei 的回复:
哥。你要弄成相对路径。



怎么弄相对路径?
给个例子吧
[/Quote]

没有密码的
alan0128 2010-01-04
  • 打赏
  • 举报
回复
Data Source=.;
User ID=sa";
是不是没有密码的,还是要加pwd的;
User ID=sa,pwd=;";
yuliang2987780 2010-01-04
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 xupeihuagudulei 的回复:]
哥。你要弄成相对路径。

[/Quote]

怎么弄相对路径?
给个例子吧
xupeihuagudulei 2010-01-04
  • 打赏
  • 举报
回复
哥。你要弄成相对路径。
yuliang2987780 2010-01-04
  • 打赏
  • 举报
回复
这是错误信息

“/oaPro”应用程序中的服务器错误。
--------------------------------------------------------------------------------

用户 'sa' 登录失败。该用户与可信 SQL Server 连接无关联。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Data.SqlClient.SqlException: 用户 'sa' 登录失败。该用户与可信 SQL Server 连接无关联。

源错误:


行 765: {
行 766: //create & open a SqlConnection
行 767: SqlConnection cn = new SqlConnection(connectionString);
行 768: cn.Open();
行 769:


源文件: F:\OAPro\COM.OA.SqlServerDAL\SqlHelper.cs 行: 767

堆栈跟踪:


[SqlException (0x80131904): 用户 'sa' 登录失败。该用户与可信 SQL Server 连接无关联。]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800131
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +172
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +381
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +357
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
COM.OA.SqlServerDAL.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) in F:\OAPro\COM.OA.SqlServerDAL\SqlHelper.cs:767
COM.OA.SqlServerDAL.usersDAL.Select(String where, Boolean bParentTable, Boolean bChildrenTable) in F:\OAPro\COM.OA.SqlServerDAL\usersDAL.cs:627
COM.OA.BLL.usersBLL.Select(String where, Boolean bParentTable, Boolean bChildrenTable) in F:\OAPro\COM.OA.BLL\usersBLL.cs:379
loginyanzheng.Page_Load(Object sender, EventArgs e) in f:\OAPro\oaPro\loginyanzheng.aspx.cs:25
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436



xupeihuagudulei 2010-01-04
  • 打赏
  • 举报
回复
你上传本地图片、
yuliang2987780 2010-01-04
  • 打赏
  • 举报
回复
图片在2楼。。。我能看见哦。。。
这是我的连接字符串

public static readonly string SqlConn="Data Source=.;Initial Catalog=F:\OA项目\OAPRO\APP_DATA\OA_DB.MDF;User ID=sa";
alan0128 2010-01-04
  • 打赏
  • 举报
回复
tzs2304 2010-01-04
  • 打赏
  • 举报
回复
图片看不见
yuliang2987780 2010-01-04
  • 打赏
  • 举报
回复

62,254

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧