.net

.Net 4 StringOrInt type

I'm sure I read on Scott Gu's blog (or somewhere equally authoritative) that .net 4 was introducing a new type: StringOrInt. This was some time ago and may have been an April Fool's joke, but I'm having a hard time finding any mention of it on the interwebs. Can anyone verify its existence and point me in the right direction or is the ...

Sharepoint 2007 Webpart shared property not persisting

If I change the height of my webpart in the shared Webpart properties, the setting does not persist. This happens only to my webpart, not to other webparts. Any idea why? ...

Can a .NET 2.0 Web Service handle a call from a client when the SoapAction is missing?

We have a .NET 2.0 web service (.ASMX file). This web service is being called by a Java client and they are not passing in a SoapAction header. This causes our web service to fail with the error: : "Server did not recognize the value of HTTP Header SOAPAction: ." There is no chance that I can convince the development team in charge of...

.net - access files among different projects in a solution

Hi experts, I have multiple .net projects under a solution. Specifically, i have few content files like pdf's, word docs under an asp.net project that i would like to access from a windows application project. What's the best way to achieve this? ...

Threading through a list of actions X threads at a time in C#

Let's say I have a List<Thread> df = new List<Thread>(); // I add 500 instances of delegate() { somemethod(a,b) }; to df Now I want to run through all df items threading it X items maximum at a time, how can I accomplish this? ...

Logging to a text box with auto-follow cursor

I'm using a WinForms TextBox control for logging. It's been set as multiline with scrollbars. I'm inserting text by using: textBox.Text += logMessage; The scrollbar does not automatically follow with the latest log entry. Is there a way to do this? ...

.NET and Outlook COM

Does outlook (2003 or 2007) provides an event for new mails received so I can just add an event handler in my c# app? Also, i have read issues about a dialog box that appears when other apps access outlook. When does this actually happens? and how is this solved? ...

WebClient.DownloadFile Garbles Paths in Debug Mode

This is a really strange issue. When using WebClient.DownloadFile in Debug configuration, it appears as if it combines the source and destination paths and tries to do... something. The destination file does get created (but it's empty). The problem dissaperes if I simply switch to Release configuration. Additionally, this used to wo...

What's the best way to export DataTable to an Excel file?

As far as I know, there're 3 ways to do this: The first way is using COM Interop to create a Excel file, then iterate over all cells to read and write data. The created file appears to be valid (true .XLS file), but it seems that Excel must installed to use this way The second way is writing a file header (CSS style), and then iterate ...

Can ASP.NET state management be daunting for beginners?

To all you ASP.NET experts and beginners, do you look at a state management as a difficult and annoying task to do? If you were to start over with ASP.NET would you consider ASP.NET MVC and never have to deal with ViewState again? Also , is it true that once you go ASP.NET MVC you never go back to ASP.NET Webforms (Unless of course your...

What SqlCommand.Parameters.AddWithValue really does?

Hi, What changes SqlCommand.Parameters.AddWithValue() does with the query? I expect that: It replaces every ' character by '', If a parameter value is a string or something which must be converted to a string, it surrounds the value by ', so for example select * from A where B = @hello will give select * from A where B = 'hello world...

How to dynamically load a dll in c#

Possible Duplicate: Load Assembly at runtime and create class instance I want to load a dll dyanmically in my c#.net project. I dont know how to do it. and what are the benefits I can get by dynamically loading a dll. EDIT: See Comments ...

windows form UI simple question

Hey: i am very new to windows form UI development. now i am just doing all the drop and drop for UI design. but the problem is that all my UI elements are fixed size. when i maximum the window. the window gets bigger but all the UI elements in the window stays in the same size, and it looks awkward. is there a property could be set so t...

Dependency injection: do we all need to know that?

One of my friend (he is a .NET/C++ developer, as I am) asked me: Dependency injection: do we all need to know that? Why? Could you please tell: Your opinion: do we really need to know that pattern and how to implement it? Good reference (link) that could explain "why?" Thank you a lot. P.S. I am understanding that I am asking ...

SvcUtil.exe creating its own class name for service contract implementation class - WCF

Hello I've written a WCF service and hosted in IIS 6.0. When i try to create the proxy using the following command svcutil.exe /language:cs /out:MyProxy.cs /config:app.config /a http://serviceurl it is creating its own class name in MyProxy.cs. Why is that? I was trying to step in to the service for debugging and i was not able to ...

How can I communicate with Oracle Financials api from .Net?

Oracle ERP exposes a set of API but does anyone know how to communicae with it? Is there any third party tools that could help? Please note I am not interested in Oracle database but Oracle ERP Financials. Thanks ...

ASP.NET Webforms with jQuery?

Can I avoid using MS AJAX completely while developing ASP.NET Webforms applications and use jQuery/jQuery Tools instead? jQuery seems to be much snappier, has better community, extremely small file size (24kb). It's also seems like an obvious choice for ASP.NET MVC development. But what about Webforms? I really would rather not use AJA...

Targeting .net framework 3.5 and 4.0 with mixed mode assembly

hi, i have a mixed mode assembly that targets .net 3.5 using the vc 9.0 runtime. i do wan't to support .net 4.0 yet still remain compatible to the old framework as well (the library should work for 4.0 and for 3.5 processes). if i update to .net 4.0 i have to use the vc 10.0 runtime. however from this runtime i can't target an old .ne...

How to configure TopShelf to run a service as ServiceAccount.NetworkService?

How to configure TopShelf to run a service as ServiceAccount.NetworkService? http://code.google.com/p/topshelf/ ...

How to stop multiple dialog boxes displaying?

I have a very annoying problem and I'm trying to find the simplest solution possible, but I seem to keep complicating it. My program displays a custom dialog box using the ShowDialog function (I create this form using a New constructor), but while my program waits for input in the dialogbox, my program continues to run other code, (I'm...