Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 27th, 2004, 07:45 AM
Friend of Wrox
 
Join Date: May 2004
Location: Ardabil, Ardabil, Iran.
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>>~~
Reply With Quote
  #2 (permalink)  
Old May 27th, 2004, 09:47 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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.
Reply With Quote
  #3 (permalink)  
Old May 27th, 2004, 11:23 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
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.
Reply With Quote
  #4 (permalink)  
Old May 28th, 2004, 02:17 AM
Friend of Wrox
 
Join Date: May 2004
Location: Ardabil, Ardabil, Iran.
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

Reply With Quote
  #5 (permalink)  
Old May 28th, 2004, 02:22 AM
Friend of Wrox
 
Join Date: May 2004
Location: Ardabil, Ardabil, Iran.
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

Reply With Quote
  #6 (permalink)  
Old May 28th, 2004, 02:24 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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.
Reply With Quote
  #7 (permalink)  
Old May 28th, 2004, 02:33 AM
Friend of Wrox
 
Join Date: May 2004
Location: Ardabil, Ardabil, Iran.
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

Reply With Quote
  #8 (permalink)  
Old May 28th, 2004, 02:37 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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.
Reply With Quote
  #9 (permalink)  
Old May 29th, 2004, 03:34 AM
Friend of Wrox
 
Join Date: May 2004
Location: Ardabil, Ardabil, Iran.
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

Reply With Quote
  #10 (permalink)  
Old May 29th, 2004, 04:26 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:25 PM.


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