.net

How to open a new form from another form.

I have form which is opened using ShowDialog Method. In this form i have a Button called More. If we click on More it should open another form and it should close the current form. on More Button's Click event Handler i have written the following code MoreActions objUI = new MoreActions (); objUI.ShowDialog(); this.Close(); But what...

Avery 5168 Labels in RDLC

I am currently working on creating an RDLC report for the Avery 5168 labels. The report is being created in Visual Studio 2010 and the will be for mailing labels. The report should show the addresses 2x2 on each page of the report. I have tried several different solutions with no success. Any suggestions would be greatly appreciated. ...

System.Net.WebRequest - TCP Connection Resuse/Cache ??

This issue has me stumped. It's happened three times in the last 12 months on our production server and causes major issues when it does. Any help would be appreciated. We have a .NET Windows Service that sends HTTP requests to a third-party server. "Something" happens and the next 2-3 requests fail with server error 503, subsequent req...

move from rich clent ( WPF) to web based (Silverlight application) for multiuser application

Hello Design Gurus and architects, We have a multi user product prototype in WPF which works fine as a prototype. Now we want to build the complete product. In our product we have scenarios where 2 - 3 users might have to use same data. Say one us editing and the other user is viewing the continuos edits. And also whenever a user chan...

LINQ: Select from IEnumerable with Distinct/GroupBy and sorting - possible?

My particular example is fairly complex but I think the concept would apply equally to something like a logging system so I'll use that instead for ease of explanation. It's a ficticious example, please don't harp on or agonise over what is achitectually, programatically or morally wrong with the example itself :) Say you have this: cl...

Using VB 6.0 Forms in VB.NET

Please do any one have idea how to Use Forms created in VB 6.0 in VB.NET .......please help i m stuck ...

How come there's no C# equivalent of python's doctest feature?

Seems like it would be a good way to introduce some people to unit testing. ...

Calling .FindByType makes VB6 error out, help?

Possible Duplicate: Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic. Basically, im just searchign for uPnP devices using the uPNPDeviceFinder classes .FindByType method, .FindByUDN works, but FindByType gives an error: VB6 gives a compile error when I attempt t...

Is String a primitive type?

I am curious about the string and primitive types. Article like this says string is primitive type. However second article on MSDN does not list string as primitive type. However when I ran the code provided in second article, it displays String is not Primitive type. Can any one guide me on this? Thanks, Ram ...

Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic.

What does this error mean in VB6? Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic. I keep getting it when i call a particular method of a dll that comes with windows xp and beyond (in system32 called upnp.dll) Anyone any ideas? google wasn't helpful ...

A C# Book similar to Cocoa Programming for Mac OS X

I'm attempting to pick up C# for the purpose of web development (read: .NET) and am trying to find a book to do so. I'm already comfortable with basic things, like looping and variables as well as OOP. I know JavaScript/CSS/PHP/HTML/MySQL pretty well. I'm also pretty okay with the C# syntax so far, and am able to make basic desktop pr...

StructureMap Conditional use

I hawe all day strugle my head and i canot find any solution to my case so i nead help. Hear is my problem: I hawe two classes that implement one interface public interface ICacheObject { string Get(); } public class WebCacheObject : ICacheObject { public string Get() { return "Web"; } } public class SysteCach...

Linq 2 sql two same databases

i have two sql servers, with same database, now i want copy some data from one to second. i added to project two linq to sql classes, and now, when i write query i have error because of name collision, how can i avoid it??? ...

Dependency injection in the .net world without needing XML config files

Dependency injection looks great, however when I look at examples I often see lots of XML config file. This is not good because: I don’t get compile time checking on the type names in the config files Refactoring tools don’t update the confilg files when types are renamed I don’t want the customers changing the configuration! I am a ...

Wrapping service call for common error handling and tracing in WCF

Hi, Does anyone have a good example for common error handling for service calls? I just started a new project and I see a lot of duplicate code that I don't like and would like to get rid of. I manage to do so in several other layers but in the proxy layer making the calls to services it is a little bit harder. The code is basically str...

wscript.exe silently dies with no messages in event log for com object that uses rfc

I have com object written in c# that relies on c++ library that has rfc calls inside. Com object exposes single method (let it be DoSomeRfcStuff) that returns string. It's implementation is wrapped by try/catch block: string DoSomeRfcStuff() { try { .. Do Some Rfc calls ... } catch(Exception ex) { return ex.ToString(); }...

How to force a RibbonButton to be alway enabled ?

I have a Microsoft Ribbonbar inside a Window, and every RibbonButton is associated to a specific command like this: <ribbon:Ribbon x:Key="MyToolbar" Name="MyToolbar" > <ribbon:RibbonTab Header="File" > <ribbon:RibbonGroup Header="File" > <ribbon:RibbonButton Command="{x:Static ApplicationCommands.New}" LargeImageSource="Ima...

Setter injection on an existing service instance in Castle Windsor

Does Castle Windsor support applying setter injection to existing service instances? I have a case in which I have no control over the creation of certain class instances while I do need to resolve dependencies for them. This rules out constructor injection but leaves the door open for setter injection since I can intercept the new insta...

How to use inherited DLLs in Sub-applications

Context: I have an application which handles login/authentication as a root website in IIS7. In this website, I would like to have sub-applications which all use the same HttpModule, which is defined in the root site's dll. At the moment, I obviously get the "Could not load file or assembly 'CompanyName.Namespace' or one of its depende...

Nunit and code coverage for C#

Hello everyone, I am using C# + .Net 4.0 + VSTS 2010. I am wondering whether Nunit is the best and easy to learn unit test tool for this platform (C# + .Net 4.0 + VSTS 2010)? If yes, I want to learn basics of Nunit, and also want to find how to generate code coverage report based on Nunit result (e.g. code coverage report to show which ...