SQL Server 2016 RC1 : Unable to debug SSIS package - sql-server-2016

I installed SQL server 2016 RC1 in Windows 10 (formatted and installed the OS). I first installed VS2015 with latest updates and then the SQL. I am not able to debug the SSIS packages and I get following error.
Method 'SaveAndUpdateVersionToXML' in type 'Microsoft.DataTransformationServices.Project.DebugEngine.InterfaceWrappers.Sql2014ApplicationClassWrapper' from assembly 'Microsoft.DataTransformationServices.VsIntegration, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' does not have an implementation. (Microsoft Visual Studio)
I installed the latest version of SQL Server Data Tools
Is anyone facing similar issue? Any solution for this problem?

to run the package you might wana use this c# solution:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using dts1=Microsoft.SqlServer.Dts.Runtime.Wrapper;
using System.Timers;
using System.Threading;
using ustimer=System.Windows.Forms;
namespace integration
{
public partial class integration : Form
{
public integration()
{
InitializeComponent();
}
public int c = 0;
public string path = #"c:\users\Package.dtsx";
private void button1_Click(object sender, EventArgs e)
{
dts1.IDTSPackage100 pkg;
dts1.IDTSApplication100 app;
dts1.DTSExecResult pkgResults;
app = new dts1.Application();
pkg = app.LoadPackage(path, true, null);
try
{
pkgResults = pkg.Execute(null, null, null, null, null);
if (pkgResults == dts1.DTSExecResult.DTSER_SUCCESS)
{
MessageBox.Show("works");
}
else
{
MessageBox.Show("failed");
}
}
catch
{
//
}
}
public void run_pkg(string path, bool feedback = true)
{
dts1.IDTSPackage100 pkg;
dts1.IDTSApplication100 app;
dts1.DTSExecResult pkgResults;
app = new dts1.Application();
pkg = app.LoadPackage(path, true, null);
try
{
pkgResults = pkg.Execute(null, null, null, null, null);
if (feedback == true)
{
if (pkgResults == dts1.DTSExecResult.DTSER_SUCCESS)
{ MessageBox.Show("worked"); }
else
{ MessageBox.Show("failed"); }
}
}
catch
{
//
}
}}

This update fixed the issue for me: https://blogs.msdn.microsoft.com/ssdt/2016/04/05/ssdt-preview-update-rc2/

Related

Why this error comes "The plug-in execution failed because no Sandbox Worker processes are currently available"?

I am using an free trial version of online ms crm 2015 just to understand it and
I wrote this plugin with threads int them
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Xrm.Sdk; // for Iplugin interface
using nonitcompany; // for earlybinding generated by crmsvcuti.exe
using Microsoft.Crm.Sdk; //for stestate requests
using Microsoft.Crm.Sdk.Messages; //for stestate requests
namespace Plugin_on_create_deact_rec
{
public class account_deactivate:IPlugin
{
public static int semaphore0 = 0, semaphore1 = 0, semaphore2 = 0;
public static IPluginExecutionContext context;
public static IOrganizationServiceFactory factory;
public static IOrganizationService service;
public static IServiceProvider serviceProvider_;
public static Entity accounts;
public static SetStateRequest deactivate;
public static SetStateResponse setstate_response;
public void Execute(IServiceProvider serviceProvider)
{
serviceProvider_ = serviceProvider;
ThreadStart _context = new ThreadStart(context_);
ThreadStart _factory = new ThreadStart(factory_);
ThreadStart _execute = new ThreadStart(execute_);
Thread context_t = new Thread(_context);
Thread factory_t = new Thread(_factory);
Thread execute_t= new Thread(_execute);
context_t.Start();
factory_t.Start();
execute_t.Start();
wait(semaphore0);
}
private static void context_()
{
context = (IPluginExecutionContext)serviceProvider_.GetService(typeof(IPluginExecutionContext));
accounts = (Entity)context.InputParameters["Target"];
EntityReference accounts_reference = new EntityReference();
accounts_reference.LogicalName = accounts.LogicalName;
accounts_reference.Id = accounts.Id;
deactivate = new SetStateRequest();
deactivate.EntityMoniker = accounts_reference;
deactivate.State = new OptionSetValue((int)AccountState.Inactive);
deactivate.Status = new OptionSetValue(2);
signal(semaphore1);
}
private static void factory_()
{
factory = (IOrganizationServiceFactory)serviceProvider_.GetService(typeof(IOrganizationServiceFactory));
service = (IOrganizationService)factory.CreateOrganizationService(context.UserId);
signal(semaphore2);
}
private static void execute_()
{
wait(semaphore1);
wait(semaphore2);
setstate_response = (SetStateResponse)service.Execute(deactivate);
signal(semaphore0);
}
private static void wait(int semaphore)
{
while (semaphore == 0)
{
//do nothing
}
semaphore = semaphore - 1;
}
private static void signal(int semaphore)
{
semaphore = semaphore + 1;
}
}
}
i registerd it on create post syncronous mode in accounts entity .
this error come from then after for every sync plugins registered :
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The plug-in execution failed because no Sandbox Worker processes are currently available. Please try again.
System.ServiceModel.CommunicationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #5CD64A38Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147204723</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>The plug-in execution failed because no Sandbox Worker processes are currently available. Please try again.
System.ServiceModel.CommunicationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #5CD64A38</Message>
<Timestamp>2015-03-12T13:19:42.5150181Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText>
[PluginProfiler.Plugins: PluginProfiler.Plugins.ProfilerPlugin]
[dc99cb02-b6c8-e411-80eb-c4346bada6b4: Plugin_on_create_deact_rec.account_deactivate: Create of account (Profiler)]
</TraceText>
</OrganizationServiceFault>
can any one tell me what the hell happened to my instance of crm ..

Certificate verification with Cordova

I wonder if there is a simple/recommended way for verifying the remote site certificate within Cordova. I would like my app to verify $remote.thumbprint is in a list of expected thumbprints and no one MITMs. The code (and the list) should be deployed on the phone through the app stores (I just assume they are trusted).
Preferably a straight forward solution that does not require platform specific code for Android, IOS and WP?
In order to see the cert information on a remote site you have to have access to that remote server. But assuming you have access to the server you could write some server code that returns a list of thumbrint values and what ever else you may need returned. Here is how you could do it with C# using asp.net:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.IO;
using System.Security.Cryptography.X509Certificates;
namespace FIPWS01
{
public partial class certtest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
X509Store store = new X509Store(StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
X509Certificate2Collection collection = (X509Certificate2Collection)store.Certificates;
// X509Certificate2Collection fcollection = (X509Certificate2Collection)collection.Find(X509FindType.FindBySubjectName, "Kilpatrick", false);
X509Certificate2Collection fcollection = (X509Certificate2Collection)collection.Find(X509FindType.FindBySubjectName, "[your info here]", false);
Response.Write("Number of certificates: " + fcollection.Count + "<br>");
foreach (X509Certificate2 x509 in fcollection)
{
byte[] rawdata = x509.RawData;
Response.Write("Friendly Name: " + x509.FriendlyName + "<br>");
Response.Write("Simple Name: " + x509.GetNameInfo(X509NameType.SimpleName, true) + "<br>");
Response.Write("Thumb Print: " + x509.Thumbprint + "<br>");
}
store.Close();
}
catch (CryptographicException)
{
Response.Write("Information could not be written out for this certificate.");
}
}
}
}

DataSync In Mvc4 for Two Different User

I am trying to sync two database of a sql in mvc4 website?
i have this code to sync it is showing no error but it is not getting executing
using Microsoft.Synchronization;
using Microsoft.Synchronization.Data;
using Microsoft.Synchronization.Data.SqlServer;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Planetskool.Controllers
{
public class DataSyncViewController : Controller
{
//
// GET: /DataSyncView/
public ActionResult Index()
{
string sqlazureConnectionString = "Server=(LocalDb)\v11.0;Initial Catalog=aspnet-Planetskool-20130901224447;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-20130901224447.mdf";
string sqllocalConnectionString = "Server=(LocalDb)\v11.0;Initial Catalog=aspnet-Planetskool-20130901224446;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-20130901224446.mdf";
using (SqlConnection serverCon = new SqlConnection(sqlazureConnectionString))
using (SqlConnection clientCon = new SqlConnection(sqllocalConnectionString))
{
var provider1 = new SqlSyncProvider("scope1", serverCon);
var provider2 = new SqlSyncProvider("scope1", clientCon);
prepareServer(provider1);
prepareClinet(provider2, serverCon);
SyncOrchestrator sync = new SyncOrchestrator();
sync.LocalProvider = provider1;
sync.RemoteProvider = provider2;
sync.Synchronize();
return View();
}}
private static void prepareServer(SqlSyncProvider provider)
{
SqlConnection connection = (SqlConnection)provider.Connection;
SqlSyncScopeProvisioning config = new SqlSyncScopeProvisioning(connection);
if (!config.ScopeExists(provider.ScopeName))
{
DbSyncScopeDescription scopeDesc = new DbSyncScopeDescription(provider.ScopeName);
scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Author_Master", connection));
config.PopulateFromScopeDescription(scopeDesc);
config.SetCreateTableDefault(DbSyncCreationOption.CreateOrUseExisting);
config.Apply();
}
}
private static void prepareClinet(SqlSyncProvider provider, SqlConnection sourceConnection)
{
SqlConnection connection = (SqlConnection)provider.Connection;
SqlSyncScopeProvisioning config = new SqlSyncScopeProvisioning(connection);
if (!config.ScopeExists(provider.ScopeName))
{
DbSyncScopeDescription scopeDesc = new DbSyncScopeDescription(provider.ScopeName);
scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("Author_Master", sourceConnection));
config.PopulateFromScopeDescription(scopeDesc);
config.Apply();
}
}
}
}
You can enable sync framework tracing in verbose mode to trace the synchronization. Likewise, did you forget to set the sync direction?

