I have a problem while using ExecuteNonQuery
.
This is my code :
var connString = @"Data Source=serwer01;Initial Catalog=PolsatCyfrowy;Integrated Security=True";
FileInfo file = new FileInfo("C:\Users\azbudniewek\source\repos\UM2 V2\UM2 V2\scripts.sql");
string script = file.OpenText().ReadToEnd();
SqlConnection conn = new SqlConnection(connString);
Server server = new Server(new ServerConnection(conn));
server.ConnectionContext.ExecuteNonQuery(script);
And this is the error:
System.IO.FileNotFoundException: The file or set 'Microsoft.SqlServer.BatchParser, version = 14.100.0.0, Culture = neutral, PublicKeyToken = 89845dcd8080cc91' or one of its company can not be loaded. The file can not be downloaded.
File name: 'Microsoft.SqlServer.BatchParser, version = 14.100.0.0, Culture = neutral, PublicKeyToken = 89845dcd8080cc91'
in System.Reflection.RuntimeAssembly.GetType (RuntimeAssembly set, string name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack)
in System.Reflection.RuntimeAssembly.GetType (string name, Boolean throwOnError, Boolean ignoreCase)
I read a lot of solutions with problem but can't do anything .
Should I just install another SQL Server? I have installed SQL Server 2014 on my computer and folder with assembly looks like this:
Screenshot
What should I do to avoid this problem? I think I should have version 14.100.0.0 in my assembly folder but don't know how to update it. Maybe anyone know it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…