开发者

Linq DataContext Problem

开发者 https://www.devze.com 2023-03-14 21:23 出处:网络
I have this strange problem on Linq DataContext. So I have instantiated my data context and have it use the connection string from the config.

I have this strange problem on Linq DataContext.

So I have instantiated my data context and have it use the connection string from the config.

This is wcf service by the way, and I have it hosted on IIS.

when I do a call on any of the methods from my service using Test Client, it will work but If I call any method using POST or Get request it will throw an sql exception that says "it can't connect with the user....". So when I look at the context instance it uses my old connectio开发者_如何学Cn string that doesn't exist anymore. So I did a search on the entire solution for the instance of connection string but found nothing.

Should you have experience same problem, let me know.

Best


If you are using IIS7 you can check what connection string is being used by clicking the connection strings icon. See if it still exists. If that's the case check your solutions properties to make sure that the build action is set to content, and the Copy to Output Directory is set at least to copy if newer.

My second guess would be to check if the folder containing your files allows access to the Network Service user, or IUSR depending on which IIS is using.

0

精彩评论

暂无评论...
验证码 换一张
取 消