Connection Error for Accessing .mdf after setup - sql-server

I am building a Desktop App with local .mdf database in VB.NET,I am successfully using the software after installing it from the installer in my main machine where I developed the software via Visual Studio(i.e, naturally SQL Server is installed on that machine).
But When I tried to run the same installer in other machine without Microsoft sql server installed -it was installed successfully-BUT it failed while trying to connect to the .mdf database- giving the message as-
What should I do ? Is it only the Microsoft SQL server not insstalled-which is causing problem?
IF THIS IS THE CASE HOW CAN I HANDLE THIS SITUATION WHERE i MAY FIND MY CLIENT MACHINE SQL SERVER NOT INSTALLED?i.e. Should I modify the pre-requisites?(But I don't have the pre-requisite option of MS SQL Server in Installshield LE).

I got it, It was the sqlLocalDB which was needed as I was working with .mdf database files.I installed it from Microsoft site-the SQL Server Express LocalDB addon

Related

SQL Server Management Studio And Network Server Discovery

I just installed SQL Server Management Studio, version 18.9.1, on a Windows 10 system. The installed Management Studio cannot discover known SQL Server databases out on the network, so I cannot log into a SQL Server using SQL authentication.
Please note, the target SQL Server has been installed for a while, and is running fine. I am trying to access this SQL Server from a new workstation.
The SQL Server Browser is running on the SQL Server I am trying to reach.
I am confused as to what should be installed if what I installed is not correct. I'm also confused as to which services to check are installed after installation. It doesn't look like a SQL Agent or locator service was installed, after I installed SQL Server Management Studio.
Am I better off installing a development database and just not using it in order to get the locator service?

SQL Server database won't work on different PC

I've created a Windows Forms app with a SQL Server database file (.mdf) that works perfectly on my computer.
When I created the installer and I've installed it on a different PC the app stopped working and shows this error:
ERROR 50 Local Database Runtime error occurred. Cannot create an automatic instance
I've already installed SQL Server Express Management on the second PC, but the version is 11 and on my first PC I've 13
What can I do?
Local Database Runtime error occurred. Cannot create an automatic instance
Sounds like you need to install SQL Server Express Edition, the LocalDb package from SQL Server Downloads

How to connect to a local database in SQL Server Management Studio?

I have downloaded the SQL Server Management Studio (SSMS) 2016 to recover a huge .bak file which is an old backup of a database. But first of all I need to connect to a DB Server.
After install, I execute SSMS and it asks me to connect to a DB Server. I don't have any and I saw that it is possible to create a "local" db by typing only a dot '.' for Server Name and use Windows authentication.
It is not working; how to do it?
Open SSMS -> Connect
Server name: (LocalDb)\MSSQLLocalDB,
Choose Windows Authentication.
For a reference:
You need to download and install SQL LocalDB. It is a special edition of SQL Server that does not allow remote connection and supports windows integrated authentication only. It is a simple one click MSI install so it is easy to deploy.
To download and install SQL Server 2016 Express, go to SQL Server
downloads. LocalDB is a feature you select during installation, and is
available when you download the media. If you download the media,
either choose Express Advanced or the LocalDB package.
The above means that now you have to download and run a small downloader (cca 5 MB), select LocalDB (44 MB) and the Microsoft downloader will download MSI package to the folder you select. Then just run MSI package and LocalDB gets installed.
To recover your Dump, you need one server where your dump will get uploaded.
For this you need one MS server. you can connect to server using username and password. After connection to server you can create a DB in which you want the dump to get imported.
If your SQL dump contains create Database statement, then you don't need to create one.
If its possible to open SQL dump in text file, you can see Database name required to create or its already have statement to create DB.
In my case, solution was using my notebook name and SQLEXPRESS like DESKTOPXPTO\SQLEXPRESS
I was able to connect to local host in ssms ,after downloading SQL server developer.
As mentioned in - https://learn.microsoft.com/en-us/sql/ssms/quickstarts/ssms-connect-query-sql-server?view=sql-server-ver16
Prerequisites
To complete this quickstart, you need the following prerequisites:
Install SQL Server Management Studio.
Install and configure a SQL Server instance
https://www.microsoft.com/en-in/sql-server/sql-server-downloads?rtc=1

Problem with creating .MDF file from Visual Studio 2010

I am trying to create a small wpf application by using mdf.
The problem is that when I am trying to add new service-based database (.mdf) I am getting the error "Connection to SQL Server database files (.mdf) require SQL Server 2005 Express or SQL Server 2008 Express to be installed and running on the local computer. The current version of SQL Server Express can be downloaded at the following url (link)".
The SQL Server 2008 is already been installed.
What am I doing wrong?
Check to make sure the SQLExpress service is running.
From a command prompt:
sc query mssql$sqlexpress
If the state returned is "1 STOPPED", then start the service with
sc start mssql$sqlexpress
Make sure the services are running on your box. The important ones will be SQL Server, and SQL Server Agent.

No services listed when SQL Server Express 2008 R2 Installed on local computer

I cannot get my local computer to run SQL Server. I looked in the SQL Server configuration manager and noticed that there are no SQL Server Services listed. That can't be right. I also noticed that There are two Managers listed in the SysWOW64 folder (I'm running Win7): SQLServerManager10.msc and SQLServerManager.msc. Neither show any services at all. When trying to connect via SSMSE, I get the standard:
A network related or instance specific error occurred while establishing a
connection to SQL server...
I haven't installed a prior version, but did try to uninstall and reinstall using the Web platform installer from Microsoft. Any suggestions?
Thanks
I had the same problem and as Brian said, I was missing SQL Server Express. So I download SQL Server 2008 R2 Express and I installed it. now everything works fine.
Note that I thought I already installed it when I installed SQL Management Studio R2. Now, be aware that when installing SQL Management Studio R2, you are not installing SQL Server and you won't get any SQL Server Services in your Sql Server Configuration Manager -> SQL Server Services. You also need to download and install SQL Server Express.
Is SQL Server listed in services? (Start->Run->Services.msc)
If so, is it running?
That is an instance error, meaning you cannot connect to the instance. Most likely there is no instance installed on this machine. Meaning your not connecting correctly to the instance. Connect to the database engine again and check the server name and make sure your connecting to the correct server name or the local host, depending if this is a local machine or if this is on a server. Go back through setup and see if there are any features that didn't get installed. Try that and see if it works. If not then reinstall SQL Server and make sure all folders are removed and nothing is left behind before you reinstall.

Resources