Cannot setup remote connection to SQL Server 2008 R2 - sql-server-2008r2-express

I've installed the server on a windows 7 64bits PC, the download from MS was for SQL Server 2008 R2 Express x64 with management tools. Firewall is open port 1433 for SQL Server and Management Studio (just in case). All SQL Server services have been configured (including named pipes and TCP/IP and point to the correct port).
From the configuration tool I cannot start SQL Server agent.
When I try and start Management Studio the login fails (windows auth and SQL Server auth)
All the solutions that I could find to a problem similar to mine involves starting Management Studio and enabling remote connection.
If I could this either programmatically (c#.net / ado.net) or modify a key in the registry I would be a happy camper
Thanks in advance
Paul

Related

Create setup file with SQL Server database in VB2010

I made a demo project in vb2010 using database interaction with SQL Server 2008 R2. Created a setup file for that project and installed and executed successfully on my PC. Copied that setup file on another PC and tried installing. But couldn't run it because SQL Server 2008 R2 was installed in that PC.
My question is that how can we create a setup file with database so that we need not install SQL Server 2008 R2..? Because, let's assume that I am developing a software for my client. What if my client doesn't have SQL Server installed on his PC? It will be useless to install the whole SQL Server for a small application. How can we achieve that?
It will be useless to install the whole SQL Server for a small application.
That's exactly right. Sql Server is not intended for use as a private data store for a single-user desktop application. If that's what you want, you can use Sql Server Compact Edition, Sql Server LocalDB, Sqlite, or even ~gasp~ MS Access. But don't use the full edition of Sql Server; not even Sql Server Express Edition. The full version of Sql Server is just that: a server, intended for use in a shared environment where you have many users talking to the same data source.

Deployment error in WIndows XP [ERROR: SQL Server Database is not installed or not running]

I have developed a POS System Recently and workin on its deployment.
Application Specifications:
The application is basically a POS system.
Back end = SQL Server 2008 Express R2.
Front End = C#
I also used SMO libraries.
Deployment Method = Click-once.
Target Framework = 4.0.
Development Tool = Visual Studio 2012 RC.
OS = Windows 7 Home Premium.
Used some SQL feature packs like Shared management Objects, CLR types. and others.
The prerequisites are selected and i packaged them also.
In brand new windows 7 the installation was fine. and application is running upto date.
In win XP the installation is fine. but when i start the app. it colses with this error.
SQL Server database is not installed and or not running.
and application quits.
IMPORTNAT NOTE:
THE 'WINDOWS XP SP3 PROFESSIONAL'
ON WHICH I AM TESTING IS INSTALLED ON VIRTUAL MACHINE
In the code i am running some SMO library functions in order to install *.sql script for the application's first time use.
SQL Server 2008 R2 is installed with all of its dependencies. and other feature packs. All the prerequisites are installed on XP.
Can you run SQLServer Management Studio on the XP VM and see SQLServer? If you run the SQLServer Configuration Manager on the VM, and click on SQL Server Services, does it show the service is running?
How do you have the connections configured? Do you have named pipes and TCP/IP enabled for the SQLServer Network configuration? What about the SQL Native Client configuration?
Do you have SQLServer Express ticked as a prerequisite in the ClickOnce deployment? What happens if you run setup.exe? Does it recognize that it's installed?
The SQLServer Express that's installed -- is it a named instance, or did you leave it as ".\SQLExpress" ? Id the connection string being used by the ClickOnce application right?

How is Visual Studio 2010 connecting to SQL Server 2008 if I don't have the native client installed?

I have MS VS 2010 installed on my Windows 7 but, I don't have the SQL Server Native client installed in it.
After loading Visual Studio I do click menu Data / Transact-SQL Editor / New Query Connection.
The SQL Server 2008 R2 login dialog will show up, I type server name, select SQL Server authentication, type username and password and click connect. The connection is established and an editor window shows up and I'm ready to query!
I understand the SQL Server 2008 native client files are sqlncli10.dll, sqlnclir10.rll. I did search for these files in my entire hard drive and they weren't found.
So, how is Visual Studio 2010 connecting to SQL Server 2008 if I don't have the native client installed?
Is VS 2010, when connecting to SQL Server 2008, using .NET Framework assemblies?
The .NET Framework already contains the Sql Server (and other) Database clients.
Have a look at System.Data.SqlClient
If NO native client is installed, Visual Studio 2010 is using the .NET Framework version 4.0 to connect to SQL Server 2008 R2 when connecting through menu Data/Transact-SQL Editor/New Query Connection.
I verified and it is loading assembly System.Data.dll (located under C:\Windows\Microsoft.NET\Framework\v4.0.30319) to establish the connection to the server.
I have not installed the Native client 10.0 for SQL Server 2008 R2 and I'm not using it right now but, if installed, the native client files (sqlncli10.dll, sqlnclir10.rll, and s10ch_sqlncli.chm) should be found under
%SYSTEMROOT%\system32\
which are installed as part of the SQL Server installation.
There is also a redistributable installation program named sqlncli.msi, which should be found on the SQL Server installation CD under
%CD%\Setup\
The reference for installation details
http://msdn.microsoft.com/en-us/library/ms131321.aspx
And the reference for the SQL Server 2008 R2 Native Client Features
http://msdn.microsoft.com/en-us/library/ms131456.aspx
The key piece of information here is:
You do not need to install SQL Server Native Client on your client machine (in this case your dev box where Visual Studio is), in order for an application using ADO.Net, to connect to SQL Server.
The reason is as #dknaack said: the .Net framework contains the code required to make the connection. This is contained in System.Data.SqlClient.
SQL Native Client on the other hand is used by unmanaged applications to connection to SQL Server via either OleDB or ODBC providers.
In short:
System.Data.SqlClient - used for connections from managed code to SQL Server i.e an ADO.Net connection
SQL Server Native Client - used for connections from unmanaged code to SQL Server
Whilst you CAN connect to SQL Server from a managed app using SQL Server Native Client, it is not a recommended practice:
If you are developing a new application, it is recommended that you
consider using ADO.NET and the .NET Framework Data Provider for SQL
Server instead of SQL Server Native Client to access all the new
features of recent versions of SQL Server.
References:
https://learn.microsoft.com/en-us/sql/relational-databases/native-client/sql-server-native-client-programming?view=sql-server-2017
https://learn.microsoft.com/en-us/sql/relational-databases/native-client/applications/using-ado-with-sql-server-native-client?view=sql-server-2017

SQL Server 2008 (express edition) Configuration - with Active directory

I have 3 computers. I have installed windows server + Active Directory on one pc. There are two other PCs registered with active directory. Those two PCs have installed SQL server(express) 2008 and Visual Studio 2010 separately. Here is my network. :)
Now I want to communicate with SQL server to access db through my development machine. Do I have to install SQL in that machine too ?
How ever I need to use PC1 as my SQL server machine.
How do I connect to SQL db located in PC1 from PC2 ??
Thank You!!
Answers to your question
Now I want to communicate with SQL server to access db through my development machine. Do I have to install SQL in that machine too ? No
How do I connect to SQL db located in PC1 from PC2 ?? on your config file use this as the connection string.
Data Source=PC1Name\SQLEXPRESS;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
But if you want to view the data on PC1 without Visual Studio you need at least the SQL Server Management Studio Management Tools. If your useing express by default it is installed as an instance thats why the data source on the connection string is PC1Name\SQLEXPRESS. Usually the instance name is SQLEXPRESS.

SQL Server 08 Express Installed: But how to make a local database?

I try to connect to 127.0.0.1 with Windows Authentication using Management Studio Express 2008 but it never connects says it can't find the server or something. I ran the SQL Server Express 2008 Installer and it said that it was already installed but I can't find any wizard or shortcut to start up anything that will allow me to actually start setting up a local database, what gives?
(Windows 7 x64)
Services were off, turned them on, still not connecting to (local) because of an error: Error 40 could not open a connection to sql server error: 2
NOTE: Turned of windows firewall, same error! everything is local... services running, firewall down, tcp/ip enabled in config... hmm...
Typically, SQL Server Express will install into a "named instance" called SQLExpress.
Try connecting to:
(local)\SQLExpress
.\SQLExpress
(local) as well as just a dot "." stand for the local machine, and \SQLExpress is the default named instance name for SQL Server Express installations.
Have a look at the SQL Server Surface Area Configuration tool that should have been installed with Studio Express. If you use that you should be able to find the settings for Remote Connections. It may be that you have TCP/IP connections turned off (I can't remember what the default is) and only named pipes are available. If that's the case you can either turn on TCP/IP or try connecting using your machine name in Management Studio.
ensure you have your firewalls allowing access then connect to (local) including parenthesis

Resources