.net

Is there a way to start/open the console from a WinForms/WPF application?

Hi guys. I have a windows forms application and i want to open a console on demand (when i press a button for example) that i can interact with using the standard Console class. Is there a way to do this? ...

What's the ideal method for redirecting to a new url from inside of a View?

So inside my ASP.NET MVC View I have a conditional statement to redirect users to a different page. What is the best way to do this? What is the Controller.RedirectToAction() equivalent for a View? ...

WCF RIA Services - Returning Entity from Invoke Operation

I was happily using RIA Services JULY 09 version and using a ServiceOperation for a method which takes some parameters and returns Entity. [ServiceOperation] public Entity TestMethod(string param1, string param2, bool param3) { // do something here } But as soon as i UPGRADED to WCF RIA services, I had to change [ServiceOperat...

Could not load file or assembly for Oracle.DataAccess in .NET

Hi: I got 'Could not load file or assembly 'Oracle.DataAccess, Version=2.111.7.20, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.' message when I try to run a simple program to access oracle. I checked \windows\assembly and it's in there, but it's not in GAC (gac...

WCF IPv6 Endpoints

I'm investigating the possibility of using the Peer 2 Peer along with WCF in a Windows app for an EPoS terminal. The app will sit on a number of PC's in a local network; there will only ever be one instance of the app per PC. My current thinking is that my app starts up and joins the peer mesh, on joining the mesh it periodically shout...

How to capture window text

I need to build the ability to capture text from a window, like how this utility works. You specify a windows handle and it will return the text inside the window, regardless if the text is selectedable or can be copy pasted. It's not using any OCR technique either. How can I write this in a .net environment? Can someone explain the ...

Read XML from Sproc and Write to File

I need to read a large xml result (using For XML) from a stored proc and write it to a file in a .Net app. My first shot is to read the xml from the proc using XmlReader. I then need to write it to a file. Is this best way to handle this scenario, or is there a "better" method? ...

Getting "cross-thread operation not valid" even when using invoke method.

Hi... I get the "cross-thread operation not valid" here: if ( vlc.State == VlcPlayerControlState.PLAYING ) { if ( vlc.InvokeRequired ) { vlc.Invoke( new MediaPlayerNoParameterDelegate( vlc.Stop ) ); } else { vlc.Stop(); // debugger point...

Are .NET memcache libraries production ready?

Seeing all the UNIX guys have memcache (PHP, Python, etc.), are the .NET libraries stress tested and equally efficient? (or more?) ...

how do i access and interact with DOM objects from VB.net

say i load a page via WebBrowser.document class, I want to literally "click" elements in the DOM using VB.net programmatically. I dont want to use the classic WebRequest class. how can i do this ? ...

GAC_MSIL folder takes so long to open

I ran disk defragmenter and disk cleaner and over all my machine is fast enough to do everything. Whenever I try to open “C:\WINDOWS\assembly\GAC_MSIL” folder, my computer get freeze, performance of CPU Usage reach to 100% and it takes almost 5 minutes to open the folder. Anyone had the same problem? Or anyone has any recommendation? ...

"keyset not found" when trying to access my private key

Possible Duplicate: CryptographicException Keyset does not exist, but only through WCF My WCF service throws "keyset not found" when it starts the service, it seems a permission error since if the application pool's identity is administrator everything works fine. However, I granted ACL right to the account which has this error...

Are there any database-like persistence layers available for .NET?

I'm trying to tackle the problem of disconnected operation for an application with a relatively rich data layer, and it occurs to me that the most natural way to make this work is with a client-side database. I don't want to have to install a separate product, however, and I'm left to wonder if there are any layers out there where you c...

Entity Splitting with Code Only

Is their a way using Entity Framework Code-Only to have an entity that has fields from two tables if both tables don't contain the primary key? Here is an example. public class BlogPost { public int PostID { get; set; } public String PostBody { get; set; } public int UserID { get; set; } public string Username { get; se...

How do you clear the read-only flag on a file in .NET?

How do you clear the read-only flag on a file in .NET and leave the rest intact? ...

Cannot Convert Derived Class to Base Class

I am working on a transportation problem and cannot leap this hurdle. I am unable to convert the derived class StopsVisited to its base class Stops. The base class Stops is a collection of Stop. The derived class StopsVisited is a collection of StopVisited. The element StopVisited derives from Stop (definitions not shown). I have a n...

Can Castle.Windsor do automatic resolution of concrete types

We are evaluating IoC containers for C# projects, and both Unity and Castle.Windsor are standing out. One thing that I like about Unity (NInject and StructureMap also do this) is that types where it is obvious how to construct them do not have to be registered with the IoC Container. Is there way to do this in Castle.Windsor? Am I bein...

Run Function Based off of Data in a Lookup Table

I want to call a method based on a value in a lookup table. The values will be looked up in a database, and will be iterated through. What I am trying to avoid is this: foreach (Row r in rows) { if (r["command"] == "Command1") MyClass.Command1(); else if (r["command"] == "Comman2") MyClass.Command2(); else i...

What's the naming convention for classes in the DataAccess Project?

I usually name by classes in the Business project as Manager.cs, like BaseManager.cs, CommentsManager.cs, ProfileManager.cs, etc... How do you name your classes in the DataAccess project? Do you call it CommentsDA, CommentsDB, or what? Just curious...BTW, I'm using .NET C#. ...

Is there a .NET equivalent of WebGoat

Looking at this question the OWASP WebGoat project looks like a great way to learn about web security. Although the principles will equally to .NET applications I would prefer to use .NET based application. Does anybody know of a suitable .NET alternative? ...