• ¡Welcome to Square Theme!
  • This news are in header template.
  • Please ignore this message.
مهمان عزیز خوش‌آمدید. ورود عضــویت


امتیاز موضوع:
  • 6 رای - 2.33 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
Title: اتصال به sql sqrverدر برنامه های تحت شبکه
حالت موضوعی
#1
سلام
من میخوام از چند تا کلاینت به اس کیو ال سرور روی سرورم متصل بشم ار کانکشن استرینگ زیر استفاده میکم
کد:
Data Source=192.168.1.2;Initial Catalog=mydb;Integrated Security=True;Pooling=False
اما متصل نمیشه
مشکل از کجاست؟
هیچ اروری هم نمیده
 
پاسخ
#2
این ارور را الان میده باید چبکارش کنم؟
کد:
---------------------------

---------------------------
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)
---------------------------
OK  
---------------------------
 
پاسخ
#3
درود
ببخشید تایپک رو دیر دیدم برای اتصال معمولا اینطوری استفاده میکنن :
کد:
SqlConnection myConnection = new SqlConnection("user id=username;" +
                                       "password=password;server=serverurl;" +
                                       "Trusted_Connection=yes;" +
                                       "database=database; " +
                                       "connection timeout=30");

برای اینکه کلا یاد بگیری پیشنهاد میکنم اینجا رو ببین :

http://www.codeproject.com/KB/database/s...sharp.aspx
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
#4
Server: Share: full access Security: permishion = every one connection string : with sa
Name: نام سرور نباید نقطه باشد زیرا در سیستمهای کلاینت نقطه به معنی همان سیستم است نه سرور- نام سرور در شبکه باید خاص باشد
Ip:ای پی باید در شبکه خاص باشد، اگر به اینترنت متصل هست باید در شبکه اینترنت هم خاص باشد

Cleint : Setup : Microsoft Microsoft SQL Server 2008 Native Client MSI


Sql Server Configoration Manager: Start >> Microsoft SQL Server 2008 >> configuration tools
SQL Server Service >> SQL Server Browser >> Right Click >> Properties >> Service Tab >> Start Mode= Automatic>> Ok rclk\Start
SQL Server Network Configuration >> Protocol for SQLEXPRESS >> Enable all items (except VIA)
SQL Native Client 10 Configuration >> Clint Protocols >> Enable all items (except VIA)

SQL Server Management Studio
Go to SQLEXPRESS (windows athuntication login mode) >> Security >> Logins >> sa >> Properties >> status >> Enable. >>
General >> Set your Password
Right Click On ".\SQLEXPRESS" >> Properties >> Security >> SQL Server And Windows Authentication mode >> Successful Login only
Permissions >> Explicit (tab) >> Check Connect SQL (sa)
Restart SQL Express
 
پاسخ
  


موضوعات مشابه ...
موضوع نویسنده پاسخ بازدید آخرین ارسال
Bug پشتیبانی آموزشی رایگان برای فراگیران زبان های برنامه نویسی one hacker alone 0 1,499 08-09-2016، 11:53 PM
آخرین ارسال: one hacker alone
  اتصال به اکسس mahsa_18 1 2,524 06-11-2013، 01:10 AM
آخرین ارسال: Amin_Mansouri
  نمونه برنامه با الگریتمA* mahdis 1 2,710 01-21-2013، 09:23 PM
آخرین ارسال: Amin_Mansouri
Sad اضافه کردن صوت و تصویر به برنامه چت milad.ahmadie 10 14,647 06-14-2012، 01:39 PM
آخرین ارسال: Amin_Mansouri
  اتصال به sql server Ghoghnus 14 15,154 05-10-2012، 02:56 PM
آخرین ارسال: Ghoghnus
  برنامه انبار دار Pxt 0 2,515 05-01-2012، 01:43 PM
آخرین ارسال: Pxt
Information باز کردن سورس برنامه های C# analyze 3 9,420 01-01-2012، 05:19 PM
آخرین ارسال: Amin_Mansouri
  سورس کد بدست اورن لیست برنامه های نصب شده c# Amin_Mansouri 0 3,183 12-30-2011، 03:57 PM
آخرین ارسال: Amin_Mansouri
  اجرای ماشین حساب ویندوز در برنامه analyze 0 5,787 12-06-2011، 02:47 PM
آخرین ارسال: analyze
Photo برنامه ارسال بلوتوث analyze 2 4,382 12-06-2011، 02:29 PM
آخرین ارسال: analyze

پرش به انجمن:


Browsing: 1 مهمان