RE: Tertiary education

2010-11-23 Thread Maddin, Peter
I did the Masters in Systems Development (Charles Sturt Uni), as an external 
student (Distance Education).
Half the courseware is Microsoft based and the other half are Uni units (12 
units in all).

The Microsoft units are the standard Microsoft training courses. Those that 
come with standard training book/kit and they had some online (Webex) sessions 
in lieu of on-campus lectures. You can choose C# or VB.Net. The exams are the 
same as for when you do std Microsoft training except the vouchers for the 
exams indentified them as Uni Based.
One of the electives I did was for SQL Server 2005 (that was current at the 
time).

The curriculum has been updated since I did mine, which was .Net 2.0 based.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Dylan Tusler
Sent: Wednesday, 24 November 2010 11:48 AM
To: 'ozDotNet'
Subject: Tertiary education

__
[Sunshine Coast Regional Council]
We've got a staff member who wants to enrol in some tertiary IT courses, and 
I'm looking for recommendations for courses that will give exposure to C# and 
SQL Server.

I've been looking at the external offerings from USQ 
(http://www.usq.edu.au/handbook/2010/bus/BITC.html), which mentions .net, but I 
think they focus on C++ for OO development, and use Java and Oracle 
predominantly.

USC (our local uni) seems to specialise in Java too.

Does anyone have any idea whether there are any offerings (pref external part 
time) that might suit?

I'm slowly working my way through various places, starting in SE Qld.

Dylan Tusler
Acting Data, Development & Integration Manager
ICTS Branch
Sunshine Coast Council
ph: +61 (0)7 5420 8002 mon, tue, wed
ph: +61 (0)7 5441 8202 thu, fri


To find out more about the Sunshine Coast Regional Council, visit your local 
office at Caloundra, Maroochydore, Nambour or Tewantin or visit us online at 
www.sunshinecoast.qld.gov.au.  If 
correspondence includes personal information, please refer to Council's Privacy 
Policy.

This email and any attachments are confidential and only for the use of the 
addressee.  If you have received this email in error you are requested to 
notify the sender by return email or contact council on 1300 00 7272 and are 
prohibited from forwarding, printing, copying or using it in anyway, in whole 
or part. Please note that some council staff utilise Blackberry devices, which 
results in information being transmitted overseas prior to delivery of any 
communication to the device. In sending an email to Council you are agreeing 
that the content of your email may be transmitted overseas.
Any views expressed in this email are the author's, except where the email 
makes it clear otherwise. The unauthorised publication of an email and any 
attachments generated for the official functions of council is strictly 
prohibited. Please note that council is subject to the Right to Information Act 
2009 (Qld) and Information Privacy Act 2009 (Qld).


Add-ins for VS2008 SP1

2010-11-11 Thread Maddin, Peter
I have just installed the CopySourceAsHtml for vs2008 add-in 
(http://copysourceashtml.codeplex.com/)

However when I look at my tools menu it does not show up.
I have installed some other add-ins and they have not show up either 
(EntitySpaces  - 2010, JetBrains Resharper 4.5, SQL Prompt 4.0 plus a few 
others)

Does anyone know why these are not added to the tools menu? They are visible in 
the Add-In Manager with the Startup checkbox ticked.
Are there any other reasons why these don't appear and is there a way of 
addressing this?

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.



RE: .NET Developer's Guide to Directory Services Programming

2010-11-03 Thread Maddin, Peter
"The .NET Developer's Guide to Directory Services Programming"  by Joe Kaplan 
and Ryan Dunn
I am looking at my copy as I type.

Used it mainly for looking at user account attributes from AD.
Have not  used it for a while.

System.DirectoryServices.AccountManagement  makes this so much easier for what 
I wanted than what I found in the book,  but the book nevertheless provides a 
good insight.

When first starting out with LDAP, I found Softerra's free LDAP Browser 
http://www.ldapadministrator.com/download.htm very useful.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Hitman Hoss
Sent: Thursday, 4 November 2010 7:04 AM
To: ozDotNet
Subject: Re: .NET Developer's Guide to Directory Services Programming

There were some additions made in .NET 3.5 with 
System.DirectoryServices.AccountManagement.  Makes working with users and 
groups pretty easy.  Check it out to see if it meets your needs.

On Thu, Nov 4, 2010 at 9:59 AM, Dylan Tusler 
mailto:dylan.tus...@sunshinecoast.qld.gov.au>>
 wrote:
__
"The .NET Developer's Guide to Directory Services Programming"

Some years ago we purchased this book. I've had a look at the book's website, 
and it hasn't been updated since 2007, and the Amazon reviews tail off around 
2008 too.

Just curious to know whether there have been any advances in directory services 
programming since then, or whether the book is still relevant.

We are about to commence work on a small project that will involve some complex 
LDAP queries, and wondering whether to use the book as a reference, or bin it?

There is a sample chapter from the book available at 
http://www.awprofessional.com/content/images/0321350170/samplechapter/Kaplan_ch10.pdf


Dylan Tusler


To find out more about the Sunshine Coast Regional Council, visit your local 
office at Caloundra, Maroochydore, Nambour or Tewantin or visit us online at 
www.sunshinecoast.qld.gov.au.  If 
correspondence includes personal information, please refer to Council's Privacy 
Policy.

This email and any attachments are confidential and only for the use of the 
addressee.  If you have received this email in error you are requested to 
notify the sender by return email or contact council on 1300 00 7272 and are 
prohibited from forwarding, printing, copying or using it in anyway, in whole 
or part. Please note that some council staff utilise Blackberry devices, which 
results in information being transmitted overseas prior to delivery of any 
communication to the device. In sending an email to Council you are agreeing 
that the content of your email may be transmitted overseas.
Any views expressed in this email are the author's, except where the email 
makes it clear otherwise. The unauthorised publication of an email and any 
attachments generated for the official functions of council is strictly 
prohibited. Please note that council is subject to the Right to Information Act 
2009 (Qld) and Information Privacy Act 2009 (Qld).



RE: TFS Feedaback? Anyone moved away from it?

2010-11-03 Thread Maddin, Peter
We (both of us) are using TFS Workgroup edition basically for source code 
control only at present.
Will be using other features such as adding tasks for bugs etc when UA testing 
gets under way.

I am quite happy with it. Occasionally a few things do get screwed up due to 
our inexperience but we have not had any problems recovering from these (just 
sweated a bit).

Would like to use the other features but we don't have the time at present.

If we weren't using it we would be using Subversion of which I have heard good 
things.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Les Hughes
Sent: Wednesday, 3 November 2010 8:32 PM
To: michaelsli...@gmail.com; ozDotNet
Subject: TFS Feedaback? Anyone moved away from it?

Hi All,

I was just looking to get a little feedback on CVS tools/etc?

I am to start another project with a small team, and was wondering is 
TFS is worth using (I haven't even seen it run yet... wondering if it is 
worth the time...)

Also, has anyone after using TFS decided to go back to subversion/etc? 
If so, why?

Thanks :)
--
Les Hughes
l...@datarev.com.au


RE: Help authoring

2010-10-29 Thread Maddin, Peter
I have VsDocman for generating help from the source code comments 
(http://www.helixoft.com/vsdocman/overview.html?net=a4c186p02)
(it will generate help without any comments but the final outcome won't be as 
good if you do)
I also have a copy of Help & Manual for producing documentation 
(http://www.ec-software.com/)

You can generate documentation in VsDocman in a variety of formats including in 
Help & manual format. Once I generate help in this format I can use Help & 
Manual to apply some spit and polish.

Used Help & manual before for  creating help files for Delphi projects. I was 
fairly happy with the product.

Now that I have moved on to C# I am hoping that it will assist me again not 
only for help files but also for user documentation.
I have played with  VSDocman but really need to spend more time with it. Last 
few times I tried it, it did not give me what I expected.
I suspect a wetware issue was at fault and that will be overcome in due course 
with time and experience.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Greg Keogh
Sent: Friday, 29 October 2010 2:54 PM
To: 'ozDotNet'
Subject: Help authoring

What are people using these days for writing application help? (someone writes 
help don't they?)

Over the years I've had HDK for old HLP files, then RoboHelp for CHM files, 
then I used FrontPage and the hc.exe for CHM files. Sometimes I've just written 
a Word document and converted it to one big PDF.

The H2(?) format used by local MSDN help was proprietary and we couldn't use 
that.

Now HLP files are long dead and CHM files seem to be causing security warnings 
and falling out of favour. Although some big vendors like ComponentOne are 
still supplying CHM files.

So overall, I'm totally confused by the current directions in help file 
authoring for .NET developers. Is anyone here on top of this issue and has 
recommendations?

Cheers, Greg




RE: OT - Superior Web Solutions

2010-10-28 Thread Maddin, Peter
I missed that. I was too busy puking into the waste paper basket.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.


-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Alastair Waddell
Sent: Friday, 29 October 2010 8:56 AM
To: ozDotNet
Subject: RE: OT - Superior Web Solutions

I think the phone number answers that: 

Call US at our Sunnyvale Offices now for a free QUOTE! Call
1-800-DIP-SHIT(we're getting this number changed VERY soon!! Darned
phone company!)

A



-Original Message-
From: ozdotnet-boun...@ozdotnet.com
[mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Maddin, Peter
Sent: Friday, 29 October 2010 8:43 AM
To: ozDotNet
Subject: RE: OT - Superior Web Solutions

http://webtekrocks.com/

They have to be joking?

Surely its not April yet!

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network
are intended solely for the named recipient's), may be confidential, and
may be privileged or otherwise protected from disclosure in the public
interest. The use, reproduction, disclosure or distribution of the
contents of this e-mail transmission by any person other than the named
recipient(s) is prohibited. If you are not a named recipient please
notify the sender immediately.


-Original Message-
From: ozdotnet-boun...@ozdotnet.com
[mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Ken Schaefer
Sent: Thursday, 28 October 2010 9:18 PM
To: ozDotNet
Subject: RE: OT - Superior Web Solutions

Rip-off of a classic: http://webtekrocks.com/ (which used to be at
Geocities)

Cheers
Ken

-Original Message-
From: ozdotnet-boun...@ozdotnet.com
[mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Maddin, Peter
Sent: Thursday, 28 October 2010 11:46 AM
To: ozDotNet
Subject: RE: OT - Superior Web Solutions

Visually and audibly fantastic excepting a few fairly ordinary (not so
flash) flash animations.


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au The contents of this e-mail
transmission outside of the WAGHS network are intended solely for the
named recipient's), may be confidential, and may be privileged or
otherwise protected from disclosure in the public interest. The use,
reproduction, disclosure or distribution of the contents of this e-mail
transmission by any person other than the named recipient(s) is
prohibited. If you are not a named recipient please notify the sender
immediately.

-Original Message-
From: ozdotnet-boun...@ozdotnet.com
[mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of silky
Sent: Thursday, 28 October 2010 11:01 AM
To: ozDotNet
Subject: OT - Superior Web Solutions

Be sure to have sound turned on, and be prepared for the experience of a
lifetime:

  <http://superior-web-solutions.com/>

I think we should all give up now. This is better then any website I
will ever make. Be sure to check out the Studio.

--
silky






Important Notice
This email contains information which is confidential and intended solely for 
the use of the individual or entity to whom it is addressed.  Please notify the 
sender immediately if you have received this e-mail by mistake and delete this 
email from your system.  If you are not the intended recipient, any form of 
distribution, copying or use of this communication or the information contained 
or attached is strictly prohibited.  Although Disability Services Commission 
has taken reasonable precautions to ensure no viruses are present in this 
email, the Commission cannot accept responsibility for any loss or damage 
arising from the use of this email or attachments.




RE: OT - Superior Web Solutions

2010-10-28 Thread Maddin, Peter
http://webtekrocks.com/

They have to be joking?

Surely its not April yet!

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.


-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Ken Schaefer
Sent: Thursday, 28 October 2010 9:18 PM
To: ozDotNet
Subject: RE: OT - Superior Web Solutions

Rip-off of a classic: http://webtekrocks.com/ (which used to be at Geocities)

Cheers
Ken

-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Maddin, Peter
Sent: Thursday, 28 October 2010 11:46 AM
To: ozDotNet
Subject: RE: OT - Superior Web Solutions

Visually and audibly fantastic excepting a few fairly ordinary (not so flash) 
flash animations.


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au The contents of this e-mail 
transmission outside of the WAGHS network are intended solely for the named 
recipient's), may be confidential, and may be privileged or otherwise protected 
from disclosure in the public interest. The use, reproduction, disclosure or 
distribution of the contents of this e-mail transmission by any person other 
than the named recipient(s) is prohibited. If you are not a named recipient 
please notify the sender immediately.

-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of silky
Sent: Thursday, 28 October 2010 11:01 AM
To: ozDotNet
Subject: OT - Superior Web Solutions

Be sure to have sound turned on, and be prepared for the experience of a 
lifetime:

  <http://superior-web-solutions.com/>

I think we should all give up now. This is better then any website I will ever 
make. Be sure to check out the Studio.

--
silky



RE: OT - Superior Web Solutions

2010-10-27 Thread Maddin, Peter
Visually and audibly fantastic excepting a few fairly ordinary (not so flash) 
flash animations.


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of silky
Sent: Thursday, 28 October 2010 11:01 AM
To: ozDotNet
Subject: OT - Superior Web Solutions

Be sure to have sound turned on, and be prepared for the experience of
a lifetime:

  

I think we should all give up now. This is better then any website I
will ever make. Be sure to check out the Studio.

-- 
silky

http://dnoondt.wordpress.com/

"Every morning when I wake up, I experience an exquisite joy - the joy
of being this signature."


RE: .NET Certs in Perth

2010-10-21 Thread Maddin, Peter
Try Dimension Data in Perth

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Tiang Cheng
Sent: Friday, 22 October 2010 9:41 AM
To: ozDotNet
Subject: .NET Certs in Perth

Hi All,

A colleague is asking where's a good place to get certs for .Net. With Excom 
out of the picture, can anyone suggest alternative venues?

Cheers!!
T



RE: IDataErrorInfo issue

2010-10-10 Thread Maddin, Peter
>> Sounds like an odd repaint algorithm, that pays attention to the mouse like 
>> that.  Mouse actions like clicks or drops, sure...

I wouldn’t say it was odd I would use much much stronger language, but I would 
not want to be banned from this listing.

I am looking at alternatives.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of mike smith
Sent: Monday, 11 October 2010 11:01 AM
To: ozDotNet
Subject: Re: IDataErrorInfo issue

On 11 October 2010 12:34, Maddin, Peter 
mailto:peter.mad...@pathwest.wa.gov.au>> wrote:
I have an Infragistics UltraGrid that is bound to an EntitySpaces entity 
collection via a binding source.

EntitySpaces entities support the IDataErrorInfo interface so that one can do 
validation either via a overriding a validate method in custom classes or by 
using an event handler.

The problem I have is that the method or event handler is hammered. Moving the 
mouse cursor over a grid cell causes the validation method or event handler to 
be called numerous times not just when the data has been edited or is being 
edited. This is not particularly a good idea if one needs to validate cell 
contents via database calls. One could potentially issue database calls 
hundreds of times when only once should be necessary.

The response form Infragistics is

You might want to try caching the result of the validation in your 
IDataErrorInfo implementation.
The grid has to call the validation method whenever it repaints a cell because 
something might have changed to make that cell no longer valid.


Sounds like an odd repaint algorithm, that pays attention to the mouse like 
that.  Mouse actions like clicks or drops, sure...



Is there any way of using a binding source to do something like this.


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au<mailto:peter.mad...@pathwest.wa.gov.au>
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.




--
Meski

"Going to Starbucks for coffee is like going to prison for sex. Sure, you'll 
get it, but it's going to be rough" - Adam Hills


IDataErrorInfo issue

2010-10-10 Thread Maddin, Peter
I have an Infragistics UltraGrid that is bound to an EntitySpaces entity 
collection via a binding source.

EntitySpaces entities support the IDataErrorInfo interface so that one can do 
validation either via a overriding a validate method in custom classes or by 
using an event handler.

The problem I have is that the method or event handler is hammered. Moving the 
mouse cursor over a grid cell causes the validation method or event handler to 
be called numerous times not just when the data has been edited or is being 
edited. This is not particularly a good idea if one needs to validate cell 
contents via database calls. One could potentially issue database calls 
hundreds of times when only once should be necessary.

The response form Infragistics is

You might want to try caching the result of the validation in your 
IDataErrorInfo implementation.
The grid has to call the validation method whenever it repaints a cell because 
something might have changed to make that cell no longer valid.

Is there any way of using a binding source to do something like this.


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.



RE: NetSqlAzMan

2010-08-27 Thread Maddin, Peter
I have found out that Kerberos Protocol Transition is available with 
workstations: Vista onwards, Server: Windows Server 2003 onwards.

XP is just too old now.

(I know how it feels)

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Maddin, Peter
Sent: Friday, 27 August 2010 12:48 PM
To: ozdotnet@ozdotnet.com
Subject: NetSqlAzMan

I am starting out with NetSqlAzMan and when I tried the Check Access Test with 
domain user account (not my own) it fails with an 'Incorrect function'

As far as I can tell the access check test is using Kerberos Protocol Transition
var otherLogin = WindowsIdentity("Domain Account");

It fails at this call with System.Security.SecurityException was unhandled,   
Message="Incorrect function.\r\n"

NetSqlAzMan enables one to log to the EventLog and I found entries like this

Authentication Package: Kerberos
  Workstation Name: FB20562
  Status code: 0x80090302


I have Googled and found lots of references to 0x80090302. However I did not 
find anything useful to myself.
There is a HotFix for this issue if you are running Vista at 
http://support.microsoft.com/kb/969083/
I am not using Vista, and until they upgrade to Win7,  I am stuck with XP Pro 
SP3.
The DC is on Win Server 2008.

Has anyone had similar issues like this?
With the number of people still using XP, I am certain that others will have 
experienced this problem.
Is there a fix for XP?

I have also posted on the NetSqlAzMan Codeplex page but I thought that if I 
post here someone may have found the appropriate hotfix.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.



NetSqlAzMan

2010-08-26 Thread Maddin, Peter
I am starting out with NetSqlAzMan and when I tried the Check Access Test with 
domain user account (not my own) it fails with an 'Incorrect function'

As far as I can tell the access check test is using Kerberos Protocol Transition
var otherLogin = WindowsIdentity("Domain Account");

It fails at this call with System.Security.SecurityException was unhandled,   
Message="Incorrect function.\r\n"

NetSqlAzMan enables one to log to the EventLog and I found entries like this

Authentication Package: Kerberos
  Workstation Name: FB20562
  Status code: 0x80090302


I have Googled and found lots of references to 0x80090302. However I did not 
find anything useful to myself.
There is a HotFix for this issue if you are running Vista at 
http://support.microsoft.com/kb/969083/
I am not using Vista, and until they upgrade to Win7,  I am stuck with XP Pro 
SP3.
The DC is on Win Server 2008.

Has anyone had similar issues like this?
With the number of people still using XP, I am certain that others will have 
experienced this problem.
Is there a fix for XP?

I have also posted on the NetSqlAzMan Codeplex page but I thought that if I 
post here someone may have found the appropriate hotfix.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.



RE: Remote debugging outside of domain

2010-08-08 Thread Maddin, Peter
If I was in this position, I would install VS on a notebook (if you don't have 
one spare, they are pretty cheap these days) and place it in the same network 
environment as your server. 

I would then use remote debugging to discover the issue and if necessary nuke 
the notebook afterwards.

>From all the pain you are going through, maybe a simple approach would be 
>quicker. 

That being said I have only debugged services remotely within a domain (and I 
found that challenging enough).

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.




Dependency Injection

2010-08-05 Thread Maddin, Peter
I am experimenting with Dependency Injection in the Microsoft CAB framework.

>From http://blog.irm.se/blogs/home.aspx?App=eric&p=11

Who says

In this post I'm back covering the CreateNew attribute that you can use in a 
class that is instantiated by 
ObjectBuilder.
 Marking a property (or parameter to a method or constructor) with the 
CreateNew attributes will set that property to an instance of the object. The 
instance itself will of course be built by the ObjectBuilder too. A great 
example of when to use this functionality is if you want to implement your GUI 
with for example the Model View Presenter (MVP) design pattern. I will only 
focus on the View and Presenter here.

I have this basic piece of code

private ContentPresenter _contentPresenter;

[CreateNew]
public ContentPresenter Presenter
{
get { return _contentPresenter; }
set { _contentPresenter = value;}
}

The objectBuilder may instantiate the ContentPresenter for me but I suspect it 
wil use the the default parameterless constructer (or expect one).

How can I pass a parameter (in this case a reference to my view that implements 
the interface that will be used
By my presenter.

I have a solution that does not use Dependency Injection but would like the 
advantages of loose coupling if possible.

Has anyone played (sorry used) the ObjectBuilder in the CAB framework for 
dependancy injection of this type and if so how can it be used to specify a 
constructor with a parameter.

I have looked at the attributes here 
http://www.ikriv.com/en/prog/info/dotnet/CabDependencyInjection/DependencyAttributes.html#CreateNew

But that has not helped me much (actually not at all in fact).

I am a sub novice (if one can get that low) with Dependancy Injection.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.



RE: Anyone used any 3rd party diagramming tools

2010-07-15 Thread Maddin, Peter
We use Neodynamic's Thermal Label SDK for barcode label printers.

I noticed they have a product which I have not used called ImageDraw that might 
be worth a look at.

http://www.neodynamic.com/Products/ImageDraw-SDK-NET/ImageDraw_SDK_NET.aspx?tabid=95&prodid=8


We use Atalasoft DotImage for digital image acquisition and annotation which I 
suspect is quite different to your needs.
We don't have a present need for a diagramming tool/SDK.

I have a strong preference for royalty free products and most imaging products 
that I have found, aren't.
It looks like Synchfusion is royalty free 
http://www.syncfusion.com/sales/licensing as is Neodynamic's offering.

Why not download the trial versions.




Regards Peter Maddin

Applications Development Officer

PathWest Laboratory Medicine WA

Phone : +618 9473 3944

Fax : +618 9473 3982

E-Mail : peter.mad...@pathwest.wa.gov.au

The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.



-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Neil Young
Sent: Friday, 16 July 2010 5:30 AM
To: ozdotnet@ozdotnet.com
Subject: Anyone used any 3rd party diagramming tools



Hey everyone,



Just a quick one, wondering if anyone has used any 3rd party

diagramming tools?  We have a .Net 4 web abb that we want to generate

reports showing relationships between things, and it would be nice to

generate an image in the report.  We don't necessarily need to have

them customise the drawing just render it.  Here's an example of one I

found:



http://www.syncfusion.com/products/user-interface-edition/aspnet/Diagram



Anyone else used any or have any comments?



Cheers,



Neil.


RE: [OT] Friday - Conway (or.. Labor govt) once againdelaysInternet Filter

2010-07-12 Thread Maddin, Peter
>> But that can only happen if aliens attack.

I wouldn't bank on that!!!

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of silky
Sent: Monday, 12 July 2010 3:33 PM
To: ozDotNet
Subject: [OT] Friday - Conway (or.. Labor govt) once againdelaysInternet Filter

Ken Said:

[...]

> People should be free to buy from the producer that produces something that 
> best meets their needs. Trade in goods and
> services (whether that be intra-state, intra-national or international) has 
> probably been the #2 driver (after technological
> progress) in raising people out of poverty. Restricting trade is a bit like 
> filtering the internet - unnecessary and something
> that will harm everyone. If you don't want to buy a Chinese product, then you 
> are free to avoid them.

Could not agree more. I don't understand nationalism of this type; it
only reinforces the taint of racism we already have; and IMHO the
world would be a better place if all nationalism of any type was
dropped and unity as a world was adopted. But that can only happen if
aliens attack.


-- 
silky

Every morning when I wake up, I experience an exquisite joy - the joy
of being this signature.


RE: KPI's for software developers

2010-06-25 Thread Maddin, Peter
I'm in trouble then

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of djones...@gmail.com
Sent: Friday, 25 June 2010 3:46 PM
To: ozDotNet
Subject: Re: KPI's for software developers

Number of dilbert strips on the wall measures the developer/management 
dissatisfaction rate.

Davy

BBM pin:2589AEE0


From: Eddie de Bear 
Sender: ozdotnet-boun...@ozdotnet.com
Date: Fri, 25 Jun 2010 11:28:03 +1000
To: ozDotNet
ReplyTo: ozDotNet 
Subject: Re: KPI's for software developers

lol, one of the places I worked (years ago) that happened. I didn't write the 
code, but I was told to run it through an obfuscator before the code was handed 
over. The main reason was to strip out all the comments AND nasty variable 
names..
On Fri, Jun 25, 2010 at 11:18 AM, David Richards 
mailto:ausdot...@davidsuniverse.com>> wrote:
Until you later find out the client also bought the source code and you have to 
give it to them.  I've had this happen with a couple of projects.  Fortunately, 
I'm a polite commentor.  :)

David

"If we can hit that bullseye, the rest of the dominoes
will fall like a house of cards... checkmate!"
-Zapp Brannigan, Futurama

On Fri, Jun 25, 2010 at 11:11, Eddie de Bear 
mailto:eddie.deb...@gmail.com>> wrote:
Ratio of Code to Coments complaining about the client.. That's always a good 
way to go ;)




--
Eddie de Bear
Mob: 0417066315
Messenger: eddie_deb...@hotmail.com
Skype: eddiedebear


RE: Embedding SQL index hints into SQL commands for SQL SERVER.

2010-06-22 Thread Maddin, Peter
I actually made the requested changed to my SQL command but there was no 
discernable difference.
I really wasn't expecting any.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of noonie
Sent: Wednesday, 23 June 2010 11:14 AM
To: ozDotNet
Subject: Re: Embedding SQL index hints into SQL commands for SQL SERVER.

Peter,

If the DBA has created that index on the bit column and if the normal process 
of your store-and-forward results in a very few records matching your criteria 
then the index may actually help your query times.

<http://msmvps.com/blogs/greglow/archive/2004/12/20/26432.aspx>

As to whether this is the "right" resolution for the problem or merely a 
"political" one may be a matter for argument ;-)



Boss: "How's that database problem going?"

Snarky DBA: "I sent him the query that would fix his poorly performing program. 
(bloody application developers shouldn't be alowed to write TSQL!)"



--
Regards,
noonie

On 23 June 2010 11:40, Maddin, Peter 
mailto:peter.mad...@pathwest.wa.gov.au>> wrote:
Thanks

It is not the inserting of records into the database that is a problem. This is 
in fact lightening fast.

The problem is obtaining a record set of data to be forwarded using a select 
statement.
The table uses bit flags to determine which records need to be forwarded as 
apposed from those that  have been already forwarded.

For several years, the select statement has always returned its result set with 
30 seconds.
There are a two sets bit flags which are used to determine where the data is to 
be forwarded to.

One query is working fine (for the present), the other is timing out.

I could extend the timeout but eventually it will again timeout as the database 
grows in size.
The database contains many historical records that are literally years old.
There is no need to these to be kept and these can be deleted.

The select statement returns a Text blob field which has data that can be 
several kilobytes in size.
I have removed this from the select statement and will be selecting this for 
each row of the select statement returned.


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au<mailto:peter.mad...@pathwest.wa.gov.au>



RE: Embedding SQL index hints into SQL commands for SQL SERVER.

2010-06-22 Thread Maddin, Peter
Thanks

When I was using Informix on SCO Unix (That feels like a lifetime ago) I had a 
job that ran update statistics on a regular basis (every hour from memory). In 
fact one had to do this or strange things happened.

With SQL Server, I understood that this can be set to done automatically.
I just checked and one can set this for a Database under options -> automatic.

If this is an invalid assumption on my part please let me know.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Paul Duran
Sent: Tuesday, 22 June 2010 1:18 PM
To: ozDotNet
Subject: RE: Embedding SQL index hints into SQL commands for SQL SERVER.

Another recommendation would be to run an 'update statistics' (eg: 
sp_updatestats) so that the query optimiser is able to make more informed 
choices when optimising your queries.

Cheers
Paul.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Corneliu I. Tusnea
Sent: Tuesday, 22 June 2010 2:03 PM
To: ozDotNet
Subject: Re: Embedding SQL index hints into SQL commands for SQL SERVER.

Peter,


As everyone here seems to suggest your hint for the query is not what you are 
looking for just like everyone else said.
6000 requests a day on a 20Gb database is peanuts for any sql server. That's 
like 12 requests per minute within the 8h working time when most of the 
databases can cope with few hundred requests a second.

Can you post here the schema definition for your two tables and the indexes 
that are defined?

Some other recommendations:
1. Rebuild your indexes (it won't impact select performance too much but it 
will help)
2. Try to reduce your database/table sizes. (backup, shrink, change backup 
model to simple, backup again, shrink, backup, restore) google for other 
versions of the same task.
3. Check if you don't have disk errors that can make sql slower (dbcc checkdb) 
and checkdsk.
3. Verify data conversions (size, type or collation) between columns used in 
join clauses. Sql is not always very happy about that.
e.g. P.PracticeCode is varchar(20) with one collation while R.PractiveCode is 
nvarchar(30) with a different collation.
4. Is your "results" table in there a view? Maybe that is the slow(er) bit! 
Maybe you have a lovely and popular DISTINCT in that view.
5. Verify you have a Clustered Index on P.PracticeCode and a Non-clustered 
Index on R.PracticeCode
6. Verify that you don't have more that one such index on the same columns)
7. Run your query with the Show Actual Execution Plan.

Just some thoughts.

Corneliu.


On Tue, Jun 22, 2010 at 1:13 PM, Greg Low (greglow.com<http://greglow.com>) 
mailto:g...@greglow.com>> wrote:
Hi Peter,

In general, if the indexing is ok, the amount of data in the table (within 
reason) is not really an issue. That's still a *relatively* small table. As an 
example, we have one client in Melbourne with a 6TB table. The only time the 
amount of data affects you is if you're reading the whole thing for some reason.

If the DBA has added an index and thinks you need a hint to make your query use 
it, it's highly likely that it's the wrong index that he/she has built.

What is the definition of the index that has been built for this query? If you 
can post the DDL for the two tables and the indexes, we can probably help 
further.

Regards,

Greg

From: Maddin, Peter 
[mailto:peter.mad...@pathwest.wa.gov.au<mailto:peter.mad...@pathwest.wa.gov.au>]
Sent: Tuesday, 22 June 2010 11:12 AM
To: g...@greglow.com<mailto:g...@greglow.com>; ozDotNet

Subject: RE: Embedding SQL index hints into SQL commands for SQL SERVER.


Thanks Greg and everyone else.



I designed the database which has the simplest schema of any database I have 
ever designed. Its only a small but critical part of the whole system.

It operated quite well for several years and performance problems have only 
become evident since the database started approaching 20GB.

The database serves as a store and forward repository. It allows for the 
caching of data so should anything go awry with what has been forwarded, there 
is the opportunity for some data to be set to be forwarded again. The required 
period of time to keep forwarded data is probably only for a year or so. That 
was my intention.



At the comme

RE: Embedding SQL index hints into SQL commands for SQL SERVER.

2010-06-22 Thread Maddin, Peter
Thanks

It is not the inserting of records into the database that is a problem. This is 
in fact lightening fast.

The problem is obtaining a record set of data to be forwarded using a select 
statement.
The table uses bit flags to determine which records need to be forwarded as 
apposed from those that  have been already forwarded.

For several years, the select statement has always returned its result set with 
30 seconds.
There are a two sets bit flags which are used to determine where the data is to 
be forwarded to.

One query is working fine (for the present), the other is timing out.

I could extend the timeout but eventually it will again timeout as the database 
grows in size.
The database contains many historical records that are literally years old.
There is no need to these to be kept and these can be deleted.

The select statement returns a Text blob field which has data that can be 
several kilobytes in size.
I have removed this from the select statement and will be selecting this for 
each row of the select statement returned.


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Corneliu I. Tusnea
Sent: Tuesday, 22 June 2010 12:03 PM
To: ozDotNet
Subject: Re: Embedding SQL index hints into SQL commands for SQL SERVER.

Peter,


As everyone here seems to suggest your hint for the query is not what you are 
looking for just like everyone else said.
6000 requests a day on a 20Gb database is peanuts for any sql server. That's 
like 12 requests per minute within the 8h working time when most of the 
databases can cope with few hundred requests a second.

Can you post here the schema definition for your two tables and the indexes 
that are defined?

Some other recommendations:
1. Rebuild your indexes (it won't impact select performance too much but it 
will help)
2. Try to reduce your database/table sizes. (backup, shrink, change backup 
model to simple, backup again, shrink, backup, restore) google for other 
versions of the same task.
3. Check if you don't have disk errors that can make sql slower (dbcc checkdb) 
and checkdsk.
3. Verify data conversions (size, type or collation) between columns used in 
join clauses. Sql is not always very happy about that.
e.g. P.PracticeCode is varchar(20) with one collation while R.PractiveCode is 
nvarchar(30) with a different collation.
4. Is your "results" table in there a view? Maybe that is the slow(er) bit! 
Maybe you have a lovely and popular DISTINCT in that view.
5. Verify you have a Clustered Index on P.PracticeCode and a Non-clustered 
Index on R.PracticeCode
6. Verify that you don't have more that one such index on the same columns)
7. Run your query with the Show Actual Execution Plan.

Just some thoughts.

Corneliu.


On Tue, Jun 22, 2010 at 1:13 PM, Greg Low (greglow.com<http://greglow.com>) 
mailto:g...@greglow.com>> wrote:
Hi Peter,

In general, if the indexing is ok, the amount of data in the table (within 
reason) is not really an issue. That's still a *relatively* small table. As an 
example, we have one client in Melbourne with a 6TB table. The only time the 
amount of data affects you is if you're reading the whole thing for some reason.

If the DBA has added an index and thinks you need a hint to make your query use 
it, it's highly likely that it's the wrong index that he/she has built.

What is the definition of the index that has been built for this query? If you 
can post the DDL for the two tables and the indexes, we can probably help 
further.

Regards,

Greg

From: Maddin, Peter 
[mailto:peter.mad...@pathwest.wa.gov.au<mailto:peter.mad...@pathwest.wa.gov.au>]
Sent: Tuesday, 22 June 2010 11:12 AM
To: g...@greglow.com<mailto:g...@greglow.com>; ozDotNet

Subject: RE: Embedding SQL index hints into SQL commands for SQL SERVER.


Thanks Greg and everyone else.



I designed the database which has the simplest schema of any database I have 
ever designed. Its only a small but critical part of the whole system.

It operated quite well for several years and performance problems have only 
become evident since the database started approaching 20GB.

The database serves as a store and forward repository. It allows for the 
caching of data so should anything go awry with what has been forwarded, there 

RE: Embedding SQL index hints into SQL commands for SQL SERVER.

2010-06-21 Thread Maddin, Peter
 index hints into SQL commands for SQL SERVER.



Hi Peter,



Databases that only have a relatively small amount of data and are unusually

large are often caused by having transaction logs that have blown out in

size. The usual way to reduce the size of the transaction log is simply to

back it up properly (depending on the recovery model).



As for using index hints, I usually don't need them, because with a simple

re-arrangement of the query, it will select the correct index anyway (in

most cases). This usually involves reorganising the where clause / joins so

the order of columns matches the order of the index.



I recently blogged on ways that I was able to successfully improve query

performance at one of my clients. May or may not help, I don't know, but it

might give you some ideas:

http://tonesdotnetblog.wordpress.com/2010/06/19/tips-for-optimizing-sql-serv

er-2008-queries/

and I have an older article with different set of tips for 2005 which may be

relevant too:

http://tonesdotnetblog.wordpress.com/2008/05/26/twelve-tips-for-optimising-s

ql-server-2005-

queries/



T.



On Mon, Jun 21st, 2010 at 9:07 PM, Peter Maddin 

wrote:



> I have no idea what the DBA has done to determine what the issues are.

> He is usually not that informative.

> Its just do this.

>

> I believe the database has grown too large.

> The system has been working fine until the database grew to past 15

> GB.

> There is no  reason for it to be any near this size.

> I said the database needs to be purged of unnecessary records and

> shrunk however I am a mere developer.

>

>

> Regards Peter

>

> On 21/06/2010 6:39 PM, Michael Nemtsev wrote:

> >

> > How did you determine that the issue with the indexes? Did you use

> any

> > SQL performance monitoring tools that point you to the indexes or

> it's

> > just a guess?

> >

> > Hits are usually the last resort when you can't rewrite the query

> to

> > have the right execution plan, or when you query is quite complex

> and

> > can't pickup the right indexes, so you point your query to the

> right

> > stuff.

> >

> > *Michael Nemtsev*

> >

> > Microsoft MVP

> >

> > B: http://msmvps.com/blogs/laflour

> >

> > S: http://www.sharepoint-sandbox.com

> >

> > *From:* ozdotnet-boun...@ozdotnet.com

> > [mailto:ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Maddin,

> Peter

> > *Sent:* Monday, 21 June 2010 7:57 PM

> > *To:* ozdotnet@ozdotnet.com

> > *Subject:* Embedding SQL index hints into SQL commands for SQL

> SERVER.

> >

> > I have a DBA that is suggesting that to improve performance I need

> to

> > embed optimizer hints in the SQL commands that I use against the

> > database so it will use specific indexes.

> >

> > Is this a good idea?

> >

> > I believe performance problems are related to the size of the

> database

> > as my test database (2 GB) has no problems at all and the

> production

> > database has grown large and fat with lots of unnecessary records

> that

> > should have been purged years ago.

> >

> > I would have thought that embedding optimizer hints into a SQL

> > statement in my code increases the level of coupling between my

> code

> > and the database which is not a good thing.

> >

> > Also it's the role of the optimizer to determine what indexes

> > (provided they exist) to use.

> >

> > Has anyone else done this sort of thing?

> >

> > Am I just being stupid (or more so than usual)?

> >

> > *Regards Peter Maddin*

> > *Applications Development Officer*

> > *Path**West Laboratory Medicine WA*

> > *Phone : +618 9473 3944*

> > *Fax : +618 9473 3982*

> > *E-Mail : peter.mad...@pathwest.wa.gov.au

> > <mailto:peter.mad...@pathwest.wa.gov.au>*

> > *The contents of this e-mail transmission outside of the WAGHS

> network

> > are intended solely for the named recipient's), may be

> confidential,

> > and may be privileged or otherwise protected from disclosure in the

>

> > public interest. The use, reproduction, disclosure or distribution

> of

> > the contents of this e-mail transmission by any person other than

> the

> > named recipient(s) is prohibited. If you are not a named recipient

>

> > please notify the sender immediately.*

> >

>










Embedding SQL index hints into SQL commands for SQL SERVER.

2010-06-21 Thread Maddin, Peter
I have a DBA that is suggesting that to improve performance I need to embed 
optimizer hints in the SQL commands that I use against the database so it will 
use specific indexes.

Is this a good idea?

I believe performance problems are related to the size of the database as my 
test database (2 GB) has no problems at all and the production database has 
grown large and fat with lots of unnecessary records that should have been 
purged years ago.

I would have thought that embedding optimizer hints into a SQL statement in my 
code increases the level of coupling between my code and the database which is 
not a good thing.
Also it's the role of the optimizer to determine what indexes (provided they 
exist) to use.

Has anyone else done this sort of thing?
Am I just being stupid (or more so than usual)?

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.



RE: DriveInfo.GetDrives() not returning

2010-05-18 Thread Maddin, Peter
Aha!

That must be where I picked it up from.

http://www.codeproject.com/KB/database/CsvReader.aspx

using System.IO;
using LumenWorks.Framework.IO.Csv;

void ReadCsv()
{
// open the file "data.csv" which is a CSV file with headers
using (CsvReader csv =
   new CsvReader(new StreamReader("data.csv"), true)) // 
<<=== *
{
int fieldCount = csv.FieldCount;
string[] headers = csv.GetFieldHeaders();

while (csv.ReadNextRecord())
{
for (int i = 0; i < fieldCount; i++)
Console.Write(string.Format("{0} = {1};",
  headers[i], csv[i]));

Console.WriteLine();
}
}
}

You are right, I should have looked at his source code. In disposing of the 
CsvReader instance, the author would have disposed of any supplied stream 
object. However I was tearing my hair out (which is difficult considering the 
paucity of it on my scalp) trying to find out why my application was hanging. 
Lost a day and half on this before I discovered it was a commercial security 
product silently pushed out to all workstations that was the alleged cause 
(uninstalling it fixed the problem). I believed a support task has now been 
submitted.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.





-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Sam Lai
Sent: Wednesday, 19 May 2010 8:31 AM
To: ozDotNet
Subject: Re: DriveInfo.GetDrives() not returning

Inline.

On 18 May 2010 16:13, Maddin, Peter  wrote:

> I just noticed they had (although they might deny it now that I have been 
> working on it).
>
>                originalFileName = String.Empty;
>                using (var csv = new CsvReader(new StreamReader(fileName), 
> true, Delimitor))
>                {
>
> That does not look right. The filestream will never be closed (at least I 
> don't think so)

It should be if CsvReader is based on the TextReader family of classes
(CsvReader doesn't seem to be a class in the BCL). I'm assuming this
given the naming scheme.

Actually, just found the what I think is the CsvReader class being
used [1]. Given he claims it follows StreamReader's design closely,
I'd say that line of code will be fine because StreamReader (actually,
the abstract base class TextReader) dictates that calling close()
"Closes the StreamReader object *and the underlying stream*, and
releases any system resources associated with the reader." [2]
(emphasis mine)

I'd take a look at the source code, but cbf signing up at CodeProject.
Also, he uses that using statement in his examples :)

[1] - http://www.codeproject.com/KB/database/CsvReader.aspx
[2] - 
http://msdn.microsoft.com/en-us/library/system.io.streamreader.close(v=VS.100).aspx

> I have changed this to
>
>            originalFileName = String.Empty;
>            // open the file. It is expected to be a CSV file with headers
>            using (var sr = new StreamReader(fileName))
>            {
>                using (var csv = new CsvReader(sr, true, Delimitor))
>                {
>
> I will try this out after another reboot.
>
> I will also try out the Directory.GetLogicalDrives();
> If the above does not achieve anything.
>
>
> Regards Peter Maddin
> Applications Development Officer
> PathWest Laboratory Medicine WA
> Phone : +618 9473 3944
> Fax : +618 9473 3982
> E-Mail : peter.mad...@pathwest.wa.gov.au
> The contents of this e-mail transmission outside of the WAGHS network are 
> intended solely for the named recipient's), may be confidential, and may be 
> privileged or otherwise protected from disclosure in the public interest. The 
> use, reproduction, disclosure or distribution of the contents of this e-mail 
> transmission by any person other than the named recipient(s) is prohibited. 
> If you are not a named recipient please notify the sender immediately.
>
>
>
>
> -Original Message-
> From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
> Behalf Of silky
> Sent: Tuesday, 18 May 2010 1:26 PM
> To: ozDotNet
> Subject: Re: DriveInfo.GetDrives() not returning
>
> On Tue,

RE: DriveInfo.GetDrives() not returning

2010-05-18 Thread Maddin, Peter
Oh and thanks very much for everyone's input.
Very much appreciated.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Maddin, Peter
Sent: Tuesday, 18 May 2010 4:13 PM
To: ozDotNet
Subject: RE: DriveInfo.GetDrives() not returning
Importance: High

I have found the cause of the problem.

It was some new security software that pushed out to all workstations by sys 
admin.
I was unaware of this until someone said when I was using their workstation to 
test things, "hey could it be this new software thing that was pushed out 
recently".

I knew they were going to do something about thumb drives but I thought they 
were going to provide thumb drives that could be encrypted.
This software affects everything removable. I have only just moved to a new 
workstation because of AD account lockouts so I thought it might be the 
workstation.

When the software was uninstalled on my workstation, it worked as expected.
Sys Admin are going to put in a support request to have the issue examined.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of David Kean
Sent: Tuesday, 18 May 2010 12:12 PM
To: ozDotNet
Cc: David Kean
Subject: RE: DriveInfo.GetDrives() not returning

I actually own this code - I'll have a look at this in the morning (Seattle 
time).

From: ozdotnet-boun...@ozdotnet.com [ozdotnet-boun...@ozdotnet.com] on behalf 
of Maddin, Peter [peter.mad...@pathwest.wa.gov.au]
Sent: Monday, May 17, 2010 8:53 PM
To: ozdotnet@ozdotnet.com
Subject: DriveInfo.GetDrives() not returning
I am writing a simple application where users can import data from a file on a 
CD/DVD.

To get a list of ready CD/DVD drives I am using this code

  /// 
/// Returns drives of specified type ~ and specified status.
/// 
/// The type of drive one is primarily 
interested in
/// 
/// Drive designation of the first available drive for the specified 
DriveType or if none are ready, the
/// drive designation of the drive where this assembly is being 
executed.
/// 
private List GetDrivesOfType(DriveType driveType)
{
DriveInfo[] allDrives = DriveInfo.GetDrives();
var selectedDrives = new List();
// Look for first CD/DVD drive that is ready
foreach (DriveInfo drive in allDrives)
{
if (drive.DriveType == driveType)
if (drive.IsReady)
{
selectedDrives.Add(drive);
// we only want the first ready CD/DVD drive
break;
}
}
// if there is no ready CD/DVD drive then get the drive info for
// the drive where this assembly is executing.
if (selectedDrives.Count == 0)
selectedDrives.Add(new 
DriveInfo(Path.GetPathRoot(Assembly.GetExecutingAssembly().Location))); ;

return selectedDrives;
}

When I first use this method, it works fine.
When a user opens the drive, removes the CD/DVD, closes it again and waits for 
it to register the presence of new media, then as part of the process to read 
in a new file
the method is called again.

When called a second time, it hangs on DriveInfo[] allDrives = 
DriveInfo.GetDrives();

The actual application turn rogue. You cannot kill it off in windows task 
manager.
If debugging in Vs2008, the debugger eventually detaches the process and one 
can start again.

Is there any known reason why this sort of behaviour would occur?

I moved DriveInfo[] allDrives = DriveInfo.GetDrives();
So its called o

RE: DriveInfo.GetDrives() not returning

2010-05-18 Thread Maddin, Peter
I have found the cause of the problem.

It was some new security software that pushed out to all workstations by sys 
admin.
I was unaware of this until someone said when I was using their workstation to 
test things, "hey could it be this new software thing that was pushed out 
recently".

I knew they were going to do something about thumb drives but I thought they 
were going to provide thumb drives that could be encrypted.
This software affects everything removable. I have only just moved to a new 
workstation because of AD account lockouts so I thought it might be the 
workstation.

When the software was uninstalled on my workstation, it worked as expected.
Sys Admin are going to put in a support request to have the issue examined.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of David Kean
Sent: Tuesday, 18 May 2010 12:12 PM
To: ozDotNet
Cc: David Kean
Subject: RE: DriveInfo.GetDrives() not returning

I actually own this code - I'll have a look at this in the morning (Seattle 
time).

From: ozdotnet-boun...@ozdotnet.com [ozdotnet-boun...@ozdotnet.com] on behalf 
of Maddin, Peter [peter.mad...@pathwest.wa.gov.au]
Sent: Monday, May 17, 2010 8:53 PM
To: ozdotnet@ozdotnet.com
Subject: DriveInfo.GetDrives() not returning
I am writing a simple application where users can import data from a file on a 
CD/DVD.

To get a list of ready CD/DVD drives I am using this code

  /// 
/// Returns drives of specified type ~ and specified status.
/// 
/// The type of drive one is primarily 
interested in
/// 
/// Drive designation of the first available drive for the specified 
DriveType or if none are ready, the
/// drive designation of the drive where this assembly is being 
executed.
/// 
private List GetDrivesOfType(DriveType driveType)
{
DriveInfo[] allDrives = DriveInfo.GetDrives();
var selectedDrives = new List();
// Look for first CD/DVD drive that is ready
foreach (DriveInfo drive in allDrives)
{
if (drive.DriveType == driveType)
if (drive.IsReady)
{
selectedDrives.Add(drive);
// we only want the first ready CD/DVD drive
break;
}
}
// if there is no ready CD/DVD drive then get the drive info for
// the drive where this assembly is executing.
if (selectedDrives.Count == 0)
selectedDrives.Add(new 
DriveInfo(Path.GetPathRoot(Assembly.GetExecutingAssembly().Location))); ;

return selectedDrives;
}

When I first use this method, it works fine.
When a user opens the drive, removes the CD/DVD, closes it again and waits for 
it to register the presence of new media, then as part of the process to read 
in a new file
the method is called again.

When called a second time, it hangs on DriveInfo[] allDrives = 
DriveInfo.GetDrives();

The actual application turn rogue. You cannot kill it off in windows task 
manager.
If debugging in Vs2008, the debugger eventually detaches the process and one 
can start again.

Is there any known reason why this sort of behaviour would occur?

I moved DriveInfo[] allDrives = DriveInfo.GetDrives();
So its called only once, but then it hangs on
if (drive.IsReady)

I can't seem to do anything to address this problem.
The DriveInfo class does not have anything that I can see t
One solution I have had is to run this in a separate thread and it if does not 
respond, kill the thread.
Ok that may deal with the hang-up but it still does not enable the user to open 
and process on the files on the CD/DVD media.

I have googled on this and seen other with similar issues. One suggestion is 
that the DriveInfo[] allDrives = DriveInfo.GetDrives();
Will usually return after 30 seconds but may take up to 3 minutes. In my case 
it does not return at all.

I am targeting .NET 3.5. Is it a framework problem, driver problem, some other 
problem?
Could it just be the machine I am using?
Anyone else experienced this sort of issue?


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 39

RE: DriveInfo.GetDrives() not returning

2010-05-17 Thread Maddin, Peter
Changing my code from

originalFileName = String.Empty;
using (var csv = new CsvReader(new StreamReader(fileName), 
true, Delimitor))
{

To

originalFileName = String.Empty;
// open the file. It is expected to be a CSV file with headers
using (var sr = new StreamReader(fileName))
{
using (var csv = new CsvReader(sr, true, Delimitor))
{

Fixed nothing. I guess even if the second piece of code is correct, I am a way 
off running out of window resources.
I am now sure the crap code is mine. So much for trying to blame someone else. 
At least this issue identified another potential problem.

Copied the code into a small standalone winforms application with a single 
button.
The isolated app also hangs.

Will take the isolated app to another workstation.

Then I will move on to trying out
Directory.GetLogicalDrives();


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.




-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Maddin, Peter
Sent: Tuesday, 18 May 2010 2:13 PM
To: michaelsli...@gmail.com; ozDotNet
Subject: RE: DriveInfo.GetDrives() not returning

Thanks Silky and Bill

I was just going to isolate my code in a small standalone application just 
prior to reading your missive.

I thought their might be some lock in place but I only use this code in one 
place.
The method is static. There is no means to close, shutdown or release anything 
that I could find.

Hmmmn, That made me think. This is a project that was started by someone else.

I just noticed they had (although they might deny it now that I have been 
working on it).

originalFileName = String.Empty;
using (var csv = new CsvReader(new StreamReader(fileName), 
true, Delimitor))
{

That does not look right. The filestream will never be closed (at least I don't 
think so)

I have changed this to 

originalFileName = String.Empty;
// open the file. It is expected to be a CSV file with headers
using (var sr = new StreamReader(fileName))
{
using (var csv = new CsvReader(sr, true, Delimitor))
{

I will try this out after another reboot.

I will also try out the Directory.GetLogicalDrives();
If the above does not achieve anything.


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.




-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of silky
Sent: Tuesday, 18 May 2010 1:26 PM
To: ozDotNet
Subject: Re: DriveInfo.GetDrives() not returning

On Tue, May 18, 2010 at 1:53 PM, Maddin, Peter
 wrote:

[...]

> I am targeting .NET 3.5. Is it a framework problem, driver problem, some
> other problem?
>
> Could it just be the machine I am using?

I know its boring but can you reproduce it in a stand-alone app? (not
part of your main one?)

My guess would be you're somehow in a lock with yourself.


> Regards Peter Maddin
> Applications Development Officer
> PathWest Laboratory Medicine WA
> Phone : +618 9473 3944
> Fax : +618 9473 3982
> E-Mail : peter.mad...@pathwest.wa.gov.au
> The contents of this e-mail transmission outside of the WAGHS network are
> intended solely for the named recipient's), may be confidential, and may be
> privileged or otherwise protected from disclosure in the public interest.
> The use, reproduction, disclosure or distribution of the contents of this
> e-mail transmission by any person other than the named recipient(s) is
> prohibited. If you are not a named recipient please notify the sender
> immediately.

-- 
silky

  http://www.programmingbranch.com/


RE: DriveInfo.GetDrives() not returning

2010-05-17 Thread Maddin, Peter
Thanks Silky and Bill

I was just going to isolate my code in a small standalone application just 
prior to reading your missive.

I thought their might be some lock in place but I only use this code in one 
place.
The method is static. There is no means to close, shutdown or release anything 
that I could find.

Hmmmn, That made me think. This is a project that was started by someone else.

I just noticed they had (although they might deny it now that I have been 
working on it).

originalFileName = String.Empty;
using (var csv = new CsvReader(new StreamReader(fileName), 
true, Delimitor))
{

That does not look right. The filestream will never be closed (at least I don't 
think so)

I have changed this to 

originalFileName = String.Empty;
// open the file. It is expected to be a CSV file with headers
using (var sr = new StreamReader(fileName))
{
using (var csv = new CsvReader(sr, true, Delimitor))
{

I will try this out after another reboot.

I will also try out the Directory.GetLogicalDrives();
If the above does not achieve anything.


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.




-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of silky
Sent: Tuesday, 18 May 2010 1:26 PM
To: ozDotNet
Subject: Re: DriveInfo.GetDrives() not returning

On Tue, May 18, 2010 at 1:53 PM, Maddin, Peter
 wrote:

[...]

> I am targeting .NET 3.5. Is it a framework problem, driver problem, some
> other problem?
>
> Could it just be the machine I am using?

I know its boring but can you reproduce it in a stand-alone app? (not
part of your main one?)

My guess would be you're somehow in a lock with yourself.


> Regards Peter Maddin
> Applications Development Officer
> PathWest Laboratory Medicine WA
> Phone : +618 9473 3944
> Fax : +618 9473 3982
> E-Mail : peter.mad...@pathwest.wa.gov.au
> The contents of this e-mail transmission outside of the WAGHS network are
> intended solely for the named recipient's), may be confidential, and may be
> privileged or otherwise protected from disclosure in the public interest.
> The use, reproduction, disclosure or distribution of the contents of this
> e-mail transmission by any person other than the named recipient(s) is
> prohibited. If you are not a named recipient please notify the sender
> immediately.

-- 
silky

  http://www.programmingbranch.com/


DriveInfo.GetDrives() not returning

2010-05-17 Thread Maddin, Peter
I am writing a simple application where users can import data from a file on a 
CD/DVD.

To get a list of ready CD/DVD drives I am using this code

  /// 
/// Returns drives of specified type ~ and specified status.
/// 
/// The type of drive one is primarily 
interested in
/// 
/// Drive designation of the first available drive for the specified 
DriveType or if none are ready, the
/// drive designation of the drive where this assembly is being 
executed.
/// 
private List GetDrivesOfType(DriveType driveType)
{
DriveInfo[] allDrives = DriveInfo.GetDrives();
var selectedDrives = new List();
// Look for first CD/DVD drive that is ready
foreach (DriveInfo drive in allDrives)
{
if (drive.DriveType == driveType)
if (drive.IsReady)
{
selectedDrives.Add(drive);
// we only want the first ready CD/DVD drive
break;
}
}
// if there is no ready CD/DVD drive then get the drive info for
// the drive where this assembly is executing.
if (selectedDrives.Count == 0)
selectedDrives.Add(new 
DriveInfo(Path.GetPathRoot(Assembly.GetExecutingAssembly().Location))); ;

return selectedDrives;
}

When I first use this method, it works fine.
When a user opens the drive, removes the CD/DVD, closes it again and waits for 
it to register the presence of new media, then as part of the process to read 
in a new file
the method is called again.

When called a second time, it hangs on DriveInfo[] allDrives = 
DriveInfo.GetDrives();

The actual application turn rogue. You cannot kill it off in windows task 
manager.
If debugging in Vs2008, the debugger eventually detaches the process and one 
can start again.

Is there any known reason why this sort of behaviour would occur?

I moved DriveInfo[] allDrives = DriveInfo.GetDrives();
So its called only once, but then it hangs on
if (drive.IsReady)

I can't seem to do anything to address this problem.
The DriveInfo class does not have anything that I can see t
One solution I have had is to run this in a separate thread and it if does not 
respond, kill the thread.
Ok that may deal with the hang-up but it still does not enable the user to open 
and process on the files on the CD/DVD media.

I have googled on this and seen other with similar issues. One suggestion is 
that the DriveInfo[] allDrives = DriveInfo.GetDrives();
Will usually return after 30 seconds but may take up to 3 minutes. In my case 
it does not return at all.

I am targeting .NET 3.5. Is it a framework problem, driver problem, some other 
problem?
Could it just be the machine I am using?
Anyone else experienced this sort of issue?


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.







RE: Isolated Storage Security

2010-03-15 Thread Maddin, Peter
Hi Silky

>> It is.

Thanks for the reassurance.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

>> -Original Message-
>> From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-
>> boun...@ozdotnet.com] On Behalf Of silky
>> Sent: Monday, 15 March 2010 3:18 PM
>> To: ozDotNet
>> Subject: Re: Isolated Storage Security
>> 
>> On Mon, Mar 15, 2010 at 6:12 PM, Maddin, Peter
>>  wrote:
>> 
>> [...]
>> 
>> > One can also use
>> >
>> >     listBox1.Items.Add("ApplicationData : " +
>> > Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
>> >
>> > For the current roaming user. I am not sure that this is a good practice or
>> > not.
>> 
>> It is.
>> 
>> 
>> > Regards Peter Maddin
>> > Applications Development Officer
>> > PathWest Laboratory Medicine WA
>> > Phone : +618 9473 3944
>> > Fax : +618 9473 3982
>> > E-Mail : peter.mad...@pathwest.wa.gov.au
>> > The contents of this e-mail transmission outside of the WAGHS network are
>> > intended solely for the named recipient's), may be confidential, and may be
>> > privileged or otherwise protected from disclosure in the public interest.
>> > The use, reproduction, disclosure or distribution of the contents of this
>> > e-mail transmission by any person other than the named recipient(s) is
>> > prohibited. If you are not a named recipient please notify the sender
>> > immediately.
>> 
>> --
>> silky
>> 
>>   http://www.programmingbranch.com/


RE: Isolated Storage Security

2010-03-15 Thread Maddin, Peter
Hi Greg

>> Peter, is it something to do with the need for a strong name or a publishing 
>> certificate?

Tried those. Did not solve the problem. Well I did not publish the application 
but I did specify to sign the ClickOnce manifest. As I did not actually publish 
it, there would be no manifest so it was not surprising it did not solve 
anything.

When I commented out

listBox1.Items.Add("GetMachineStoreForApplication : " + 
IsolatedStorageFile.GetMachineStoreForApplication());
and
listBox1.Items.Add("GetUserStoreForApplication : " + 
IsolatedStorageFile.GetUserStoreForApplication());

It seemed to like it better (at least I did not get an exception).

>physical location of these stores is rather opaque

Just like where ClickOnce actually places one's assemblies and related stuff.

It does not matter as long as I can create a file or directory and use this to 
persist information (and read it back of course).

> Hang on! That's my epitaph in the modern programming world. As Stephen says, 
> if it was easy, everyone would be doing it. That doesn't make me feel any 
> better though ;-)

Good point. We wouldn't have a job would we. I could say something about MS 
Access developers but I must resist the temptation.


Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Greg Keogh
Sent: Monday, 15 March 2010 3:02 PM
To: 'ozDotNet'
Subject: RE: Isolated Storage Security

Peter, is it something to do with the need for a strong name or a publishing 
certificate?

I don't think your listbox will show anything useful, as the physical location 
of these stores is rather opaque (you can see them buried deep under the Users 
folders with mangled folder names that look like they're made of hashes.

Why does something that should be simple have to be made so hard??

Hang on! That's my epitaph in the modern programming world. As Stephen says, if 
it was easy, everyone would be doing it. That doesn't make me feel any better 
though ;-)

Greg


RE: Isolated Storage Security

2010-03-15 Thread Maddin, Peter
Thanks Ian

The problem is two of IsolatedStorageLocations appear to be unavailable.
I commented these out and the others are fine.
IsolatedStoragelocations for Assembly are fine.


//listBox1.Items.Add("GetMachineStoreForApplication : " + 
IsolatedStorageFile.GetMachineStoreForApplication());
listBox1.Items.Add("GetMachineStoreForAssembly : " + 
IsolatedStorageFile.GetMachineStoreForAssembly());
listBox1.Items.Add("GetMachineStoreForDomain : " + 
IsolatedStorageFile.GetMachineStoreForDomain());
//listBox1.Items.Add("GetUserStoreForApplication : " + 
IsolatedStorageFile.GetUserStoreForApplication());
listBox1.Items.Add("GetUserStoreForAssembly : " + 
IsolatedStorageFile.GetUserStoreForAssembly());
listBox1.Items.Add("GetUserStoreForDomain : " + 
IsolatedStorageFile.GetUserStoreForDomain());

One can also use
listBox1.Items.Add("ApplicationData : " + 
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
For the current roaming user. I am not sure that this is a good practice or not.

Most user profiles here are roaming.
So I need to persist user configuration settings as well as
Configuration settings on an assembly basis (we are using CAB modules so that 
is what we want anyway).

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Ian Thomas
Sent: Monday, 15 March 2010 2:46 PM
To: 'ozDotNet'
Subject: RE: Isolated Storage Security

Can't see anything obvious, but there's a fairly complete example at 
http://msdn.microsoft.com/en-us/library/system.security.permissions.isolatedstoragefilepermission(v=VS.80).aspx



Ian Thomas
Victoria Park, Western Australia

____
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Maddin, Peter
Sent: Monday, 15 March 2010 1:47 PM
To: ozdotnet@ozdotnet.com
Subject: Isolated Storage Security

Currently using XP Pro as our SOE. Will be moving to Win 7 with PC fleet 
replacement.

I want to write my applications so that I can persist application/assembly 
settings and also user settings so it will run with Win 7.
This is probably really old ground for most so I apologise for bringing 
something up that has probably been dealt to death previously.

I have written a really basic application to discover where these are. I am 
just adding the possible locations to a listbox.

listBox1.Items.Add("GetMachineStoreForApplication : " + 
IsolatedStorageFile.GetMachineStoreForApplication());
listBox1.Items.Add("GetMachineStoreForAssembly : " + 
IsolatedStorageFile.GetMachineStoreForAssembly());
listBox1.Items.Add("GetMachineStoreForDomain : " + 
IsolatedStorageFile.GetMachineStoreForDomain());
listBox1.Items.Add("GetUserStoreForApplication : " + 
IsolatedStorageFile.GetUserStoreForApplication());
listBox1.Items.Add("GetUserStoreForAssembly : " + 
IsolatedStorageFile.GetUserStoreForAssembly());
listBox1.Items.Add("GetUserStoreForDomain : " + 
IsolatedStorageFile.GetUserStoreForDomain());

It bombs on the first line with a IsolatedStorageException "Unable to determine 
application identity of the caller."

>From looking around (Google etc). Once one deploys with ClickOnce this issue 
>goes away. Ok but what does one do prior to this? What of one wants to use 
>something other than ClickOnce!

What does one do to get it to work? Strongly name it? Does one have to take 
some action so that it will work when one  is developing and then another after 
one has deployed it.

I tried this in the form load event

public Form1()
{
InitializeComponent();

IsolatedStorageFilePermission isfp = new 
IsolatedStorageFilePermission(PermissionState.Unrestricted);
isfp.Assert();

}

But this does nothing.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended so

RE: Isolated Storage Security

2010-03-14 Thread Maddin, Peter
This is driving me nuts (ok, I was nuts already, nuttier then).

Apart from publishing it I have tried everything else.

I created a key file and signed the assembly with it. No Dice!

I have saved my certificate in the root certificate store despite the 
protestations that this was not a wise thing to do (hey, if I can't trust me 
who can I trust).
I ticked the check box to sign the ClickOnce Manifest with my certificate and 
did a rebuild.
Still no dice. I guess one really needs to publish it before anything happens 
here but I was willing to try it.


[cid:image001.png@01CAC448.E4C278C0]

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Maddin, Peter
Sent: Monday, 15 March 2010 1:55 PM
To: ozDotNet
Subject: RE: Isolated Storage Security

Tried to decorate my button event handler thus

[IsolatedStorageFilePermission(SecurityAction.Assert)]
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add("GetMachineStoreForApplication : " + 
IsolatedStorageFile.GetMachineStoreForApplication());
listBox1.Items.Add("GetMachineStoreForAssembly : " + 
IsolatedStorageFile.GetMachineStoreForAssembly());
listBox1.Items.Add("GetMachineStoreForDomain : " + 
IsolatedStorageFile.GetMachineStoreForDomain());
listBox1.Items.Add("GetUserStoreForApplication : " + 
IsolatedStorageFile.GetUserStoreForApplication());
listBox1.Items.Add("GetUserStoreForAssembly : " + 
IsolatedStorageFile.GetUserStoreForAssembly());
listBox1.Items.Add("GetUserStoreForDomain : " + 
IsolatedStorageFile.GetUserStoreForDomain());

}

No deal. Still get the exception. Use of either SecurityAction.Assert or 
SecurityAction.Demand makes no difference.

I tried to establish FullTrust at the assembly level

[assembly: PermissionSetAttribute(SecurityAction.RequestMinimum, Name = 
"FullTrust")]

Still no dice.
Why does something that should be simple have to be made so hard??

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Maddin, Peter
Sent: Monday, 15 March 2010 1:47 PM
To: ozdotnet@ozdotnet.com
Subject: Isolated Storage Security

Currently using XP Pro as our SOE. Will be moving to Win 7 with PC fleet 
replacement.

I want to write my applications so that I can persist application/assembly 
settings and also user settings so it will run with Win 7.
This is probably really old ground for most so I apologise for bringing 
something up that has probably been dealt to death previously.

I have written a really basic application to discover where these are. I am 
just adding the possible locations to a listbox.

listBox1.Items.Add("GetMachineStoreForApplication : " + 
IsolatedStorageFile.GetMachineStoreForApplication());
listBox1.Items.Add("GetMachineStoreForAssembly : " + 
IsolatedStorageFile.GetMachineStoreForAssembly());
listBox1.Items.Add("GetMachineStoreForDomain : " + 
IsolatedStorageFile.GetMachineStoreForDomain());
listBox1.Items.Add("GetUserStoreForApplication : " + 
IsolatedStorageFile.GetUserStoreForApplication());
listBox1.Items.Add("GetUserStoreForAssembly : " + 
IsolatedStorageFile.GetUserStoreForAssembly());
listBox1.Items.Add("GetUserStoreForDomain : " + 
IsolatedStorageFile.GetUserStoreForDomain());

It bombs on the first line with a IsolatedStorageException "Unable to determine 
application identity of the caller."

>From looking around (Google etc). Once one deploys with ClickOnce

RE: Isolated Storage Security

2010-03-14 Thread Maddin, Peter
Tried to decorate my button event handler thus

[IsolatedStorageFilePermission(SecurityAction.Assert)]
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add("GetMachineStoreForApplication : " + 
IsolatedStorageFile.GetMachineStoreForApplication());
listBox1.Items.Add("GetMachineStoreForAssembly : " + 
IsolatedStorageFile.GetMachineStoreForAssembly());
listBox1.Items.Add("GetMachineStoreForDomain : " + 
IsolatedStorageFile.GetMachineStoreForDomain());
listBox1.Items.Add("GetUserStoreForApplication : " + 
IsolatedStorageFile.GetUserStoreForApplication());
listBox1.Items.Add("GetUserStoreForAssembly : " + 
IsolatedStorageFile.GetUserStoreForAssembly());
listBox1.Items.Add("GetUserStoreForDomain : " + 
IsolatedStorageFile.GetUserStoreForDomain());

}

No deal. Still get the exception. Use of either SecurityAction.Assert or 
SecurityAction.Demand makes no difference.

I tried to establish FullTrust at the assembly level

[assembly: PermissionSetAttribute(SecurityAction.RequestMinimum, Name = 
"FullTrust")]

Still no dice.
Why does something that should be simple have to be made so hard??

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Maddin, Peter
Sent: Monday, 15 March 2010 1:47 PM
To: ozdotnet@ozdotnet.com
Subject: Isolated Storage Security

Currently using XP Pro as our SOE. Will be moving to Win 7 with PC fleet 
replacement.

I want to write my applications so that I can persist application/assembly 
settings and also user settings so it will run with Win 7.
This is probably really old ground for most so I apologise for bringing 
something up that has probably been dealt to death previously.

I have written a really basic application to discover where these are. I am 
just adding the possible locations to a listbox.

listBox1.Items.Add("GetMachineStoreForApplication : " + 
IsolatedStorageFile.GetMachineStoreForApplication());
listBox1.Items.Add("GetMachineStoreForAssembly : " + 
IsolatedStorageFile.GetMachineStoreForAssembly());
listBox1.Items.Add("GetMachineStoreForDomain : " + 
IsolatedStorageFile.GetMachineStoreForDomain());
listBox1.Items.Add("GetUserStoreForApplication : " + 
IsolatedStorageFile.GetUserStoreForApplication());
listBox1.Items.Add("GetUserStoreForAssembly : " + 
IsolatedStorageFile.GetUserStoreForAssembly());
listBox1.Items.Add("GetUserStoreForDomain : " + 
IsolatedStorageFile.GetUserStoreForDomain());

It bombs on the first line with a IsolatedStorageException "Unable to determine 
application identity of the caller."

>From looking around (Google etc). Once one deploys with ClickOnce this issue 
>goes away. Ok but what does one do prior to this? What of one wants to use 
>something other than ClickOnce!

What does one do to get it to work? Strongly name it? Does one have to take 
some action so that it will work when one  is developing and then another after 
one has deployed it.

I tried this in the form load event

public Form1()
{
InitializeComponent();

IsolatedStorageFilePermission isfp = new 
IsolatedStorageFilePermission(PermissionState.Unrestricted);
isfp.Assert();

}

But this does nothing.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.



Isolated Storage Security

2010-03-14 Thread Maddin, Peter
Currently using XP Pro as our SOE. Will be moving to Win 7 with PC fleet 
replacement.

I want to write my applications so that I can persist application/assembly 
settings and also user settings so it will run with Win 7.
This is probably really old ground for most so I apologise for bringing 
something up that has probably been dealt to death previously.

I have written a really basic application to discover where these are. I am 
just adding the possible locations to a listbox.

listBox1.Items.Add("GetMachineStoreForApplication : " + 
IsolatedStorageFile.GetMachineStoreForApplication());
listBox1.Items.Add("GetMachineStoreForAssembly : " + 
IsolatedStorageFile.GetMachineStoreForAssembly());
listBox1.Items.Add("GetMachineStoreForDomain : " + 
IsolatedStorageFile.GetMachineStoreForDomain());
listBox1.Items.Add("GetUserStoreForApplication : " + 
IsolatedStorageFile.GetUserStoreForApplication());
listBox1.Items.Add("GetUserStoreForAssembly : " + 
IsolatedStorageFile.GetUserStoreForAssembly());
listBox1.Items.Add("GetUserStoreForDomain : " + 
IsolatedStorageFile.GetUserStoreForDomain());

It bombs on the first line with a IsolatedStorageException "Unable to determine 
application identity of the caller."

>From looking around (Google etc). Once one deploys with ClickOnce this issue 
>goes away. Ok but what does one do prior to this? What of one wants to use 
>something other than ClickOnce!

What does one do to get it to work? Strongly name it? Does one have to take 
some action so that it will work when one  is developing and then another after 
one has deployed it.

I tried this in the form load event

public Form1()
{
InitializeComponent();

IsolatedStorageFilePermission isfp = new 
IsolatedStorageFilePermission(PermissionState.Unrestricted);
isfp.Assert();

}

But this does nothing.

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.



RE: Calling a class library C# method from ms access

2010-03-07 Thread Maddin, Peter
Thanks Ian

I ma having trouble translating this from Vb.NET to C#.

I built the class library and then used reflector to see the c# code.
Tried cutting and pasting but the VS Editor did not like it.

Googling other material, locates code that only vaguely resembles that in your 
link below.

I am venturing into unchartered territory never having had much to with Com 
before (and being told it was dead)

The latest one has no GUIDs at all 
http://www.codeproject.com/KB/office/ParallelMsAccess.aspx

My project is tiny

using System;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;

namespace PathWest
{
[ComVisible(true)]
public interface HashInterface
{
string Md5Hash(string passwordValue);
}

[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
public class GetHash : HashInterface
{
public string Md5Hash(string passwordValue)
{
byte[] hashValue = new 
MD5CryptoServiceProvider().ComputeHash(Encoding.ASCII.GetBytes(passwordValue));
return Encoding.ASCII.GetString(hashValue);
}
}
}

I do see one in the Assembly.cs file though

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]

// The following GUID is for the ID of the typelib if this project is exposed 
to COM
[assembly: Guid("b92f832a-3887-412b-a126-e58f35041f2d")]



Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Ian Thomas
Sent: Monday, 8 March 2010 11:13 AM
To: 'ozDotNet'
Subject: RE: Calling a class library C# method from ms access

http://support.microsoft.com/kb/317535



Ian Thomas
Victoria Park, Western Australia


From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Maddin, Peter
Sent: Monday, 8 March 2010 10:49 AM
To: ozdotnet@ozdotnet.com
Subject: Calling a class library C# method from ms access

I need to call a C# method from MS Access 2003.
I need to pass in a string and return a string.

I have spent some trying to do this in Delphi but am now sure I need to use COM 
so I might as well use C#.

I have wasted a couple of days almost getting it working only to find that it 
was too flaky with Access crashing.

Does anyone have a simple code example they would be willing to share?

The goal is to pass in a string (which will be a password) and return a hash of 
that string using MD5 or something similar.
Generating the hash is no problem its just writing the class and method so 
Access will be able to call it, setting up the MS Access declaration and 
calling the method passing in a string and returning a string.

I believe one needs to make the assembly 'Com-Visible".
Also the Access declaration needs to specify the TLB and not the dll.
One needs to register the dll (? And tlb) using regasm.

Is there anything else required?

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.



Calling a class library C# method from ms access

2010-03-07 Thread Maddin, Peter
I need to call a C# method from MS Access 2003.
I need to pass in a string and return a string.

I have spent some trying to do this in Delphi but am now sure I need to use COM 
so I might as well use C#.

I have wasted a couple of days almost getting it working only to find that it 
was too flaky with Access crashing.

Does anyone have a simple code example they would be willing to share?

The goal is to pass in a string (which will be a password) and return a hash of 
that string using MD5 or something similar.
Generating the hash is no problem its just writing the class and method so 
Access will be able to call it, setting up the MS Access declaration and 
calling the method passing in a string and returning a string.

I believe one needs to make the assembly 'Com-Visible".
Also the Access declaration needs to specify the TLB and not the dll.
One needs to register the dll (? And tlb) using regasm.

Is there anything else required?

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 9473 3944
Fax : +618 9473 3982
E-Mail : peter.mad...@pathwest.wa.gov.au
The contents of this e-mail transmission outside of the WAGHS network are 
intended solely for the named recipient's), may be confidential, and may be 
privileged or otherwise protected from disclosure in the public interest. The 
use, reproduction, disclosure or distribution of the contents of this e-mail 
transmission by any person other than the named recipient(s) is prohibited. If 
you are not a named recipient please notify the sender immediately.