How to make the selected testcript is run in selenium grid

I need a help.........
I can launch some remote control by using:
ant launch-remote-control
but I dont know how my script connect to hub?
I set up ant, selenium-grid on the same computer.
I have an grid.dll which is written by C# and run through NUnit.
The test data is read from xml file (ValidData.xml)
The example code is below :
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.Xml;
using System.Text.RegularExpressions;
using System.Threading;
using NUnit.Framework;
using Selenium;
namespace Grid
{
public class Class1
{
//User defined
private string strURL = "http://gmail.com/";
private string[] strBrowser = new string[3] { "*iehta", "*firefox", "*safari" };
string hubAddress = "192.168.20.131"; // IP of my computer
// System defined
private ISelenium selenium;
private StringBuilder verificationErrors;
[SetUp]
public void SetupTest()
{
selenium = new DefaultSelenium(hubAddress, 4444, this.strBrowser[1], this.strURL);// do i need to identify browser when I defined it when launching a remote control
selenium.Start();
verificationErrors = new StringBuilder();
}
[TearDown]
public void TeardownTest()
{
try
{
selenium.Stop();
}
catch (Exception)
{
// Ignore errors if unable to close the browser
}
Assert.AreEqual("", verificationErrors.ToString());
}
private string[] name;
[Test]
public void LoginPassedTest()
{
try
{
XmlDocument doc = new XmlDocument();
XmlNode docNode;
doc.Load("ValidData.xml");
docNode = doc["TestCase"];
foreach (XmlNode node in docNode)
{
selenium.Open("/");
selenium.WaitForPageToLoad("50000");
selenium.Type("Email", node["username"].InnerText);
selenium.Type("Passwd", node["password"].InnerText);
selenium.Click("signIn");
selenium.WaitForPageToLoad("100000");
name = (selenium.GetText("//div[#id='guser']/nobr/b").Split('#'));
try
{
Assert.AreEqual(node["username"].InnerText, name[0]);
Assert.AreEqual("Sign out", selenium.GetText(":r6"));
}
catch (AssertionException e)
{
verificationErrors.Append(e.Message);
}
selenium.Click(":r6");
}
}
catch (AssertionException e)
{
verificationErrors.Append(e.Message);
}
}
}
}
Step I run this script:
1.I build that script into DLL
2.I start hub by using command "ant lauch-hub"
3.I start 2 remote controls by using command :
ant -Dport=5566 -Denvironment="*chrome" launch-remote-control
ant -Dport=5577 -Denvironment="*iexplore" launch-remote-control
4.Then I open Nunit and load DLL (code above) and run
5.The NUNit doesnot respond anything.
I think there are some missing things but I dont know.
How can the test script (DLL) know which is sequence of remote control is selected to run the test????
Please help me!!
Thank you so much
Yui.
I do not see [TestFixture] attribute for Class1. May be that is the problem?
I described procedure of executing tests on selenium grid here: http://slmoloch.blogspot.com/2009/12/design-of-selenium-tests-for-aspnet_19.html. and you can download sources of tests here: http://code.google.com/p/design-of-selenium-tests-for-asp-net/

