- Home /
Cannot connect SQL Server After building
Hi there! I'm using SQL Server 2008 as my database. When I run the game under Unity3D Project, everything works well, but if I build a .exe file under Windows 7 and run it outside, I cannot connect the SQL Server anymore. Anyone knows the solution? Do I miss some settings? Thanks!
What does your connection string to the databse look like?
Like this: string connstr = "Server=XZZ-PC\\ProjectData;" + "Database=FJHHbattlefieldEnvironments;" + "User ID=sa;" + "Password=123456"; conn=new SqlConnection(connstr); conn.Open(); and it works well before building the exe
the same problem as yours,I use Chinese version sql server 2005 too,besides,are you Chinese?
@rayjay214: Use comments if you don't post an answer.
btw. according to Li Lincheng's user page he / she lives in china so i guess he / she is chinese ;)
Answer by Boxer · Apr 20, 2011 at 06:41 AM
I worked it out finally! Since I'm using a Chinese version SQL Server 2008, I need a I18N.CJK.dll(China,Japan,Korea) besides I18N.West.dll and I18N.dll under Assets folder. It works well now.
I have already included I18N.CJ$$anonymous$$.dll I18N.West.dll and I18N.dll in my project and it work well after build as exe, but not work as web. I drive me crazy.
@seneyhsns: You are aware of the security sandbox in which the webplayer runs in? right? Almost all SQL connection libraries use a socket connection. Therefore, if you want to access an SQL server from a web build, you have to run a socket policy server along with your SQL server which explicitly allows the connection of a web player to the required port(s).
You should get security exceptions when you try to do something like that without a crossdomain policy server.