none
Why does my project not work on computers that does't have sql installed? RRS feed

  • Question

  • So i have created a little program in c# that uses sql, it does not connect any internet based place, its completely local and the uses mdf file type. This is the first time i worked with sql so i don't know if this is normal or not but it gives this error when its opened at a pc that does not have sql:

    Weirdly enough the path at bottom isn't the programs run path its the debug path but even though that other computer never ever had the debug files it still able to show my personal info (folder names).
    Also i don't know if this changes anything but the program is 32bit because i can't use 64bit due to an extension.

    Is there an way to bypass this without installing sql to everyone that wants to use this to their pc?

    Tuesday, August 6, 2019 9:56 PM

Answers

  • Its quite tempting to just send a "yes :)" but i should really fix this instead of playing around.

    I genuinely don't know much about databases and its a miracle i got this far. Most of things i readed was about non-local databases thus i made a local database using knowledge for non local databases.

    Should i make this server thing or is there a way around?

    What is a server for an local database?

    Also why the error message giving my path instead of the path of the computer that's running it?

    And is this fixable without installing sql to every computer that runs this?

    Hi :-)

    Forums are not a place to learn new topics but a place to get help when you learn new topic and has specific question. I am not sure that you got so far. It sounds like an elementary school student who comes to university to learn about quantum mechanics before he learned arithmetic. You should stop read short posts and focus on learning the topic from start to end in an ordinarily way, or you will probably going to spend much longer time with a lot less understanding.

    I HIGHLY recommend you to find a course (online or offline) and follow it in an ordinarily way.

    ----------- Let's start with the basic NOT in an ordinarily way ------------

    SQL Server is a server application, which mean that it provides services to clients that connect with it. The clients are applications in this case.

    Note! Think for example about another server which you use for many years every day - a web server (like IIS). In this case the clients are the browsers which you use in order to connect to the server to get the web page information (HTML code for example).

    There can be multiple of clients which use the same server. By default, SQL Server allows a maximum of 32767 simultaneously concurrent connections. In reality, even the most active applications with thousands of users at any given moment, usually do not use more than 100 connections, since each client actually connect the server for a very short time. Clients can be on the same machine or in different machine.

    When a person want to use the server, then he use a client application .In this case I assume that you want to develop the client application using C#.

    You cannot use something if it does not exists.

    ----------- Databases -----------

    There are multiple types of databases. Even a simple text file can serve as a database.

    Database server is a Database management system (software server application), which enables users to define, create, maintain and control access to the database.

    There are Database management system which are embedded into the application and does not require separate installation (their code added to the application code). This is not the case with SQL Server which you need to install in order to use it (Microsoft had such application named "Microsoft SQL Server Compact" but it was deprecated on 2013 and there are no new versions).

    Therefore, if you want to use SQL Server then you need to install SQL Server

    ----------------------------------- 

    >> Should i make this server thing or is there a way around?

    Obviously there is a way around. not to use something that does not exists. You can work around installation by using other databases which are embedded to the application or simply get external service from someone who provide the service (for example you can use SQL Server service on the azure without the need to install it on your machine)

    >> What is a server for an local database?

    Database server is a Database management system (software server application), which enables users to define, create, maintain and control access to the database.

    >> And is this fixable without installing sql to every computer that runs this?

    I have no idea what is "this" which you want to run. SQL Server is a server service application, which can serve a lot of different "this" from different places, just like a web server can serve multiple browsers.

    YOU SHOULD LEARN IN ORDINARILY WAY IN A COURSE AND NOT IN THE FORUM!


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]


    Wednesday, August 7, 2019 8:18 AM
    Moderator

