You are using windows integrated authenticationwhen you run the sql in vs.net, it runs as you, since you have more privileges, so it runs okbut when the page is run on the web server, it runs as "ASPNET" account, which has very limited privileges, that is why it failedyou should either add ASPNET account to your database or turn on SQL authentication, create an account or use "sa", and use a connection string like
"Server=yourServerName;Database=YourDBName;UID=YourDBLogin;PWD=YourDBPassword;"
"Server=yourServerName;Database=YourDBName;UID=YourDBLogin;PWD=YourDBPassword;"
解决方案 »
- 输出excel文件名被截断 解决立马给分!
- 关于JS控制层的显示.刷新后仍然保持刷新前层的显示
- 如何弹出javascript警告提示再转页
- 寻找ASP.NET 2.0+SQL Server网络应用系统开发案例精解(珍藏版)源码
- 本人想做一个动态菜单,菜单项是从数据库里读出来的,有什么好建议吗?
- 设置了一个页面中的TextBox控件的style==>{FONT-SIZE:12PT;FONT-FAMILY:"宋体"},如何设置其他页面中的所有TextBox的style都为该style?
- 几道面试题,几乎不会做,都没信心了.各路好手解答.
- 请教各路兄弟,急!datagrid的排序中一个bug. union问题
- 如何让数据库查询返回更多的行?
- $("#content").load()方法取值
- 关于OleDb连接数据库的小问题,错误:未将对象引用设置到对象的实例。
- 请大家帮忙!!DataList嵌套出错
自动生成的连接串是不带密码的,所以只有密码为空的时候能执行。手动添加上就可以了。
你用windows验证它用 aspnet用户去访问数据库了,
或者改成SQL验证
或者给 aspnet访问的数据库的权限
在 windows程序中它是用你当前的用户去访问数据库的
在WEB程序中它是通过aspnet用户
所以出现了不能访问的问题
不过需要自己在使用者中添加账号权限
连接字串是:
Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;
不过需要自己在使用者中添加账号权限
连接字串是:
Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;