Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 27th, 2004, 07:45 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default how i can connect to remote sql server db

i need help about how i can connect to sqlserver db using ado.net(sqlClient NameSpace)
in a remote macine using remote db using ip address and user id and password
__________________
       YoOrD .
Beauty is not on the face
Beauty is on the heart
~~<<Ghibran Khalil>>~~
 
Old May 27th, 2004, 09:47 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You can check out the SDK that comes with the .NET framework. It features loads of examples. Also, a search on Google for SQL Server ADO.NET connect should yield you lots and lots of good examples.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old May 27th, 2004, 11:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

No IP is needded! Just make a Cunnection string as u do for ur local Server & then connect!

Always:),
Hovik Melkomian.
 
Old May 28th, 2004, 02:17 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default

hi
but yet i cant to solve my problem .
 to all any to tell me how i can connect to remote sqlserver machine .
with special thanx mzz

 
Old May 28th, 2004, 02:22 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default

hi mr imar
i cant find any good code sample i u can please give me a sample code address or good links that guide me to do it .
how i can connet without using ip address and other things that how i can setup my web.config file it is very hard to use (send me a good sample of web.config)
with special thanx to u.
yoord

 
Old May 28th, 2004, 02:24 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What do you want us to do? Create a full blown working example for you?

I think you need to do a bit of research yourself. Like I suggested before, search Google for "SQL Server ADO.NET connect". You'll get plenty of examples about connecting to SQL Server. Connecting to a remote machine is not that much different; all you need to do is use a different server's IP address and you may need to specify some additional attributes on the connection string. The link I posted earlier shows you how to create the connection string you need.

What more do you want? This should be enough to get you going, I'd say, right?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old May 28th, 2004, 02:33 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by melvik
 No IP is needded! Just make a Cunnection string as u do for ur local Server & then connect!

Always:),
Hovik Melkomian.
please tell me how can setup up this connection(details of it).
with thanx yoord

 
Old May 28th, 2004, 02:37 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Oh come on!. I think you should *read* a little. Follow the link I posted. This will show you a connection string like this:

oSQLConn.ConnectionString = "Network Library=DBMSSOCN;" & _
                            "Data Source=xxx.xxx.xxx.xxx,1433;" & _
                            "Initial Catalog=myDatabaseName;" & _
                            "User ID=myUsername;" & _
                            "Pas sword=myPassword"

Change xxx.xxx.xxx.xxx with the IP address of your server, fill in the username and password, and off you go.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old May 29th, 2004, 03:34 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by Imar
 Oh come on!. I think you should *read* a little. Follow the link I posted. This will show you a connection string like this:

oSQLConn.ConnectionString = "Network Library=DBMSSOCN;" & _
                            "Data Source=xxx.xxx.xxx.xxx,1433;" & _
                            "Initial Catalog=myDatabaseName;" & _
                            "User ID=myUsername;" & _
                            "Pas sword=myPassword"

Change xxx.xxx.xxx.xxx with the IP address of your server, fill in the username and password, and off you go.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
thanx its seems that i solve it :)
but i get another problem with form that action attribute of asp.net form replaced with form name instead of what next page that we set in action attribute how i can solve it.
with thanx
yoord

 
Old May 29th, 2004, 04:26 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You can't, really. ASP.NET pages will post back to themselves. The action attribute will always point to the current page, to enable the PostBack mechanism.

You can take a look here: http://www.codeproject.com/aspnet/CHtmlForm.asp and here: http://www.experts-exchange.com/Prog..._20966296.html for some ideas on how to work around it.

My suggestion is to try and use the PostBack mechanism, instead of posting to another page. You'll avoid a lot of problems....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to connect to Remote Exchange Server. arul1976 .NET Framework 2.0 1 March 10th, 2008 10:20 AM
How to connect to a remote SQL Server? mizimizi SQL Server 2000 3 July 4th, 2006 01:47 PM
Connect to remote SQL Server 2000 using servlets Vinay Bansal Servlets 1 August 5th, 2005 12:22 AM
unable to connect remote server Harendra .NET Web Services 1 April 25th, 2005 02:10 AM
can't connect to remote server alyeng2000 ASP.NET 1.0 and 1.1 Basics 4 February 9th, 2004 11:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.