Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.5
im fresher in dot.net. i need connect Remote sql server database through the internet . anyone guide me pls
 
thanks and regards
sarva
Posted 2-Aug-12 19:38pm
Sarrrva3.4K
Comments
Member 9197016 at 25-Jan-14 1:27am
   
123
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

Eventually i find solution to this problem:
 
that's first we need to configure client location Router settings. then open sql server tcp port( 1433 ) or Udp port (1434 ) in that location.
 

First thing:
client location Router settings:
 
Start->run->type cmd then press Enter
then dos prompt will open.
 
1) Now you can see dos prompt then type ipconfig - press Enter

Now your system ip,subnet and gateway information will display on your command prompt.
take your gate way ip ( for example : 192.168.1.1)
2) goto your system browser

 
type your gateway ip in browser address bar
Now your system will ask router username and password.
then enter your correct user name and password. then ur router home page will open in your browser.
 
Now you can see exactly 6 or 7 links, in that link click management link then sub links will list out lik LAN,WAN,NAT and so on.
now click NAT link then give your System ip and Sql server port then click save& apply...
 
this information for Bsnl router only
 
then check in command prompt with below command:
 
telnet client <> public ip <> 1433
 
if this command give blank black screen its connected with remote system if not otherwise
 

My connection string format:
 
<connectionStrings>
        <add name="dbconnection" connectionString="Data Source=tcp: remote location ip (public ip address),1433;Initial Catalog=Education;uid=sa;pwd=123" providerName="System.Data.SqlClient"/>
    </connectionStrings>
 

that's it!!!
 
regards
sarva
  Permalink  
v4
Comments
Prasad_Kulkarni at 8-Aug-12 7:42am
   
Good work! +5!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

This has nothing to do with C# or .NET. It has to do with the network your SQL Server is running on, being connected to the internet.
 
I told you that, two days ago. What did you do for the last two days ?
  Permalink  
Comments
Hiwwwww at 3-Aug-12 1:47am
   
yeah i agree with you sir,
 
this is my connection string
 
SqlConnection cn=new SqlConnection ("srever=127.0.0.1;database=dbname;uid=sa;pwd=123");
is this right?
thanks and regards
sarva
AshishChaudha at 3-Aug-12 2:02am
   
SqlConnection cn=new SqlConnection ("server=127.0.0.1;database=dbname;uid=sa;pwd=123");
 
Is above are your server details..??? In place of 127.0.0.1 put your server IP Address, In place of dbname, put your server database name and put your userid and password of your server in place of uid and pwd...
Hiwwwww at 3-Aug-12 2:22am
   
i tried this way Ashish
 
<<connectionstrings>>
 
<<add name="dbconnection" connectionstring="Data
Source=PINNACLESERVER\SQLEXPRESS;database=RKT;uid=sa;pwd=123" providername="System.Data.SqlClient">><</add>>
 
<</connectionstrings>>
 
Thanks
sarva
AshishChaudha at 3-Aug-12 3:06am
   
Mark solution as your answer.. so that other can refer to the answer..
 
Thanks
Christian Graus at 3-Aug-12 2:24am
   
Well, what he said is right, and what you posted is useless. So are you sure you tried with an IP that your server serves to the internet ? If you know you need to do that, why not debug that, instead of stopping doing what you need to ?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Its same as you connect local database. You have to use remote server credentials in your connection string.
  Permalink  
Comments
Hiwwwww at 3-Aug-12 1:43am
   
i need detailed explanation sir, i tried so many times but still didnt get any positive results
thanks and regards
sarva
Wes Aday at 3-Aug-12 7:55am
   
No one can give you "step by step" instructions. This is purely a network configuration issue. We cannot know how your network is setup. Hire a local IT consultant to come in and straighten out your hardware issue or google troubleshooting network connectivity issues.
Sharma Richa at 3-Aug-12 1:49am
   
there is no one to do your home work.
have you googled ?
Sarrrva at 7-Aug-12 8:48am
   
i can give solution to this problem Now......
 
Mr Sharma Richa
thanks and regards
sarva
Sharma Richa at 7-Aug-12 9:27am
   
thats great sarva.
Click on I've solved this myself! button and provide the solution.
and one more thing i am not Mr Richa, its Mrs Richa.
Sarrrva at 8-Aug-12 7:44am
   
Sorry Mam!!!
any way thanks Mam...
 
im fresher Mrs Richa so only this little confusion!!!
regards
sarva
Sarrrva at 8-Aug-12 7:49am
   
and i have another doubt Mrs.Richa... My solution working with static ip only. but my client have wireless connection... their public ip is always changing... how can i connect with that remote sql system?
 
regards
sarva
RockingDev at 3-Aug-12 2:07am
   
ri8 m agree with u..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

define it in your web.config file.

<connectionstrings>
<add name="[Connstring name]" connectionstring="Data Source=[servername];Initial Catalog=[database name];User ID=[userID];Password=[password]">
providerName="System.Data.SqlClient" />
</add></connectionstrings>

 

Thanks
AShish
  Permalink  
v2
Comments
Sharma Richa at 3-Aug-12 1:54am
   
He know that it has to define in web.config
But he need exact solution for remote database connection.
See childish comments in solution1 and solution2.
AshishChaudha at 3-Aug-12 2:03am
   
You are right richa...this is the funniest question I seen in these few days..
Hiwwwww at 3-Aug-12 1:54am
   
i also tried this way
 
it works fine IN my LAN
but not work outside the lan
regards
sarva
Christian Graus at 3-Aug-12 1:57am
   
That's because that's a local IP address. Is the computer that your SQL Server is on broadcasting to the internet ? Being able to browse the web is not the same thing.
AshishChaudha at 3-Aug-12 1:57am
   
could you please change credentials according to your server. The connection string you are showing is well and good for your local system. The same way you are working in Local system have to define for Server.
Hiwwwww at 3-Aug-12 2:09am
   
listen to all,
 
my both(client and server) system sql server configuration is
 
tcp ip port is 1433 its added in firewall , and also i set Allow remote connection for tcp/ip and named pipes in surface area configuration services and connection
 
but Still not yet connect...
 
anyone give me step by step procedures pls
 
regards
sarva
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

hi,
try Following links here you get detail Explanation about connectivity
http://dotnetguts.blogspot.in/2007/06/aspnet-connectivity-with-sql-server.html[^]
http://msdn.microsoft.com/en-us/library/ff648340.aspx[^]
 
Hope it will Help U
Best Luck
Happy Coding Smile | :)
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 343
1 _Amy 290
2 Manfred R. Bihy 200
3 Maciej Los 185
4 CHill60 180
0 OriginalGriff 7,445
1 Sergey Alexandrovich Kryukov 6,347
2 Maciej Los 3,799
3 Peter Leow 3,558
4 CHill60 2,702


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 8 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100