Problems with Tutorial Lab03/Ex02/Task02
I am having problems with Lab03/Ex02/Task02.
Following the directions I get different problems with different connection strings.
For reference, I am using SQL Server 2000 sp4 and has a name of (local)\Tutorial.
I have a Data Connection in the Server Explorer to the database, so I know I can
connect and view data.
Any thoughts would be appreciated.
Dave
================================
static string connectionString =
@"Integrated Security=SSPI;Persist Security Info=False;" +
@"Initial Catalog=TrackingStore;Data Source=(local)\Tutorial";
static string connectionString2 =
@"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;" +
@"Initial Catalog=TrackingStore;Data Source=(local)\Tutorial";
Test #1:
workflowRuntime.AddService(new SqlTrackingService(connectionString));
SqlTrackingQuery sqlTrackingQuery = new SqlTrackingQuery( connectionString );
Causes a hang on waitHandle.WaitOne();
"Output" tab in VS
Nothing output
Test #2:
workflowRuntime.AddService(new SqlTrackingService(connectionString2));
SqlTrackingQuery sqlTrackingQuery = new SqlTrackingQuery( connectionString );
Console Window
Here in working_ExecuteCode.
Instance Tracking Events :
No Instance Tracking Events Found
Workflow Completed - press ENTER to continue
"Output" Tab
A first chance exception of type 'System.NullReferenceException' occurred in DefaultSQLServices.exe
Test #3:
workflowRuntime.AddService(new SqlTrackingService(connectionString2));
SqlTrackingQuery sqlTrackingQuery = new SqlTrackingQuery( connectionString2 );
An unhandled exception of type 'System.ArgumentException' occurred in System.Data.dll
Additional information: Keyword not supported: 'provider'.
[1954 byte] By [
Webbert] at [2007-12-25]
Did what you suggested. Dropped the 2 DBs, created them and ran the scripts from the directory you listed using QueryAnalyzer. Re-built the code using static string connectionString = "Initial Catalog=TrackingStore;Data Source=localhost\\Tutorial; Integrated Security=SSPI;"; and ended up with the same results, hanging on waitHandle.WaitOne();.
Everytime I run the app, I see a new entry in TrackingStore.WorkflowInstance, so I know that data is going in. I don't see any data being inserted into the other tables on a per run basis, only first run data like in the table: Type.
I downloaded all Runtimes, SDKs, Labs on this past Monday. Here is the versions
Add/Remove Programs - Support Info
Labs for WWF Beta 2 - v1.0.0
VS 2005 Extenstions WWF - v3.0.3603.4
WinFX Runtime Components 3.0 - Beta 2
The Completed\Excerise2 works for me as well. The problem with that is that it is Task 03 and not Task 02 which is where my problem is. In Task 03 the waitHandle.WaitOne() is removed. This is where I am hanging.
I opened up the Completed\Excercise2 and made the following changes which effectively takes it back to Task 02 and ran the program again which caused the problem that I am describing.
static string connectionString = "Initial Catalog=TrackingStore;" +
"Data Source=localhost\\Tutorial; Integrated Security=SSPI;";
static void Main(string[] args)
{
WorkflowRuntime workflowRuntime = new WorkflowRuntime();
//workflowRuntime.AddService(new SharedConnectionWorkflowTransactionService(connectionString));
workflowRuntime.AddService(
new SqlTrackingService(connectionString));//workflowRuntime.AddService( new SqlWorkflowPersistenceService( connectionString, true, new TimeSpan( 0, 0, 0, 10, 0 ), new TimeSpan( 0, 0, 0, 10, 0 ) ) );//workflowRuntime.AddService( new DefaultWorkflowSchedulerService() );AutoResetEvent waitHandle = new AutoResetEvent(false);workflowRuntime.WorkflowCompleted +=
delegate(object sender, WorkflowCompletedEventArgs e) {waitHandle.Set();};workflowRuntime.WorkflowTerminated +=
delegate(object sender, WorkflowTerminatedEventArgs e){
Console.WriteLine(e.Exception.Message);waitHandle.Set();
};
// =================================// ADDED // =================================WorkflowInstance instance = workflowRuntime.CreateWorkflow( typeof( DefaultSQLServices.SimpleWorkflow ) );instance.Start();
instance.Suspend(
"Reason we are suspending the workflow." );instance.Resume();
waitHandle.WaitOne();
GetInstanceTrackingEvents( instance.InstanceId );
Console.WriteLine( "Workflow Completed - press ENTER to continue" );Console.Read();// =================================// REMOVED// =================================//workflowRuntime.WorkflowLoaded += new EventHandler<WorkflowEventArgs>(workflowRuntime_WorkflowLoaded);//workflowRuntime.WorkflowIdled += new EventHandler<WorkflowEventArgs>(workflowRuntime_WorkflowIdled);//workflowRuntime.WorkflowPersisted += new EventHandler<WorkflowEventArgs>(workflowRuntime_WorkflowPersisted);//workflowRuntime.WorkflowUnloaded += new EventHandler<WorkflowEventArgs>(workflowRuntime_WorkflowUnloaded);//for (int workflowCount = 0; workflowCount < 5; workflowCount++)//{// WorkflowInstance simpleWorkflowInstance = workflowRuntime.CreateWorkflow(typeof(DefaultSQLServices.SimpleWorkflow));// simpleWorkflowInstance.Start();//}//System.Threading.Thread.Sleep(new TimeSpan(0, 0, 20));// =================================// END CHANGES// =================================Console.WriteLine("Workflow Completed - press ENTER to continue");Console.Read();}
Hello,
I am having the same problem. I am using the full version of SQL2005. My code is breaking on the line "WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(HostingWorkflowRuntime.SimpleWorkflow));
I am running Extensions for Windows WF version 8.050727.42
The error I am receiving is "Connection string Specified for this Service "xxxx" is different from that of the transaction service "xxxx".
XXX is the actual connection string. It is valid - I can make a sql connection.
I have reinstalled the database. I cannot reinstall the code at this time because I have some demos I am using it for.
I experienced a similar issue today with Tutorial Lab03/Ex02/Task02.
My TrackingStore database is the default SQLExpress database (as per Lab03 db creation script). I have a connection to this database in VS2005 server explorer and, crucially, I open the table "WorkflowInstance" within VS2005 to see data. If I do all that, I get a database connection error when I try to run the workflow.
If I a) restart SQLExpress or b) create a SQL Server 2005 version of TrackingStore and connect to that instead, then everything is fine with this lab. I can keep running the workflow, and keep viewing data in VS2005. It's only when I have viewed SQL Express data within VS2005 that I then get a db connection error, the next time I run the app. Weird. Anyone know why?
Pete