sql server bcp xml data

I have a table which has a column which is of type xml.
I have to extract data from this table and load the data into another environment.
i am using bcp to extract and laod the target table but there are some special characters that is causing some issues when i bcp them into the target table. are there any workarounds
thanks
Ben
A custom CLR-SP provided me with the best solution. Now I can write XML-typed data directly to a file from TSQL, provided the SQL service account has permission to the file. This allows the simple syntax:
exec dbo.clr_xml2file #xml, #path, #bool_overwrite
The SP:
CREATE PROCEDURE [dbo].[clr_xml2file]
#xml [xml],
#file [nvarchar](max),
#overwrite [bit]
WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [CLR_FileIO].[FreddyB.FileIO].[Xml2File]
The C# for the CLR DLL:
using System;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.IO;
using System.Security.Principal;
using System.Text;
using System.Xml;
using System.Xml.XPath;
using Microsoft.SqlServer.Server;
namespace FreddyB
{
public class FileIO
{
public static void Xml2File(
SqlXml xml,
SqlString sFile,
SqlBoolean bOverwrite
) {
SqlPipe sqlpipe = SqlContext.Pipe;
try
{
if (xml == null || xml.IsNull || xml.Value.Length == 0) {
sqlpipe.Send("Cannot write empty content to file : \n\t"
+sFile.Value);
return;
}
if (File.Exists(sFile.Value) & bOverwrite.IsFalse) {
sqlpipe.Send("File already exists : \n\t"+sFile.Value);
return;
}
int iFileSize = 0;
FileStream fs = null;
try {
byte[] ba = Encoding.UTF8.GetBytes(xml.Value);
iFileSize = ba.Length;
fs = new FileStream(sFile.Value, FileMode.Create, FileAccess.Write);
fs.Write(ba, 0, ba.Length);
sqlpipe.Send("Wrote "
+String.Format("{0:0,0.0}",iFileSize/1024)
+" KB to : \n\t"
+sFile.Value);
}
catch (Exception ex)
{
sqlpipe.Send("Error as '"
+WindowsIdentity.GetCurrent().Name
+"' during file write : \n\t"
+ex.Message);
sqlpipe.Send("Stack trace : \n"+ex.StackTrace);
}
finally
{
if (fs != null) {
fs.Close();
}
}
}
catch (Exception ex)
{
sqlpipe.Send("Error writing to file : \n\t"
+ex.Message);
}
}
}
}