.net

Using dashed webservice methods names in .net

Im trying to use a cgi web service. The Web Service method names contains dashes and wsdl.exe removes them in generated proxy class. Trying to use the proxy class web service im getting an error : "Method 'q1:methodname' not implemented: method name or namespace not recognized" Then I've tried to change MedhodName parameters (with ori...

Do you strong name all assemblies your product uses?

I have a product which has around 10+ assemblies. We used to ship it without strongly naming the assemblies. But after reading about strong naming, I guess it is a wise idea to strong name assemblies. Just wanted to know is that a best practice to strong name all assemblies used by a program? Any thoughts? ...

.NET: recommended video tutorial for LINQ?

Can you recommend a single downloadable video (one that you have actually watched and that you think is of high quality) introducing LINQ (not to be confused with "LINQ to SQL") to a somewhat experienced VB.NET/C# developer? It could be a screen-cast showing real code. "Downloadable" includes YouTube and ShowMeDo (Flash video) as the...

Adding new entity in NHibernate PostUpdateEvent

Hi, How do I add a new entity object using NHibernate whilst handling a PostUpdateEvent event? I have implemented an audit handler which essentially creates a new object in the OnPostUpdate handler, and attempts to insert into the database. However, it doesn't actually seem to get committed at any point. If I start a new transaction an...

Is there a way to get the full sql text back from SqlCommand after param substitution?

I created a SqlCommand with an SQL query containing parameters. I than add all the parameters to the class. Is there an easy way to see the resulting SQL query before it is sent off to the db? This would be handy for debugging purposes. (e.g. copying the entire query and run it in the management studio to try and pinpoint problems) R ...

Using 'Type' and 'Enum' as parameters in .NET

I'm trying to writing a method that parses a string parameter into an enum. The enum's type is also determined by a parameter. This is what I've started with: public static type GetValueOrEmpty(string text, Type type) { if (!String.IsNullOrEmpty(text)) { return (type)Enum.Parse(typeof(type)value); } else { ...

Is a separate Data Layer necessary when using Linq to Entities?

When using Linq to Entities, is it still necessary to abstract database access using a separate Data Layer, or is it acceptable (or even recommended) to make Linq queries directly from code-behind (Since the Get, Add, Update, and Delete functionality is already built into the Entity Framework)? ...

Duplicate System.Web in GAC!

Hi I am trying to deploy an asp .net MVC app onto II7 and getting the following error: Could not load file or assembly 'System.Web' or one of its dependencies. An attempt was made to load a program with an incorrect format. The server has .net 3.5 SP1 and I tried including the dll in the website bin with no luck! I noticed in the GA...

Programably click and move mouse with VB .Net

Hello, I want to build a program in VB .net that will allow me to control my pc with my laptop. The only question I really have is, how can I programably click without using some kind of click event, say if I want to click the start orb and my mouse is at that exact location, I'd like a sub or something that will click on it. Right now ...

WPF - ScrollViewer will not scroll when ScrollToHorizontalOffset() is called

I have a Scrollviewer inside a TabControl, and for some reason when you change tabs my ScrollViewer jumps to HorizontalOffset of 12. My ScrollViewer, among other things has a ListView inside it with an unrestricted height. It's a strange layout, but everything inside the scroller had to be printable so I couldn't easily allow the ListV...

Anybody know of any T4 templates for generating classes from xsd?

I'm looking at some work updating classes generated from xsds. I think this would be a great use of T4 templates, but I don't see any examples of people doing this. Essentially, I'd like to do what Linq to XSD has done, but without including alpha build targets in a production solution. Any relevant links out there? Now a wiki. St...

Add DNS records from .NET app

I am working on a webapp that we acquired from another company. When you "sign up", the server is supposed to create a DNS alias using WMI. It was crashing with a "Generic Error", which was later cured by adding the following tag to the Web.config file: identity impersonate="true" userName="administrator" password="theadminpass" This w...

How do I add to a specific column in Listview item?

I create a listview and the number of columns are determined at runtime. I have been reading texts on the web all over about listview( and I still am) but I wish to know how to add items to a specific column in listview I thought something like: m_listview.Items.Add("1850").SubItems.Add("yes"); would work assuming the "1850" which is ...

WPF TextBox DoubleClick Event Fires when using Scrollbars rapidly

I have a WPF TextBox, defined like this: <TextBox Text="{Binding Path=/Comments}" Margin="351,193.91,10,36" x:Name="txtComments" IsReadOnly="True" VerticalScrollBarVisibility="Auto" LostFocus="txtComments_LostFocus" MouseDoubleClick="txtComments_MouseDoubleClick" AcceptsReturn="True" /> This works ex...

Does the .Net CLR JIT compile every method, every time?

I know that Java's HotSpot JIT will sometimes skip JIT compiling a method if it expects the overhead of compilation to be lower than the overhead of running the method in interpreted mode. Does the .Net CLR have work based upon a similar heuristic? ...

Books and literature for implementing a language on the CLR

I'm looking for books and literature on the inner workings of the CLR (and/or possibly the DLR), my long time goal is to implement a simple language on the CLR. ...

single instance and notify in system tray

Hi All, I am working on the application (C# 2.0). I have implemented single instance in it. Everything is fine. If i run the application again, it shows messagebox saying "instance is already running". Actually i don't want to show the message through messagebox. I want to show this message using Balloon tip of already running instan...

C# vs. C++ in a cross-platform project

My team is planning to develop an application that is initially targeted for Windows but will eventually be deployed cross-platform (Mac, Linux and potentially embedded devices). Our decision is whether to use C#/.NET or generic C++ (with Qt as the user interface library). We’re projecting that by using C#, we can develop our product f...

Java's invokeLater() equivalent in Windows Forms?

I'm new to Windows Forms from the Java Swing world. Is there any equivalent for Java's SwingUtilities.invokeLater()? Or, how can I dispatch a task to be run on the main Windows Forms event thread? I'm performing a background task using a synchronous API on a separate thread. At the end of the task, I want to re-enable some disabled butt...

Windows Mobile to Windows CE, VB.net

I'd written an application in VB .NET for the Windows Mobile 5.0, yesterday a customer wants to use the application on there existing Symbol MC90XX that runs Windows CE 5.0. Can someone tell me what is the best way to convert from VB .net Mobile to VB.net CE? ...