PDA

View Full Version : سوال: بسیار فوری:مقدار connection string بعد از اپلود سایت



mohammadyaser
دوشنبه 02 خرداد 1390, 13:57 عصر
سلام
من سایت و دیتا بیسم رو اپلود کردم و این خطا رو می گیرم
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

چون هنوز تو سایتم کانکشن استرینگم رو تغییر ندادم
کانکشنم اینه
Data Source=SERVER;Initial Catalog=Salary;Persist Security Info=True;User ID=sa;Password=66101002
اونو چطور باید تغییر بدم و چه چیزی هایی رو باید جایگزین کنم
ممنون

arta.nasiri
دوشنبه 02 خرداد 1390, 14:10 عصر
سلام

مقدار Data Source برابر با localhost باشه.
یوزر و پسورد هم که هرچی ساخته باشی اونو میدی.
و Integrated Security رو هم SSPI بذار.

sara shafi
دوشنبه 02 خرداد 1390, 14:34 عصر
http://www.connectionstring.com (http://www.connectionstring.com/)

dontspeak
دوشنبه 02 خرداد 1390, 14:43 عصر
اینو به عنوان کانکشنت بده

Server=IpSitetobezar;Database=databasikesakhti;Use r ID=idertebatbaDB;Password=Paswordet;Trusted_Connec tion=False;

sg.programmer
دوشنبه 02 خرداد 1390, 18:59 عصر
لطفا یک مثال بزنید
منم همین مشکل و دارم
مقدار Data Source برابر با . باشه یا اسم سایت www.web.com

sg.programmer
دوشنبه 02 خرداد 1390, 19:39 عصر
من کانکشنو به هر نحوی میزارم ارور زیر رو میده
1) کجای web.config دستکاریی منم تا خطا رو به من نشوم بده (<customErrors mode="Off"/ ) دستکاری کردم نشد
خیلی هم گشتم

2) میدونم از کانکشنم مشکل وحود داره باید چکار کنم


Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> </configuration>

arta.nasiri
دوشنبه 02 خرداد 1390, 19:40 عصر
لطفا یک مثال بزنید
منم همین مشکل و دارم
مقدار Data Source برابر با . باشه یا اسم سایت www.web.com

سلام

اینکه از چه مقداری برای Data Source استفاده کنید رو میتونید از پشتیبانی شرکتی که هاست رو خریدید بپرسید، ولی در اکثر مواقع یا از . یا از localhost استفاده میشه. در بعضی مواقع هم از آی پی سرور.

sg.programmer
دوشنبه 02 خرداد 1390, 20:48 عصر
تشکر آقای grlearn (http://barnamenevis.org/member.php?52028-grlearn)
از Data Source=sql.yourdomainname; استفاده کردم درست شد.

آیا میشه خطا های که توی سایت یوجود می اد را دید که خطا از کجا هست مثلا برای همین کانکشن بگه خطای کانکشن بوده ؟
چون من می دونستم از کانکشنش هست دنبال کانکشن گشتم


1) کجای web.config دستکاریی منم تا خطا رو به من نشوم بده (<customErrors mode="Off"/ ) دستکاری کردم نشد
خیلی هم گشتم

rana-writes
دوشنبه 02 خرداد 1390, 23:31 عصر
تشکر آقای grlearn (http://barnamenevis.org/member.php?52028-grlearn)
از Data Source=sql.yourdomainname; استفاده کردم درست شد.

آیا میشه خطا های که توی سایت یوجود می اد را دید که خطا از کجا هست مثلا برای همین کانکشن بگه خطای کانکشن بوده ؟
چون من می دونستم از کانکشنش هست دنبال کانکشن گشتم

مقدار
<customErrors mode="Off"
رو توی وب کانفیگ تنظیم کنین
اما بهتره این کار تا زمانی که سایت آپلود نشده انجام بشه و وقتی سایت رو آپلود کردین این مقدار رو روی on بذارین و صفحات خطا رو بسازین که کاربر عادی صفحه خطا رو نبینه
ضمنا شما وقتی هاست میخرین، یه ایمیل براتون ارسال میشه که کلیه مشخصات اون هاست توش وجود داره و بین این مشخصات حتما کانکشن استرینگ سرورشون رو میذارن
موفق باشین