PDA

View Full Version : سوال: نحوه تنظیم در server



mojtaba-n
دوشنبه 14 دی 1394, 00:12 صبح
سلام خدمت دوستان :
من یک سایت با asp.net و sql درست کردم و از تکنولوژی entity framework جهت ارتباط با دیتابیس استفاده کردم. روی سیستم خودم مشکلی نداره ولی روی سرور ارور میده و نمیتونه به دیتابیس متصل بشه. ظاهرا مشکل در conection string در web.config هست.
conection string در فایل web.config سیستم خودم به این شکله :

<connectionStrings>
<add name="MyDatabaseEntities" connectionString="metadata=res://*/App_Code.MyModel.csdl|res://*/App_Code.MyModel.ssdl|res://*/App_Code.MyModel.msl;provider=System.Data.SqlClien t;provider connection string=&quot;data source=(LocalDB)\v11.0;attachdbfilename=|DataDirec tory|\MyDatabase.mdf;integrated security=True;MultipleActiveResultSets=True;App=En tityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

روی سرور نام فایل دیتا بیس شده SampleDB و نام کاربری شده Ali1024 و پسورد شده asd123 و کل رشته اتصال در فایل web.config روی سرور به شکل زیره :


<connectionStrings>
<add name="MyDatabaseEntities" connectionString="metadata=res://*/App_Code.MyModel.csdl|res://*/App_Code.MyModel.ssdl|res://*/App_Code.MyModel.msl;provider=System.Data.SqlClien t;provider connection string=&quot;data source=sql.DomainName.COM,1430;Initial catalog=SampleDB;User Id=Ali1024;Password=asd123;integrated security=True;MultipleActiveResultSets=True;App=En tityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

سایت بالا میاد و کار میکنه ولی اگه بخوام چیزی در دیتابیس ذخیره کنم این پیام خطا رو میده. مشکل کجاست ؟
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

mojtaba-n
سه شنبه 15 دی 1394, 09:16 صبح
منتظر پاسخ دوستان گرامی هستم