Quantcast
Channel: Questions in topic: "sqldatabase"
Viewing all 146 articles
Browse latest View live

I already made a ar app which deploys flag, i want to upgrade it to make the flag stay there at the exact geo location

$
0
0
I have already made and published an AR APP which allows the user to spawn a flag in the real world but, I want to upgrade the app in such a way that when I deploy the flag it stays there at the exact geolocation and when another user opens my app and camera he can also see the flag placed there, I want to know how to save SQL and upload it and everything required to do so.

Can I use Entity Framework in a Unity project built for iOS and Android?

$
0
0
Hi all :). I'd like to know if I can use [Entity Framework Core][1] in Unity projects built for iOS and Android. I know that EF core (as opposed to EF standard) is the one to be using for iOS and Android development however I can't find online whether Unity supports this. Does it? I've found a page regarding the [.NET implementations supported by EF Core][2]. However I'm not sure if this means that Unity will or won't support it. Any help you can provide will be greatly appreciated! Thanks. I have also posted this question on [Unity Forums][3]. [1]: https://github.com/aspnet/EntityFrameworkCore [2]: https://docs.microsoft.com/en-us/ef/core/platforms/index [3]: https://forum.unity.com/threads/can-i-use-entity-framework-in-a-unity-project-built-for-ios-and-android.616507/

Building a dedicated server for multiplayer

$
0
0
Hello all, I'm new to building a dedicated server for multi player. My multiplayer is very simple and based on uni-directional information transformation what is called pockets I believe I want to use TCP connection. I found a tutorial that uses MySQL for writing a server. The tutorial can be found [HERE][1] I have a few questions: Is there a free software for using SQL? I found these: Workbench or DBeaver or Oracle SQL Is there a preferable of for using with Unity? [1]: https://www.youtube.com/watch?v=FY1QLjj2nwY

SocketException: No connection could be made because the target machine actively refused it.

