473,698 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1423
a typical remote machine SQL Server connection string would look like:

server=sqlserve r.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 connectionstrin gs.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\S QLEXPRESS?

--
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*******@yaho o.yohohhoandabo ttleofrum.comwr ote
in message news:C2******** *************** ***********@mic rosoft.com...
>a typical remote machine SQL Server connection string would look like:

server=sqlserve r.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 connectionstrin gs.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******** *******@TK2MSFT NGP06.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******** ******@TK2MSFTN GP03.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******** ******@TK2MSFTN GP03.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******** *******@TK2MSFT NGP06.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
10222
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. I tried sending keys in VB with SendKeys, as well as using keybd_event API, but I'm not able to send any keys. It works very well for any local applications, but I can't pass the keys remotely. Is there any way to do it? Thanks! Etienne
5
6950
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 numerous articles found Googling, this should work, but on my WinXP system, using Firefox and IE, I get nothing (when allowing pop-ups, if pop-ups are disabled, IE reports the window is closed, Firefox gives a JS error on checking the window handle). No...
3
6373
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 Remote Desktop ActiveX control in my C# app and this works fine. However i have now a new requirement for my app: multiple users have to be able to view and control the same remote desktop simultaneously using my application. Big problem:...
15
2077
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 used. They insist that it is much, much faster. I don’t necessarily disagree with that point. But under the circumstances, a web service that is load balanced (as are the remote objects), though technically slower, would still have a lot of...
4
4677
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 machine. Its not a webservice. I need something like remote method invocation(but dlls).
0
1472
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 remote application is developed in vb6 Currently I have the application installed on a number of remote computers and use DCOM from asp.net to communicate with this application. All the calls to this remote application are generally kept to a...
5
5748
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 Service to re-establish the connection after the remote machine is back. I found that as soon as the remote machine goes down, the BeginReceive() method and the ReceiveCompleted() event handler start throwing an exception, for QueueNotAvailable,...
7
2589
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. I had no issue creating the web app on the remote server after authenticating with the domain account, but I can't debug. It complains that I don't have rights. My domain account is in the administrators group on the remote machine. I also have...
5
6286
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 this error message: Open failed at local: No such file or directory thank you. use File::Remote;
3
6624
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 installed on the server I want to debug, the remote debugger tools from the VS 2005 CD. I just install the windows application. I tried from there to debug, without succes. I could connect to the remote machine only when the msvsmon.exe is in the...
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.