.net

WPF TabPanel without the Tabs?

Ok I admit, what I need is not a tabpanel, (or is it?). But what I effectively want is a panel with a number of children I can select one of which to be visible at any given time. Basically I have a couple views and based on the state of the app, the current view needs to change. This is essentially like Regions from Composite Applica...

Get type of null reference object for Object reference not set to an instance of an object.

Ever since I started programming this question has been annoying me, not "where is my code null" but specifically is there any way to get the type of the object that is null from the exception? Failing that, can anyone provide a blog post or msdn article that explains the reason why the .NET Framework doesn't (or can't) provide these de...

Base class for an ASMX webservice - calling the derived method from the base class it self

Hi folks, I have a bunch of asmx web services, and in all the methods inside the webservices follow a common pattern public virtual TestObject Test() { LogRequest; try { DoSomething; } catch { LogException; } LogResponse; return response; } and all the methods follow this pattern, there is a lot o...

Accessing .NET Services from Mobile Clients

Hello, I have some HIGHLY sensitive data that I need to expose to Android and iPhone clients. My backend is completely in .NET. I'm trying to figure out the best approach to providing this sensitive data to the iPhone and Android platforms. I'm getting lost in all of the opinions circling around the internet. Some say use SOAP because...

What is the sender in RemoteCertificateValidationCallback?

ServicePointManager.ServerCertificateValidationCallback is a property of type RemoteCertificateValidationCallback. The constructor for RemoteCertificateValidationCallback takes a delegate such as public bool SomeCertificateErrorHandler(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { r...

C# How to fill class created using XSD.EXE from database

Normally I write a class and add XML Serialization to it for my web services. [XmlRootAttribute(ElementName = "dsXmlSummary", IsNullable=true)] public class Class1 { //declare properties //make database calls to pull data and load properties } I am working on a project that requires me to use a strict XSD, I've followed instru...

EF4 CTP4 Get Poco Entity Instead of Proxy Object

I have a proxy entity but I want to save the poco entity to the session ...

How can I use unit testing when classes depend on one another or external data?

I'd like to start using unit tests, but I'm having a hard time understanding how I can use them with my current project. My current project is an application which collects files into a 'Catalog'. A Catalog can then extract information from the files it contains such as thumbnails and other properties. Users can also tag the files with...

How to programmatically adding a label control into a web form?

Hi all, How do I add a label next to a textbox during runtime in asp.net? Unlike window form, I can't set the location of the control. So how do I instantiate a label and set the location next to a declared textbox? Or may be adding a string like "<span>my message</span>" next to the textbox will work for me as well. Thank you. ...

Issue with control layout when using Validation.ErrorTemplate

I have a custom control which is hosted in a Window with some other controls on it. The custom control and the window are in different assemblies as the custom control is to be shared across several applications. Within the window I define a style for type FrameworkElement and then in that style I set the ControlTemplate to utilize an ...

Mask URL - ASP.Net 3.5

Hi, I have hosted a site in a shared server, let me call as Server-X. My domain (ie. www.examplesite.com) is from another server, called Server-Y. I have changes the name server of my domain to point to the server-X. So that my website is alive and I can access the database and all works fine. The problem is it is showing that the si...

Visual Studio Office Runtime in Setup Installer Project Pre-requisite. Need help.

Hi, I am creating the installer for a application which references Microsoft Office 12.0 Object Library and Microsoft.Office.Interop.Excel I added a Pre-requisite in the installer to install Visual studio office runtime if didnt exists. But even after installation, the application throws error where it uses excel libraries.The error mes...

WPF C# binding code - why doesn't this simple example work?

Hi, I've attached some WPF C# binding code - why doesn't this simple example work? (just trying to understanding binding to a custom object). That is when clicking on the button to increase the counter in the model, the label isn't updated. <Window x:Class="testapp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/x...

What are the important features of C#

So, I am a C/C++ programmer currently in development of a small win32 project. I was told that C++ was becoming outdated, to be replaced with C#. This was over two years ago. So in your opinion, is C# a significant step up from C++, and does it provide more features/ease of use/ect.. that would make it worthwhile to learn. How much of ...

SqlCeCommand does NOT support subqueries ?

yesterday I wanted to create a sql query ( using system.data.sqlce ) which return values from diff tables on mobile devices. My scenario is as follows: - sql table: Xtable (fields: name : is string, mat : is string, state : is int value); - XTable contains 100 records my sql statement is: SELECT name, (SELECT count(*) from Xtable wher...

How to center image in MultiScaleImage

Found the function which position the image(s) in the multiscaleimage... but I'm not sure how to get the actual image width (for single or multiple) and change the _msi.ViewportOrigin x param based on that. There are 2 lines which affect the image position... one is _msi.ViewportOrigin = new Point(0, 0); and the other is: //if (lay...

How to get disk usage statistics for remote network share?

If I have a network share say \\myfileserver\documents, can I find out programmatically how much disk space it is using (used/free space) using any API of some sort? Please note it could be hosted by samba or it could be on a san storage device which means I won't be able to install anything on that machine to check the local disk usage...

What would be a sensible way to implement a Trie in .NET?

I get the concept behind a trie. But I get a little confused when it comes to implementation. The most obvious way I could think to structure a Trie type would be to have a Trie maintain an internal Dictionary<char, Trie>. I have in fact written one this way, and it works, but... this seems like overkill. My impression is that a trie sh...

How to create circle button with image background and CLICKING feel IN Silverlight

Hi Right now i can change the look of the button to an ellipse with a background image. However, when i click on it, i don't feel the CLICKING EFFECT of the normal buttons in Silverlight Can anyone help me how to get that effect? this is my XAML style for the round button <style x:Key="roundButton" TargetType="Button"> <Setter Pr...

dynamic grid view loses binding when post back occurs ?

dynamic grid view loses binding when post back occurs ? I have a dynamic grid View with template fields and bound fields as columns for the first page load all binding looks fine.values are populated in all columns when I trigger an event such as selected index changed in Drop downlist present in the column header(inside template...