-2

I have one problem with C#

I connect Data Source=BARIS;Initial Catalog=SurucuOtomasyon;User ID=sa;Password=1234

But I don't connect database when i write mylocal ip to Data Source

Data Source=192.168.1.3;Initial Catalog=SurucuOtomasyon;User ID=sa;Password=1234

Thanks for helping

Gabe
  • 84,912
  • 12
  • 139
  • 238
Emree
  • 85
  • 1
  • 1
  • 5
  • 2
    I'm not trying to be unhelpful, but the is the classic 'Doctor is hurts when I do this.' and the Doctor says, then don't do that. Why can't you just use BARIS? – Joe Sep 09 '11 at 22:19

1 Answers1

4

an answer

Open your SQL Configuration Manager and allow to TCP/IP connections. Set dynamic port blank to disable it (i don't remember here well) The IP gives the machine, you need a port, too:

192.168.1.3:1433 (the port 1433 is a standart)

another link about connectionstrings

connection string with DataSource=192.168.2.3 is enough. You have to change configurationn. Right configuration will run your code. (i've tested it with a project, its all about configuration of your sql. See my comment below)

Community
  • 1
  • 1
icaptan
  • 1,495
  • 1
  • 16
  • 36
  • Port is enable. I try to connection to 192.168.1.3:1433 but this problem don't solve – Emree Sep 09 '11 at 22:28
  • try your dynamic ip instead of local ip ... just for a try. tomorrow morning i will create a project for you and test everything. now i shall sleep. – icaptan Sep 09 '11 at 22:31
  • This problem remote connection allow. How to allow remote connection ? – Emree Sep 09 '11 at 22:32
  • Thans for help icaptian. But today i will solve this problem because i won't sleep :) – Emree Sep 09 '11 at 22:37
  • Click at Sql Configuration Manager -> Sql Native Client [...] than from Sql Native Client[...] click -> TCP / IP you shall see default port as 1433. than you shall check Sql Server Network Protocol -> TCP / IP ... if you can't solve that problem i will look at tomorrow. By the way your question deserve many "-" :) – icaptan Sep 09 '11 at 22:58