Click here to Skip to main content
15,889,909 members
Home / Discussions / C#
   

C#

 
GeneralRe: Format SQL statement into C# string. Pin
Not Active19-Oct-09 9:58
mentorNot Active19-Oct-09 9:58 
GeneralRe: Format SQL statement into C# string. Pin
RK KL19-Oct-09 10:13
RK KL19-Oct-09 10:13 
GeneralRe: Format SQL statement into C# string. Pin
Brady Kelly19-Oct-09 11:21
Brady Kelly19-Oct-09 11:21 
GeneralRe: Format SQL statement into C# string. Pin
Not Active19-Oct-09 11:51
mentorNot Active19-Oct-09 11:51 
GeneralRe: Format SQL statement into C# string. Pin
PIEBALDconsult19-Oct-09 15:37
mvePIEBALDconsult19-Oct-09 15:37 
AnswerRe: Format SQL statement into C# string. PinPopular
AspDotNetDev19-Oct-09 10:25
protectorAspDotNetDev19-Oct-09 10:25 
GeneralRe: Format SQL statement into C# string. Pin
Mycroft Holmes19-Oct-09 12:23
professionalMycroft Holmes19-Oct-09 12:23 
QuestionA problem with namespace? Pin
George Quarton19-Oct-09 5:15
George Quarton19-Oct-09 5:15 
I'm trying to compile my project but its giving me this error:

1. The namespace 'PenDriveBackupProgram' already contains a definition for 'PenDriveBackup'

Prior to this error I was trying to get this class working in my project:
http://downloads.cfdan.com/csharp/us...lnumber.cs.txt

I was calling the class like so:
USBDriveSerialNumber.USBSerialNumber usb = new USBDriveSerialNumber.USBSerialNumber();
string serial = usb.getSerialNumberFromDriveLetter(path);
MessageBox.Show(serial);


But now there is an error in the class which is appearing at runtime?
The error is with this bit of code;
ManagementObjectSearcher searcher1 = new ManagementObjectSearcher("SELECT * FROM Win32_LogicalDiskToPartition");
foreach (ManagementObject dm in searcher1.Get())

And the error is:
Context 0x33c3ff0 is disconnected. No proxy will be used to service the request on the COM component. This may cause corruption or data loss. To avoid this problem, please ensure that all contexts/apartments stay alive until the application is completely done with the RuntimeCallableWrappers that represent COM components that live inside them.

I read some information at MSDN about the project needing full trust, so I went into the project settings -> security -> Enabled ClickOnce Security Settings -> Selected This is a full trust application.

Although I set the global settings to Full Trust the class has the modifer Partial so I figured this could be a problem (First project in C#)
So I removed the partial modifier with everything to do with the PenDriveBackup class which now results in the error you see above.

All help is appreciated greatly, cheers, George.
AnswerRe: A problem with namespace? Pin
Luc Pattyn19-Oct-09 6:12
sitebuilderLuc Pattyn19-Oct-09 6:12 
GeneralRe: A problem with namespace? Pin
George Quarton19-Oct-09 6:31
George Quarton19-Oct-09 6:31 
GeneralRe: A problem with namespace? Pin
Luc Pattyn19-Oct-09 6:48
sitebuilderLuc Pattyn19-Oct-09 6:48 
GeneralRe: A problem with namespace? Pin
Luc Pattyn19-Oct-09 9:16
sitebuilderLuc Pattyn19-Oct-09 9:16 
GeneralRe: A problem with namespace? Pin
George Quarton19-Oct-09 11:50
George Quarton19-Oct-09 11:50 
QuestionReplication Classes Pin
md_refay19-Oct-09 4:37
md_refay19-Oct-09 4:37 
QuestionCustomer user control load screen Pin
gdub19-Oct-09 4:24
gdub19-Oct-09 4:24 
AnswerRe: Customer user control load screen Pin
Not Active19-Oct-09 4:55
mentorNot Active19-Oct-09 4:55 
AnswerRe: Customer user control load screen Pin
benjymous19-Oct-09 4:55
benjymous19-Oct-09 4:55 
GeneralRe: Customer user control load screen Pin
Not Active19-Oct-09 5:47
mentorNot Active19-Oct-09 5:47 
GeneralRe: Customer user control load screen Pin
gdub19-Oct-09 7:23
gdub19-Oct-09 7:23 
GeneralRe: Customer user control load screen Pin
Not Active19-Oct-09 7:49
mentorNot Active19-Oct-09 7:49 
QuestionLow priority: Visual Studio IDE, string literals, convenience. Pin
LimitedAtonement19-Oct-09 3:42
LimitedAtonement19-Oct-09 3:42 
AnswerRe: Low priority: Visual Studio IDE, string literals, convenience. Pin
Luc Pattyn19-Oct-09 5:09
sitebuilderLuc Pattyn19-Oct-09 5:09 
GeneralRe: Low priority: Visual Studio IDE, string literals, convenience. Pin
LimitedAtonement19-Oct-09 5:33
LimitedAtonement19-Oct-09 5:33 
GeneralRe: Low priority: Visual Studio IDE, string literals, convenience. Pin
Dave Kreskowiak19-Oct-09 5:43
mveDave Kreskowiak19-Oct-09 5:43 
GeneralRe: Low priority: Visual Studio IDE, string literals, convenience. Pin
Luc Pattyn19-Oct-09 5:46
sitebuilderLuc Pattyn19-Oct-09 5:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.