Parsi Coders

نسخه‌ی کامل: اتصال به sql sqrverدر برنامه های تحت شبکه
شما در حال مشاهده نسخه آرشیو هستید. برای مشاهده نسخه کامل کلیک کنید.
سلام
من میخوام از چند تا کلاینت به اس کیو ال سرور روی سرورم متصل بشم ار کانکشن استرینگ زیر استفاده میکم
کد:
Data Source=192.168.1.2;Initial Catalog=mydb;Integrated Security=True;Pooling=False
اما متصل نمیشه
مشکل از کجاست؟
هیچ اروری هم نمیده
این ارور را الان میده باید چبکارش کنم؟
کد:
---------------------------

---------------------------
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  
---------------------------
درود
ببخشید تایپک رو دیر دیدم برای اتصال معمولا اینطوری استفاده میکنن :
کد:
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
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