I am trying to test out my database code using my local MSSQL 2008 server. Unfortunately, when trying to connect, I get the following error message from Unity 3.1:
I read somewhere that you have to Prefetch security, or something along those lines, so I have written the following before trying to access the database:
Security.PrefetchSocketPolicy("127.0.0.1", 1433); (I believe 1433 is the TCP port that SQL 2008 runs under.)
Does anybody know what is causing this problem, and how to fix it?
you need to have either unitys security socket server running or a webserver running at that address which provides the crossdomain licensing. mssql server will definitely not provide it.
you can check out the manual on the unity3 webplayer security sandbox to find out more about it
So does this mean that there is no way I can access a MSSQL database from Unity? If so, is there a way I can get around this issue (which from reading the documentation, makes a tremendous amount of sense)?
No this means that there is no problem with accessing it but as with flash or silverlight you have to offer a crossdomain verification service (unity even runs on the same port as silverlight out of box)
keep in mind, the webplayer is designed to access webservices and how often would you be funny enough to make worldwide wildcard accounts to access it straight from the web instead of having a webservice inbetween?