无法从Unity连接到本地sql数据库

时间:2015-06-04 12:46:05

标签: sql sql-server unity3d sqlconnection

我无法连接到本地的SQL数据库

这是我的代码:

int bestPlayeLevel = 0;
string localConnectionString = @"Data Source= gauravgoyalpc\sql2008r2;Initial Catalog=bluering;user=xxx;pwd=xxx;Pooling=False;";

SqlConnection con = new SqlConnection (localConnectionString);

SqlCommand command = new SqlCommand ("GetBestPlayed", con);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add ("@PersonId", SqlDbType.UniqueIdentifier).Value = new Guid(personId);
command.Parameters.Add ("@GameId", SqlDbType.UniqueIdentifier).Value = new Guid(gameId);

con.Open ();
con.close();

如果我将连接字符串更改为测试服务器数据库,它可以正常工作,但是当与本地数据库建立连接时,我遇到了这个问题

  

错误:SecurityException:无法连接,因为没有有效的跨域   政策被发现

0 个答案:

没有答案
相关问题