473,382 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

SQL Remote C#

What do I have to change in the connection string to connect remotely to a
SQL 2005 Server?

(i.e. \\SQLSERVER becomes http://sqlserver.com:1433/)

I am outsourcing the hosting and there is some information that references
an internal database, any suggestions on the best way to make this happen?

Thanks

Luke Davis
Sep 12 '07 #1
5 1412
a typical remote machine SQL Server connection string would look like:

server=sqlserver.com;database=mydatabase;uid=user; pwd=pass;

You would normally expect the SQL server to use TCP connections, no port is
necessary unless it is specified as nonstandard. This is using the SqlClient
class
for access.

You can visit connectionstrings.com for more.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Luke Davis" wrote:
What do I have to change in the connection string to connect remotely to a
SQL 2005 Server?

(i.e. \\SQLSERVER becomes http://sqlserver.com:1433/)

I am outsourcing the hosting and there is some information that references
an internal database, any suggestions on the best way to make this happen?

Thanks

Luke Davis
Sep 12 '07 #2
What about an instance of SQL? sqlserver.com\SQLEXPRESS?

--
Luke Davis, MCSE: Security
DEM Networks - Senior Systems Architect
7225 N First, Suite 105
Fresno, CA 93720
Office: 1 (559) 439-1000
Fax: 1 (866) 640-2041
www.demnetworks.com

"Peter Bromberg [C# MVP]" <pb*******@yahoo.yohohhoandabottleofrum.comwrote
in message news:C2**********************************@microsof t.com...
>a typical remote machine SQL Server connection string would look like:

server=sqlserver.com;database=mydatabase;uid=user; pwd=pass;

You would normally expect the SQL server to use TCP connections, no port
is
necessary unless it is specified as nonstandard. This is using the
SqlClient
class
for access.

You can visit connectionstrings.com for more.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Luke Davis" wrote:
>What do I have to change in the connection string to connect remotely to
a
SQL 2005 Server?

(i.e. \\SQLSERVER becomes http://sqlserver.com:1433/)

I am outsourcing the hosting and there is some information that
references
an internal database, any suggestions on the best way to make this
happen?

Thanks

Luke Davis

Sep 12 '07 #3
Alright NEW PROBLEM!

I figured out it was still just the domain, I guess the instance does not
have to be requested, strange. But anywho, I'm getting this message now:
Login failed for user ''. The user is not associated with a trusted SQL
Server connection.

Any ideas of what I have to add to my database of accessible users to get a
remote IIS server to connect?
"Luke Davis" <lu**@gorealco.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
What do I have to change in the connection string to connect remotely to a
SQL 2005 Server?

(i.e. \\SQLSERVER becomes http://sqlserver.com:1433/)

I am outsourcing the hosting and there is some information that references
an internal database, any suggestions on the best way to make this happen?

Thanks

Luke Davis

Sep 12 '07 #4
"Luke Davis" <lu**@gorealco.comwrote in message
news:ef**************@TK2MSFTNGP03.phx.gbl...
I figured out it was still just the domain, I guess the instance does not
have to be requested, strange. But anywho, I'm getting this message now:
Login failed for user ''. The user is not associated with a trusted SQL
Server connection.

Any ideas of what I have to add to my database of accessible users to get
a remote IIS server to connect?
What connection string are you using...? Are the userid and password
valid...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 12 '07 #5
You probably need to specify a username and password for the connection. The
reason is, otherwise you're using a trusted connection which basically means
the connection you are making comes under the account that the code is
running under. This could be one of several accounts depending upon the web
server. Those accounts must be given writes within SQL Server to login. I
don't like this approach as it's easy to give something like the ASPNet user
account way too much access to your database. The best resource for
connection strings is: http://www.connectionstrings.com/ Has pretty much
everything you'd want to know about connecting to a datasource in just about
any environment.
--
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Luke Davis" <lu**@gorealco.comwrote in message
news:ef**************@TK2MSFTNGP03.phx.gbl...
Alright NEW PROBLEM!

I figured out it was still just the domain, I guess the instance does not
have to be requested, strange. But anywho, I'm getting this message now:
Login failed for user ''. The user is not associated with a trusted SQL
Server connection.

Any ideas of what I have to add to my database of accessible users to get
a remote IIS server to connect?
"Luke Davis" <lu**@gorealco.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>What do I have to change in the connection string to connect remotely to
a SQL 2005 Server?

(i.e. \\SQLSERVER becomes http://sqlserver.com:1433/)

I am outsourcing the hosting and there is some information that
references an internal database, any suggestions on the best way to make
this happen?

Thanks

Luke Davis


Sep 12 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Etienne Charland | last post by:
Hi, there is an application running on a remote desktop (under Citrix ICA, but the same problem applies for RDC or PC Anywhere). Now, I want to send keys to the remote application from a local app....
5
by: GEL | last post by:
Hi, I want to open a new browser window, let the user use that window for several minutes, and when they close, I'd like to change the page displayed in the original window. According to...
3
by: Elp | last post by:
Hi, I have developped a Windows applcation (in C#) that allows, among other things, users to view and control the desktop of a remote Windows XP Pro machine. I have actually simply embedded the...
15
by: JJ | last post by:
A current requirement I am facing is the all business objects be stateless remote components hosted in IIS. I am partial to web services myself. However, it is insisted that IIS hosted remoting be...
4
by: Rohith | last post by:
I need to import dlls that are present in the remote machine. Its a dll written in C that exposes methods. I want to import that dll in my C# application. But that dll is not present in the local...
0
by: matvdl | last post by:
My asp.net application depends on obtaining allot of data from a remote application. This application is a bit of a monster and it is not an option to install it on the asp.net system. Note - the...
5
by: felecha | last post by:
I have a VB.Net application that runs as a Windows Service and monitors a MessageQueue on another machine. At times that machine will have to be rebooted, so I've been working on how to get my...
7
by: | last post by:
I'm writing an ASP.NET app, using Visual Studio 2003. VS is running locally on my laptop, but the web app is running on a remote server. My laptop is not in the domain. I do have a domain account....
5
by: idorjee | last post by:
hi guys, I'm trying to figure how to read a file from my other computer, and here is what i did. it doesn't work for some reason. i would really appreciate if you could help me with this. i get...
3
by: Yves Gagnon | last post by:
Hi, I try to debug a WCF hosted in a windows services on a serveur that is on an other domaine then my developpement machine. I tried many things without succes. Here is what I tried: First I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.