When I build as a standalone executable my application works fine with database SQL server, but does not work when built as a web player. What can I do?.
1 Answer
You won't be able to connect to a database using the web player as it is inside a security sandbox.
Restrictions on accessing data on a domain other than the one hosting your .unity3d file.
Some limitation on the usage of the Sockets.
You can read more about it here: http://docs.unity3d.com/Manual/SecuritySandbox.html
8 Comments
Steven H.
Excuse me could you please mention more specific what I can fix this?
yoyo
You may not be able to, or not easily. Please provide more information about how you are trying to access the database.
tbridge
@StevenH. I think that if you hosted the SQL server on the same domain you would be able to access it.
Steven H.
The way I access database is by using **System.Data.dll ** and just provide the connection string in order to connect. @yoyo
yoyo
Right, and a System.Data connection won't work from a web player. You could instead access the database from the enclosing web page, and then communicate from your Unity app to the web page, as explained here. This will be a very different approach from System.Data usage, but I don't know if there is a better alternative.
|