$
0
0
I'm trying to connect to a database but I continue getting the error shown in the title. I have my backend services separated from the Unity client side and have the backend dll added into the Assets folder. I know that I'm hitting my backend methods because I'm logging a message when I get into the method. I have my SQL Server running locally with the authentication being Windows Authentication. So my question is, why can I not hit the database? I'm using the latest version of Unity 2018.3.12f1. Here's my client side code that triggers on a button click. public class User : MonoBehaviour { public void Login(){ var meh = new DBStuff(); meh.Login(); } } Here's my backend service that makes the db connection public class DBStuff { private const string _connectionString = "Data Source=localhost;Initial Catalog=Players;Integrated Security=True;Pooling=False"; SqlConnection _db; public void Login() { //Hit's the loginservice Debug.Log("Here"); _db = new SqlConnection(_connectionString); _db.Open(); } } Can anyone shed any light on why I'm getting this error and how I might go about fixing it? Thanks.

SqlException: System.Net.Security.Native

$
0
0
I'm receiving this error in unity while trying to connect to my SQL Database. I'm assuming that it has something to do with a missing dll but I'm not sure. Can anyone explain to me what this error is indicating and what I need to do to fix it?![alt text][1] [1]: /storage/temp/136381-capture.png

Entity Framework with Unity 2018.3.12f1 - System.PlatformNotSupportedException: LocalDB is not supported on this platform.

$
0
0
I am currently trying to integrate Entity Framework (with embedded SQL Server) into Unity project. My steps are next: 1. In external solution I install EF 6 via NuGet, create simple DbContext and code configuration file. Target platform is 4.7.1, because Unity doesn't support 4.7.2. 2. I test it in a console application and everything works fine. 3. Then, I copy files from build folder to Plugins. 4. Trying to run the same code in Unity. ---------- When I am trying the first time to get DbSet the exception is thrown: ---------- *System.PlatformNotSupportedException: LocalDB is not supported on this platform. at System.Data.ProviderBase.DbConnectionPool.TryGetConnection (System.Data.Common.DbConnection owningObject, System.UInt32 waitForMultipleObjectsTimeout, System.Boolean allowCreate, System.Boolean onlyOneCheckConnection, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal& connection) [0x00085] in <8012ff544f1c4cb384c200861f770215>:0* ---------- What am I doing wrong? Is it actually real to integrate EF 6 or EF Core with Unity now?

403 Forbidden - PHP,SQL and Unity

$
0
0
Hi there! I have an app built in Unity that reads and writes to a little database. This works fine with a localhost, however now that I've placed and updated the PHP files on my web hosting (and created the DB there), I'm having trouble performing queries from Unity. I seem to be getting a 403 error and told 'You don't have permission to access' the PHP page. I've messaged my hosting to see if its a security thing on their end, but I was wondering if it sounds like there is something I'm missing. Thanks. EDIT: looks like the HTML5 version works fine also. Seems to just be the standalone/editor that can't access the pages.

Change object Color during runtime

$
0
0
Hi, I am new to Unity :) , I am C# developer. I have been working on testing unity for small period of time. I am wondering on how I can push information to the unity game from a Database (SQL) during run time. In simply I have a database with objects names with a status (1, 0 ) of an object. I want to change the color of the object during runtime if the status in the database is changed. Please note that I am using window 10 and unity 2018.

Smart way of using servers and databases in unity

$
0
0
Hi guys! We are making game which uses Hostinger servers to host our mysqli database and to access the data sends WWW Requests to some php file link on the server and converts that to text, then we split that text into peaces of information we need. so my question is: Is this wrong way of client communication to server ? and can SSL help to avoid hackers finding out what info does php get or return ?

How to get and show the data from Sql Server database on detection of Target Image?

$
0
0
Hello, I am developing an Unity 3D project such that, upon scan Target Image need to show the 3D image(Virtual Image) along with details of the 3D Image from SQL Database.The 3D Image details already available in database. Please suggest me the best approach. Thank You!

VR Highscore with database (SQLite)

$
0
0
Right now i creating a mini game project for my school and i need a highscore table for my game. So i was thinking can i use database and SQL such as SQLite to store the highscore data into database then i export the game to the VR Headset (Oculus Rift). Will the highscore data be inside the VR headset?

using databse for "enter name" system

$
0
0
hey guys, i wanted to make in my game "enter your name" system, well i know what i have to do in the inputt field on al of these stuff but i want also to do that player can name himself a name that has been taken, i realized that for this thing i have to save data in some database, but my knowledge at that is actually null, can someone please help me at this little issue or maybe let me know about good tutorial out thare? thank you and sorry for my bad english

UnityWebRequest returns an empty string

$
0
0
Version: 2019.3.11f1 I tried to add a simple online leaderboard to my game. I created a SQL database and wrote a PHP script which accesses it. So far so good. ---------- The PHP script's URL is the following: https://starcaders.com/leaderboard.php ---------- As you can see, the PHP script is working and displays the table's entries (only two test entries atm). My goal is to read the text on the page and save it as a string in Unity. ---------- Unfortunately, the code below returns an empty string. The isDone bool is also false. ---------- I also tried to add a "SendWebRequest()" after yield return leaderboard, but that leads to the following error message: Curl error 51: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_EXPIRED and also returns "hahaha TEST 123", my placeholder string. ---------- I also tried to retrieve text from other sites, but that returns an empty string as well. At this point, I am basically completely at a loss, which is why I created this thread. ---------- Thank you for your time, below you can see my code. using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; // for UnityWebRequest public class Leaderboard : MonoBehaviour { void Start() { StartCoroutine("RequestLeaderboard"); } IEnumerator RequestLeaderboard() { UnityWebRequest leaderboard = UnityWebRequest.Get("http://starcaders.com/leaderboard.php"); //sends http request --> php script reads sql database yield return leaderboard; //waits until request is done string leaderboardString = "hahaha TEST 123"; if(!leaderboard.isNetworkError && !leaderboard.isHttpError) { leaderboardString = leaderboard.downloadHandler.text; } Debug.Log(leaderboardString); } }

Xampp Query.

$
0
0
Hey Developers, I am using MySql database from xampp for my multiplayer game. I have a simple query that will this work in different devices which do not have the xampp installed??? My game is an android game... so if two or three users try to connect with the database will it work? I am following this playlist:: [PlayList for SQL](https://www.youtube.com/playlist?list=PLTm4FjoXO7nfn0jB0Ig6UbZU1pUHSLhRU) Thanking in Advance :).

does direct SQL connection with Unity work in Android?

$
0
0
Hello everyone, I know i should have to use webserver, php, etc to connect to a database. That's another issue and not relevant to this one. This is about connecting to a SQL datebase with android build. Not SQL lite. When i run my app from editor via a simulator, all works fine. But when i build it to an android device the connection functions stop working. SqlConnection connection = new SqlConnection(conString); try { string uname = username_R.text.Trim(); connection.Open(); SqlCommand check_User_Name = new SqlCommand("SELECT * FROM userinfo WHERE ([username] = @username)", connection); check_User_Name.Parameters.AddWithValue("@username", uname); SqlDataReader reader = check_User_Name.ExecuteReader(); if (reader.HasRows) { Debug.Log("1122"); } else { AddUser(); } } catch (SqlException) { Debug.Log("error"); } finally { connection.Close(); } this piece of function is fully functional in editor. But I do not know what causes this; if i should have to import some Dll's or unity or android doesnt let me to connect to a database directly. When i pressed the register button in adroid device, it should fire this piece of code as it does in editor but it seems it ignores or skips the sql connection parts. The device is connecting to a remote server and recieves the encrypted connection string from server, decrypts it and assigns to proper value. All works fine about connection string, so it is not about connection string. As i mentioned above everything works fine in editor. Any ideas what causes this or how to solve it? Thanks... Ps: It is not about SQL lite and i know that i should have to use webserver, php or etc to connect to database.

Create a Dropdown Menu with values from Database

$
0
0
Guys, I need help with my urgent assignment. I never learn the C# language before, but this assignment needs C# to develop. I want to make a dropdown menu with the values from the database which is MySQL. This means once the database is updated with new data, the dropdown menu in Unity will also be updated, also known as both database and Unity synchronized with each together. So that users can immediately choose the updated values from the Unity dropdown menu. Anyone can help me with this? I need the C# script for this. Really appreciate it. Thank you in advance.

System.Data.SqlClient.SqlException (0x80131904): System.Net.Security.Native Error while Connecting to Localhost Server

$
0
0
I'm trying to connect locally from Unity to Microsoft SQL Server Manager using the code: public void connect(){ Debug.Log("Connecting to Server"); string connectionStr = @"Data Source=localhost;Initial Catalog=Test;Integrated Security=True"; SqlConnection dbConnection = new SqlConnection(connectionStr); try { dbConnection.Open(); Debug.Log("Connected"); } catch(SqlException exception) { Debug.LogWarning(exception.ToString()); } } } But I get a > System.Data.SqlClient.SqlException (0x80131904): System.Net.Security.Native Exception. Im making the app on Windows platform, Api Compatibillity is at Net x4, TCP/IP is enabled.
Full Error:> System.Data.SqlClient.SqlException (0x80131904): System.Net.Security.Native at (wrapper managed-to-native) Interop+NetSecurityNative.ImportPrincipalName(Interop/NetSecurityNative/Status&,string,int,Microsoft.Win32.SafeHandles.SafeGssNameHandle&) at Microsoft.Win32.SafeHandles.SafeGssNameHandle.CreatePrincipal (System.String name) [0x0000e] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Net.Security.SafeDeleteNegoContext..ctor (System.Net.Security.SafeFreeNegoCredentials credential, System.String targetName) [0x0001c] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Net.Security.NegotiateStreamPal.EstablishSecurityContext (System.Net.Security.SafeFreeNegoCredentials credential, System.Net.Security.SafeDeleteContext& context, System.String targetName, System.Net.ContextFlagsPal inFlags, System.Net.Security.SecurityBuffer inputBuffer, System.Net.Security.SecurityBuffer outputBuffer, System.Net.ContextFlagsPal& outFlags) [0x0000b] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Net.Security.NegotiateStreamPal.InitializeSecurityContext (System.Net.Security.SafeFreeCredentials credentialsHandle, System.Net.Security.SafeDeleteContext& securityContext, System.String spn, System.Net.ContextFlagsPal requestedContextFlags, System.Net.Security.SecurityBuffer[] inSecurityBufferArray, System.Net.Security.SecurityBuffer outSecurityBuffer, System.Net.ContextFlagsPal& contextFlags) [0x0002a] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.SqlClient.SNI.SNIProxy.GenSspiClientContext (System.Data.SqlClient.SNI.SspiClientContextStatus sspiClientContextStatus, System.Byte[] receivedBuff, System.Byte[]& sendBuff, System.Byte[] serverName) [0x0006b] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.SqlClient.SNI.TdsParserStateObjectManaged.GenerateSspiClientContext (System.Byte[] receivedBuff, System.UInt32 receivedLength, System.Byte[]& sendBuff, System.UInt32& sendLength, System.Byte[] _sniSpnBuffer) [0x00000] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.SqlClient.TdsParser.SNISSPIData (System.Byte[] receivedBuff, System.UInt32 receivedLength, System.Byte[]& sendBuff, System.UInt32& sendLength) [0x00007] in <290425a50ff84a639f8c060e2d4530f6>:0 System.Net.Security.Native at (wrapper managed-to-native) Interop+NetSecurityNative.ImportPrincipalName(Interop/NetSecurityNative/Status&,string,int,Microsoft.Win32.SafeHandles.SafeGssNameHandle&) at Microsoft.Win32.SafeHandles.SafeGssNameHandle.CreatePrincipal (System.String name) [0x0000e] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Net.Security.SafeDeleteNegoContext..ctor (System.Net.Security.SafeFreeNegoCredentials credential, System.String targetName) [0x0001c] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Net.Security.NegotiateStreamPal.EstablishSecurityContext (System.Net.Security.SafeFreeNegoCredentials credential, System.Net.Security.SafeDeleteContext& context, System.String targetName, System.Net.ContextFlagsPal inFlags, System.Net.Security.SecurityBuffer inputBuffer, System.Net.Security.SecurityBuffer outputBuffer, System.Net.ContextFlagsPal& outFlags) [0x0000b] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Net.Security.NegotiateStreamPal.InitializeSecurityContext (System.Net.Security.SafeFreeCredentials credentialsHandle, System.Net.Security.SafeDeleteContext& securityContext, System.String spn, System.Net.ContextFlagsPal requestedContextFlags, System.Net.Security.SecurityBuffer[] inSecurityBufferArray, System.Net.Security.SecurityBuffer outSecurityBuffer, System.Net.ContextFlagsPal& contextFlags) [0x0002a] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.SqlClient.SNI.SNIProxy.GenSspiClientContext (System.Data.SqlClient.SNI.SspiClientContextStatus sspiClientContextStatus, System.Byte[] receivedBuff, System.Byte[]& sendBuff, System.Byte[] serverName) [0x0006b] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.SqlClient.SNI.TdsParserStateObjectManaged.GenerateSspiClientContext (System.Byte[] receivedBuff, System.UInt32 receivedLength, System.Byte[]& sendBuff, System.UInt32& sendLength, System.Byte[] _sniSpnBuffer) [0x00000] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.SqlClient.TdsParser.SNISSPIData (System.Byte[] receivedBuff, System.UInt32 receivedLength, System.Byte[]& sendBuff, System.UInt32& sendLength) [0x00007] in <290425a50ff84a639f8c060e2d4530f6>:0 <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.SqlClient.SqlInternalConnectionTds..ctor (System.Data.ProviderBase.DbConnectionPoolIdentity identity, System.Data.SqlClient.SqlConnectionString connectionOptions, System.Object providerInfo, System.Boolean redirectedUserInstance, System.Data.SqlClient.SqlConnectionString userConnectionOptions, System.Data.SqlClient.SessionData reconnectSessionData, System.Boolean applyTransientFaultHandling) [0x00156] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.SqlClient.SqlConnectionFactory.CreateConnection (System.Data.Common.DbConnectionOptions options, System.Data.Common.DbConnectionPoolKey poolKey, System.Object poolGroupProviderInfo, System.Data.ProviderBase.DbConnectionPool pool, System.Data.Common.DbConnection owningConnection, System.Data.Common.DbConnectionOptions userOptions) [0x0012a] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection (System.Data.ProviderBase.DbConnectionPool pool, System.Data.Common.DbConnection owningObject, System.Data.Common.DbConnectionOptions options, System.Data.Common.DbConnectionPoolKey poolKey, System.Data.Common.DbConnectionOptions userOptions) [0x0000c] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.ProviderBase.DbConnectionPool.CreateObject (System.Data.Common.DbConnection owningObject, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal oldConnection) [0x00184] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest (System.Data.Common.DbConnection owningObject, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal oldConnection) [0x00040] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.ProviderBase.DbConnectionPool.TryGetConnection (System.Data.Common.DbConnection owningObject, System.UInt32 waitForMultipleObjectsTimeout, System.Boolean allowCreate, System.Boolean onlyOneCheckConnection, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal& connection) [0x000a4] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.ProviderBase.DbConnectionPool.TryGetConnection (System.Data.Common.DbConnection owningObject, System.Threading.Tasks.TaskCompletionSource`1[TResult] retry, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal& connection) [0x00026] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection (System.Data.Common.DbConnection owningConnection, System.Threading.Tasks.TaskCompletionSource`1[TResult] retry, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal oldConnection, System.Data.ProviderBase.DbConnectionInternal& connection) [0x0021d] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal (System.Data.Common.DbConnection outerConnection, System.Data.ProviderBase.DbConnectionFactory connectionFactory, System.Threading.Tasks.TaskCompletionSource`1[TResult] retry, System.Data.Common.DbConnectionOptions userOptions) [0x00036] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection (System.Data.Common.DbConnection outerConnection, System.Data.ProviderBase.DbConnectionFactory connectionFactory, System.Threading.Tasks.TaskCompletionSource`1[TResult] retry, System.Data.Common.DbConnectionOptions userOptions) [0x00000] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.SqlClient.SqlConnection.TryOpen (System.Threading.Tasks.TaskCompletionSource`1[TResult] retry) [0x0005d] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.SqlClient.SqlConnection.Open () [0x0003b] in <290425a50ff84a639f8c060e2d4530f6>:0 at DbManager.connect ()

Hiding the SQLite file

$
0
0
I have an SQLite file in my game. (For example: datas.db) But the user sees this file from phone files. Can I hide or encrypt this file?

SqlConnection SocketException only in Unity

$
0
0
I have an SQL server database running locally on SQL server management 18 When I run the following script to make a query in a non-unity console application, it works great static void Main(string[] args) { SqlConnection connection = new SqlConnection(@"Server=localhost\SQLEXPRESS;Database=MY_DATABASE;User ID=sa;Password=;"); connection.Open(); SqlCommand command = new SqlCommand("SELECT * FROM dataitems", connection); using (var reader = command.ExecuteReader()) { while (reader.Read()) { Console.WriteLine(reader[2]); } } } However, when I run the same code in Unity, I get the error: "SocketException: An existing connection was forcibly closed by the remote host." (In both editor and built versions) void Start() { SqlConnection connection = new SqlConnection(@"Server=localhost\SQLEXPRESS;Database=MY_DATABASE;User ID=sa;Password=;"); connection.Open(); SqlCommand command = new SqlCommand("SELECT * FROM dataitems", connection); using (var reader = command.ExecuteReader()) { while (reader.Read()) { Debug.Log(reader[2]); } } } Why is this happening on my machine? On other machines there doesn't seem to be a problem. Common solutions I have already addressed: - My firewall is switched off - TCP/IP is enabled in the server network configuration

Can't connect to Database using Windows Authentication in Unity

$
0
0
use sql server Authentication is ok ![alt text][1] but Windows Authentication have error![alt text][2] [1]: /storage/temp/191677-1643105988558.jpg [2]: /storage/temp/191678-1643105968812.jpg
Viewing all 146 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>