All replies

  • So i have created a little program in c# that uses sql, it does not connect any internet based place, its completely local and the uses mdf file type. This is the first time i worked with sql so i don't know if this is normal or not but it gives this error when its opened at a pc that does not have sql:

    Weirdly enough the path at bottom isn't the programs run path its the debug path but even though that other computer never ever had the debug files it still able to show my personal info (folder names).
    Also i don't know if this changes anything but the program is 32bit because i can't use 64bit due to an extension.

    Is there an way to bypass this without installing sql to everyone that wants to use this to their pc?

    Let me see if I understood you correctly, please confirm:

    1. You try to connect from your application to SQL Server locally (without using any internet using SQL Server on the same machine).
    2. You know that you do not have SQL Server installed but yet you want to connect it
    3. You explicitly get error which say "the server was not found", and you know that the server could not be found, since it is not installed
    4. and you ask why you cannot connect the server which is not exists
    5. In addition you do not provide any code and you want us to tell you what is wrong in your code which we cannot see

    Did I summarized the issue correctly?


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]


    Tuesday, August 6, 2019 11:07 PM
    Moderator
  • Its quite tempting to just send a "yes :)" but i should really fix this instead of playing around.

    I genuinely don't know much about databases and its a miracle i got this far. Most of things i readed was about non-local databases thus i made a local database using knowledge for non local databases.

    Should i make this server thing or is there a way around?

    What is a server for an local database?

    Also why the error message giving my path instead of the path of the computer that's running it?

    And is this fixable without installing sql to every computer that runs this?

    Tuesday, August 6, 2019 11:23 PM
  • Its quite tempting to just send a "yes :)" but i should really fix this instead of playing around.

    I genuinely don't know much about databases and its a miracle i got this far. Most of things i readed was about non-local databases thus i made a local database using knowledge for non local databases.

    Should i make this server thing or is there a way around?

    What is a server for an local database?

    Also why the error message giving my path instead of the path of the computer that's running it?

    And is this fixable without installing sql to every computer that runs this?

    Hi :-)

    Forums are not a place to learn new topics but a place to get help when you learn new topic and has specific question. I am not sure that you got so far. It sounds like an elementary school student who comes to university to learn about quantum mechanics before he learned arithmetic. You should stop read short posts and focus on learning the topic from start to end in an ordinarily way, or you will probably going to spend much longer time with a lot less understanding.

    I HIGHLY recommend you to find a course (online or offline) and follow it in an ordinarily way.

    ----------- Let's start with the basic NOT in an ordinarily way ------------

    SQL Server is a server application, which mean that it provides services to clients that connect with it. The clients are applications in this case.

    Note! Think for example about another server which you use for many years every day - a web server (like IIS). In this case the clients are the browsers which you use in order to connect to the server to get the web page information (HTML code for example).

    There can be multiple of clients which use the same server. By default, SQL Server allows a maximum of 32767 simultaneously concurrent connections. In reality, even the most active applications with thousands of users at any given moment, usually do not use more than 100 connections, since each client actually connect the server for a very short time. Clients can be on the same machine or in different machine.

    When a person want to use the server, then he use a client application .In this case I assume that you want to develop the client application using C#.

    You cannot use something if it does not exists.

    ----------- Databases -----------

    There are multiple types of databases. Even a simple text file can serve as a database.

    Database server is a Database management system (software server application), which enables users to define, create, maintain and control access to the database.

    There are Database management system which are embedded into the application and does not require separate installation (their code added to the application code). This is not the case with SQL Server which you need to install in order to use it (Microsoft had such application named "Microsoft SQL Server Compact" but it was deprecated on 2013 and there are no new versions).

    Therefore, if you want to use SQL Server then you need to install SQL Server

    ----------------------------------- 

    >> Should i make this server thing or is there a way around?

    Obviously there is a way around. not to use something that does not exists. You can work around installation by using other databases which are embedded to the application or simply get external service from someone who provide the service (for example you can use SQL Server service on the azure without the need to install it on your machine)

    >> What is a server for an local database?

    Database server is a Database management system (software server application), which enables users to define, create, maintain and control access to the database.

    >> And is this fixable without installing sql to every computer that runs this?

    I have no idea what is "this" which you want to run. SQL Server is a server service application, which can serve a lot of different "this" from different places, just like a web server can serve multiple browsers.

    YOU SHOULD LEARN IN ORDINARILY WAY IN A COURSE AND NOT IN THE FORUM!


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]


    Wednesday, August 7, 2019 8:18 AM
    Moderator
  • Should i make this server thing or is there a way around?

    What is a server for an local database?

    And is this fixable without installing sql to every computer that runs this?

    To get the answer of these questions, you need to know what you want.

    Sometimes people develop applications which are intended to run on the same computer on the database, using Express Edition or localdb. In these cases, SQL Server and the database must be on each machine.

    But for larger application, SQL Server typically runs on a dedicated server. The application may have the address to the database server or hardcoded (or read it from a configuration file.) But it may also prompt the user to enter server and database. Which permits users to alter between different environments, for instance production and test.

    Also why the error message giving my path instead of the path of the computer that's running it?

    No idea, but that seems like a .NET question.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Wednesday, August 7, 2019 9:27 PM
    Moderator
  • Thank you two very much for explaining this to me with quite the detail, from what i understand the program wasn't even supposed to have databases, i just said to myself "You know what im bored of creating text files as saves, im gonna make a database for once!" at the time and just go forward to that way without any consideration or looking back, in fact not even looking at sides. It's completely my mistake for being blindly pointed towards to a single way and having nonsensical determination on this task.

    But hey, i got quite the knowledge out of this :) Even though i have the scrap the code and rewrite it was a nice experience and a lesson to learn; go with the ordinary way and don't rush yourself to learn.

    So thank you for everything!


    • Edited by xanrer Thursday, August 8, 2019 12:28 AM forgot a little thing
    Wednesday, August 7, 2019 11:35 PM
  • You are most welcome :-)


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]

    Thursday, August 8, 2019 2:59 AM
    Moderator