I am trying do this in custom action wix:
string sqlConnectionString = @"Server=MyInstanceName;Trusted_Connection=True;MultipleActiveResultSets=true";
string script = "...";
Microsoft.Data.SqlClient.SqlConnection conn = new Microsoft.Data.SqlClient.SqlConnection(sqlConnectionString);
Server server = new Server(new ServerConnection(conn));
server.ConnectionContext.ExecuteNonQuery(script);
It work in console app but when I run msi it throw:
Failed to connect to server MyInstanceName. Could not load DLL 'Microsoft.Data.SqlClient.SNI.x86.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
When I use Orca I dont see this .dll.
How can i repair that?
This is a library problem Microsoft.SqlServer.Server. I changed library to write sql command on System.Data.SqlClient.
User contributions licensed under CC BY-SA 3.0