can't connect to the database server from the client - c#

I am creating a window application with a SQL server database. The application need to be installed on a terminal server and other client machine should works with this application.
I have installed this application and SQL Server Express 2008 on server and application worked currently on server but not on client. I got an error on client machine through my application over connecting to the database on server.
Any help is appreciated.

The default installation of SQL Server Express is to allow only local connection.
See this: http://technet.microsoft.com/en-us/library/ms165718(v=sql.105).aspx

Related

How can we sync data in SQL Server 2012 Express?

We have application sage 300 ERP (Accpac) with SQL Server 2012 Express Edition, this is desktop application.
This application is hosted on a cloud system; they have provided public static IP. Client is working on cloud using Remote Desktop Connection (RDP).
The issue is that when Internet is down then client not able to access application so we have decided to install on his local machine with database.
If internet is down, then he is using local database but client wants if internet is up what he has worked that should be synced with cloud database and what other user worked on cloud that data should be synced. i.e both side data should sync.
Please help me.

Remote connection to SQL Server 2005. "Login failed for user" or at least SEND information to other computers through WinForm app?

I have a program that installed a server (SQL Server 2005 it seems). I have patiently read quite an amount of documentation on debugging a remote connection to SQL Server 2005 but I cannot reach an end point without your help. Also I'm running out of time..
Anyway here are the details:
Program that needs to access SQL: WinForm application
Firewalls status: Antivir Firewall and Router Firewall off (for the moment)
IPv4 Address: 192.168.1.2
SQL Server 2005 with Management Studio Express,
Code I use to access the server:
sqlConnection = new SqlConnection("user id=GEN; password=asd; Network Address =
192.168.1.2\\SERVER_INSTANCE; Trusted_Connection = yes; "database=DATABASE_NAME;
connection timeout=30");
try {sqlConnection.Open();}
catch(Exception c) {aTimer.Stop(); MessageBox.Show(c.ToString());}
Posting an image below with useful info from the server program:
EDIT: Since there doesn't seem to be many solutions, I'm also open to suggestions if I can SEND information from the WinForm on the Server, to other computers in the LAN
EDIT Attempting to upgrade the SQL Server version. (Seems that my 2005 version is not SP4.. so says the 2012 version when upgrading)
Login failed for user, means that it is actually able to connect to SQL Server, but it is being denied access. Usually this is because of an incorrect username/password combination or a lack of required permissions.
Check SQL Server permissions for the desired user (If you are using windows auth).
Furthermore, SQL Server logins are not the same as Windows users. When it asks for server authentication you must login using a user created in SQL Server, not a Windows user.

SQL Server database on Client machine

My application contains a SQL Server 2008 R2 database.
If I want to install the application on some client's machine, do I need to install the SQL Server 2008 R2 database as well?
Or is there any shortcut to access to database without installation?
You do not have to install sql server on every machine that you want to run your client on, but it has to be installed in at least one place, and each client has to be able to access one sql server, possibly via the internet.

I cannot display data from sql server 2005 express on an ASP.net website running from IIS windows 7

I am using Microsoft server 2003 running sql server 2005 which I have added an asp.net website on IIs.This works perfect. I can display the website on the browser and also read information from the sql server. My problem now arises when I want to do exactly the same but with my laptop which is running sql server 2005 express on windows 7. the websites displays just fine on the localhost but when I login it gives me an error saying that it cannot read files.
So my question is that is there a difference between sql server connectionstring and sql server express connection string? or the error is not connectionstring related?
Yes, the connection string for SQL Server CE is typically different from SQL Server. SQL Server CE is "self hosted." You basically connect to a file in your app_data directory. SQL Server, in contrast, has many ways to connect to it: via TCP/IP, Named Pipes, etc.
A typical SQL Server connection string is this:
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
A typical SQL Server CE connection string is this:
Data Source=MyData.sdf;Persist Security Info=False;
Notice how for SQL Server CE you specify the path to your database file. For SQL Server, you typically specify the server running the SQL Server Service.
Many more examples here.

Client computer cannot connect to the database of the c# .net application

I connected my database as a (sql server database file) to mt c# .net application.
the connection string was given as a relative path. the client computer asks for sql express server, what should i do? which application should i install in the client pc?
You need to supply the correct connection string, with the database server name.
If the application is supposed to connect to a local database (on the same machine as the application), you need to install SQL Express and setup the database on the client machine.

Categories