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]
# 1

Hi there

If the ConnectionString are correct, maybe the error could be the "version" of the T-SQL scripts you used to create the database.
The labs ships with T-SQL scripts maybe older than needed to use the TrackingService API.
To be sure of the problem plese tell us what version of WF are you using. (1.0, 2.0, 2.2) and how you create the TrackingStore database.
If used the T-SQL scripts from the Resources folder from Lab03, maybe you can try the scripts shipped with the current version of WF you are using. You can find them here:
C:\WINDOWS\WinFX\v3.0\Windows Workflow Foundation\SQL\EN (I'm still using version 2.0). Create a new database with them and try again ;-)

Hope this helps
Marcos

MarcosTorres at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 2

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

Webbert at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 3

If you didn′t know what it′s happening or don′t know if you have something installed correctly (or have coded the example right) I would try running the Completed Task (in \Completed\Excercise2\)... If works as expected, the error maybe it is inside my code...

I've just tried the completed example and works fine..
HTH

MarcosTorres at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 4

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();

}

Webbert at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 5

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.

r3dw1ng at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 6

If you are using the sqltracking and sqlpersistence together and they use the same database, then you should use the SharedConnectionWorkflowCommitWorkBatchService. Then you should make sure the two services are using the same connection string and that they match the connection string for this service.

If you are not using the same database for the persistence and tracking services, then use the DefaultWorkflowCommitWorkBatchService (the default if you don't configure one) and configure the connection strings independently on the two services.

Matt

MattMilner-Pluralsight at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 7

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

PeteL at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified