Access data from Microsoft SQL Server into Unity3d - sql-server

We have spent more than a couple of days on this have gone though almost all available threads online but nothing has worked so far.
We are using Unity Version 2019.2.1 and Visual Studio 2019 Community Edition.
We have already tried the following:
We have tried using Entity Framework model using both ObjectContext and DataContext and in both ways the app.config file and .edmx file are lost when we reload the solution
We have also tried using legacy SqlConnection using System.Data and System.Data.SqlClient namespaces by copying the dlls into the Plugins folder
We have checked and double checked all SQL Server configurations, ports, authentication, etc. and use SQL Server on day-to-day basis for our other projects.
Can someone please point to any working sample / example / video / article on how to access data from Microsoft SQL Server in Unity3d?
Thanks in advance!
Regards,
Swapneel Shah

Check this for Connect to MS SQL database:
https://forum.unity.com/threads/connect-to-ms-sql-database.484855/

Related

Visual Studio ADO.NET missing

I would like to connect my Visual Studio 2013 project (Windows 8.1 app, x86) to an external SQL Server database to get, visualize and set some values. Therefore I found out that I need to use ADO.NET.
Unfortunately the related template in Visual Studio seems to be missing. So I googled that problem and found some solution possibilities (reset visual studio settings and user data, reinstall Visual Studio, run newest version of EFTools,...), but nothing could help me. I tried for hours now...
So what could be the problem here? I have installed VS13 Ultimate from MSDNAA. Why are the templates missing? Is there another easy way to access the external SQL Server database?
Thank you very much!
edit:
It seems to be that a so named "Universal App" doesn't support ADO.NET (for other projects I easily can add an "ADO.Net Entity Data Model". What else can I do to access a SQL Server database? What is the right way in such case?
Most convenient way to implement database access would be with EntityFramework as you figured out already. What marc_s meant is that for your app, you cannot implement it directly in this type of the project.
Implement your Data Access Layer in a separate project of Class Library and expose the data using either WCF or WEB API projects (your services layer) that will make use of he DAL. For both Entity Framework and for services there are numerous tutorials all over the internet. When your services are working (and tested!) you just add a reference to your universal app and call the services from there. That way the database access is isolated from the application and all the vulnarable and time consuming logic stays on the server side.
P.S. Services and DAL does not need to be kept in the same machine as the database, however it's recommended to keep it in the same network.

How to deploy SQLServer CE for VSPackage?

I like to deploy SQLServer CE privately on my VSPackage application.
I already tried the following information:
Using Entity Framework with an SQL Compact Private Installation
as well as this one:
How to deploy SQL Server Compact Edition 4.0?
But I still get the following exception message:
The specified store provider cannot be found in the configuration, or is not valid
I guess the above methods do not work for me because my VSPackage will appear as a DLL, while the above methods work for an .EXE application.
Any suggestion how can I do it?
Thanks
Most likely, Visual Studio cannot find and load one of SQL Server Compact Edition assemblies. By default, Visual Studio don’t look dependent assembles in a VSPackage folder if VSPackage code have not explicit reference to such assembles. I described several ways to solve this problem here. Hope it help you.

Entity framework code first not creating database in vs2010

I’m new to vs2010 and the entity framework (and ASP.NET MVC as well....I’m from a winforms vs2005 background) as well as the azure platform and am starting a project using these technologies soon.
I’ve installed vs2010 and the windows azure sdk kit for vs2010 and am running through this tutorial, Deploying an ASP.NET Web Application to a Windows Azure Cloud Service and SQL Database.
http://www.windowsazure.com/en-us/develop/net/tutorials/cloud-service-with-sql-database/
I’ve got as far as the ‘Add SQL support’ section, followed the instructions and when I compile and run no database is being created.
And I’m using sql server 2008 r2.
Any ideas why this is the case? Nothing at all is being shown in the sql server log. My connection details look fine, am I missing some kind of add on or some permission settings need changing?
Cheers,
I've sorted this myself. If you wish to know the answers I've posted them in the comments on the tutorial page, just follow the link (names Mathew in the comments section).
http://www.windowsazure.com/en-us/develop/net/tutorials/cloud-service-with-sql-database/

Installation project dynamic connection string

I have a windows forms application, that i want to deploy as installation project using visual studio 2010.
I am using SQLite database and i want to create a connection string while the installation to the installation directory.
On the other hand, i do not know should i attach my empty database to the install project or i have to create it while the installation?
I found lot of web sites, but none of them helped.
Thank you in advance all the help and please refer helper links in this topic.
Here is a tutorial which can get you started:
http://support.microsoft.com/kb/307353
Visual Studio is very limited when it comes to the setup project features. It doesn't support SQL connections, so you can do it only through a custom action.
If you need advanced features (like an SQL connection), I recommend a different setup tool:
http://en.wikipedia.org/wiki/List_of_installation_software

Browsing an Entity Framework code-first database + Azure Dev Fabric

I have a database created using the code-first approach against SQL Server Express. I'm trying to view the database in Management Studio, but cannot find the database. VS Database Explorer also cannot seem to find it.
I've searched about but cannot find any reference to what I'm after. Is it possible to browse a database running in the dev fabric?
Usually if we create a new database in Visual Studio, it will give us a database file, but it won’t register the database in SQL Server Management Studio. So please manually attach the database file to SQL Server Management Studio. First please find the database file, normally it is under the AppData folder of our project. Then I would like to suggest you to check http://msdn.microsoft.com/en-us/library/ms190209.aspx for instructions on how to attach the database.
Best Regards,
Ming Xu.
Take a look at Scott Gu's blog post on EF Code First and DB Generation: http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx
The Azure Dev Fabric has nothing to do with the DB layer, the connection string handles all this for you i.e. when you deploy to SQL Azure your DB will go there, the only thing that needs changed is the connection string...from localhost (Dev Machine) to SQL Azure connectionn string
HTH

Resources