Why i can not create Database Connetion

it shown this message!!
Connection Error:
Data Source=Mr. DAY; User Id=sa; Password=asi2015; Database=SambaPOS5;

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

How can i solve these issue

Its pretty self explanatory. Do you have SQL Express installed and is it running? Look here for a good tutorial.https://kb.sambapos.com/en/2-1-6-how-to-run-sambapos-on-multiple-computers/

It appears you dont have SQL Express installed, dont know how to login to it, the service is not started, or you have a firewall blocking it. Give us more information to work with… are you using a terminal connecting over network or is the database on the same machine?

1 Like

Pretty sure you Data Sourse wont be just ‘Mr. Day’ for one.

Here is an example of a typical connection string when running SQL Express, most are whatever you set though.

Data Source=localhost\SQLEXPRESS; User Id=sa; Password=sambapos; Database=SambaPOS;
OR
Data Source=PCHostingSQLDatabase\SQLEXPRESS; User Id=sa; Password=sambapos; Database=SambaPOS;

The first one having localhost as is same machine as SQL database, the other is for a remote computer.

Either way you need to give us more info if you want us to offer suggestions.

Do you think your running SQL Express.
Single Terminal or Multi Terminal.
Is this on the DB/SQL machine or client machine.
The list goes on but were not just going to sit and keep making wild stabs in the dark as to your issue as we cannot tell purly from what you have said so far.

1 Like

@JTRTech actually just a computer name is fine, if you installed SQL Express as default instance. The default however is “named instance” of SQLEXPRESS. Personally I usually set it in installer to default instance so I don’t need to specify an instance name.

1 Like

@Sunday_Thuok I am pretty sure this is wrong - a computer name cannot contain spaces. Check your computer name in windows settings. In Windows 10, go to Settings then System > About. You will see your computer name as “Device Name”.

5 Likes

Thanks so much! Now i can do it!

1 Like