RE: Get SQL connection string or run sp or query using VS Tools for GP
Here is the code I use to establish the connection
You will need to register with Microsoft to get the license keys. I believe you can ask your partner to get you these keys.
GPConnObj.Init("MyCompanyName", "MyLicenseKeys");
private SqlConnection GetConnection()
{
SqlConnection DataConnection = new SqlConnection();
/* Call Startup */
resp = GPConnection.Startup();
/* Create the connection object */
GPConnObj = new GPConnection();
/* Initialize the connection object */
GPConnObj.Init("MyCompanyName", "MyLicenseKeys");
/* Make the connection */
DataConnection.ConnectionString = "Database=" + Dynamics.Globals.IntercompanyId.Value;
GPConnObj.Connect(DataConnection, Dynamics.Globals.SqlDataSourceName.Value, Dynamics.Globals.UserId.Value, Dynamics.Globals.SqlPassword.Value);
/* Check the return code */
if ((GPConnObj.ReturnCode & (int)GPConnection.ReturnCodeFlags.SuccessfulLogin) !=
(int)GPConnection.ReturnCodeFlags.SuccessfulLogin)
{
MessageBox.Show("Login failed");
}
return DataConnection;
}