.net

Silverlight Toolkit Drag and Drop Target

I tried to get Drag and Drop working between two ListBox Controls. But somehow picking up an item is not possible. Maybe you have a hint for me to get it working My User Control xaml code looks like this: <UserControl.Resources> <DataTemplate x:Key="ItemTemplate"> <StackPanel Orientation="Horizontal"> <Image W...

Unity 2.0: How to use Resolve with ResolverOverride?

I started doing more and more work with Unity. I notice that Resolver method takes a params argument ResolverOverride. Can someone give me an example how I can use ResovlerOverride or point me some other source where I can get more clues. ...

Outlook Plugin - Searching Global Address book

Hi, Does anyone know how to search the Global Address Book on the exchange server? It seems the 'Address Book' is different to a public contact list, hence this popular example code (or similar) points to a completely different set of contacts: Outlook.Application app = new Outlook.Application(); Outlook._NameSpace olNS = app.GetNamesp...

Which is the best Technology in .net? For web development.

I am new in .net; I would like to learn any new technology in .net. Prefer me any good technology to develop web application effectively and easily. ...

Modifying Export to Excel in ReportViewer to be readonly

I am working with WinForms, using C# and .Net 3.5: I have ReportViewer exporting to PDF and Excel. However I do not want the user modifing the Excel file after it has been exported. Does anyone know how to cause the basic functionality of the export to excel to lock the file down or to export it as an image into Excel? I have read This...

Catch/Raise event on table data update C#

Hi, I have 24/7 service which keeps setup (configuration data) for charging, routing and etc in the Sql Server. Once it is started it loads the data from table using Linq2SQL and use the data through all the application. And we need a solution to update the setup data in the table without restarting the application. So I am interested ...

Executing command line from windows application

Hello, i need to execute command line from .NET windows application. I tried with this code but i get error 'C:\Documents' is not recognized as an internal or external command, operable program or batch file. var command ="\"C:\\Documents and Settings\\Administrator\\My Documents\\test.exe\" \"D:\\abc.pdf\" \"C:\\Documents an...

Can I create a custom class that inherits from a strongly typed DataRow?

I'm working on a huge, old project with a lot of brittle code, some of which has been around since the .NET 1.0 era, and it has been and will be worked on by other people... so I'd like to change as little as possible. I have one project in my solution that contains DataSet.xsd. This project compiles to a separate assembly (Data.dll). ...

Override a GAC DLL in VS2003

I have a VS2003 project that references nunit.framework.dll. The dll is available from within my source tree. Everything works fine on my box(tm). When the build server tries to build the project, it fails, because the build server (outside of my control) has nunit.framework.dll V2.1 (outdated) in it's GAC. I believe that if I use a ab...

Strong Signing, and Updating A Referencing Assembly

Hi, I have two, third party assemblies: Foo.dll and ReferencesFoo.dll As noted, ReferencesFoo.dll is an assembly that has a reference to Foo.dll For my application, I need to resign these assemblies. I use ildasm/ilasm in combination along with a signing key to resign them, however, ReferencesFoo.dll still contains (in it's manifes...

how to design a calendar control

I need to design a calendar control which should be added to our companie's application (I know there's already quite a lot calendar controls but I shall develop our own one...). How should I start, should I use a kind of table to display the days or should I completely draw my own grid? How can I do this (I do not need rdy-to-use code,...

Help understanding .NET delegates, events, and eventhandlers

Hello, In the last couple of days I asked a couple of questions about delegates HERE and HERE. I confess...I don't really understand delegates. And I REALLY REALLY REALLY want to understand and master them. (I can define them--type safe function pointers--but since I have little experience with C type languages it is not really helpfu...

How to subtract dates in YYYYMMDD format?

I have 2 integer fields that represent dates in the YYYYMMDD format. What is the best way to subtract 2 of these fields to get the correct # of days between them? For instance, if I take the difference between 20100511 and 20100428 I would like the result to be 13 and not 83. I know I need to convert the integer fields into date forma...

Where are the readonly/const in .NET?

In C++ you'll see void func(const T& t) everywhere. However, i havent seen anything similar in .NET. Why? I have notice a nice amount of parameters using struct. But i see no functions with readonly/const. In fact now that i tried it i couldnt use those keywords to make a function that promises to not modify a list being passed in. Is t...

.Net Com Interop Create Instance Slow

I have a .net 4 application that uses a Com Dll to send SMS messages. I used TlbImp to create the interop assembly and that is what is referenced in the application. When I try to create an instance of this class, it takes a really long time (2-5 seconds). I ran performance profile in VS 2010 and the call that takes the longest by far...

How to break on unhandled exceptions in Silverlight

In console .Net applications, the debugger breaks at the point of the throw (before stack unwinding) for exceptions with no matching catch block. It seems that Silverlight runs all user code inside a try catch, so the debugger never breaks. Instead, Application.UnhandledException is raised, but after catching the exception and unwindin...

SPUtility.TransferToSuccessPage - is there a possiblity to add new line inside message?

Hi, I'm using in WSS 3.0 SPUtility.TransferToSuccessPage method. Do anybody know is there a way to add new line in output message? Can you tell me how? Best Regards T.S. ...

How to ensure I can replace files in a directory?

I want to completely replace one directory on the file system with another directory in a temp directory. The tricky part is that the files in the folder to be replaced could be being used at any time, causing the replace operation to fail. I need to somehow wait on an exclusive lock on the directory so that I can delete all of its cont...

Green Exceptions?

When unhandled exceptions are encountered in VStudio usually the debugger highlights the line YELLOW as the line that threw the exception. However sometimes I encounter exceptions where the debugger highlights them green as shown: I've always treated them as normal exceptions, but today I decided to ask since google/bing produced no ...

Is there a WinForm control inspector application?

I'm looking for something that provides interactive meta-data about a running .NET WinForms application. Basically, I'd like to be able to hover over a running WinForms application and have the inspector highlight the various controls and let me inspect properties such as size, position, parent, etc. I could have sworn I've seen this s...