.net

Is it must to learn all the other versions of c# before starting with c# 4.0?

As i am a beginner who just finished my engineering and i have good knowledge in c,c++... I thought of studying c# as well but i found that c# 4.0 has been released..... Should i care about the previous versions? What are the tips you give for beginner to learn c# quickly? what are the factors to be considered when moving from c,c++ to...

Is programming Windows Mobile 7 different from normal .NET programming ?

I know that there must be some differences. I have a silverlight component (Timeline) and I want to make it work on Mobile 7. do I need to make a lot of changes ? I know .NET and Silverlight but I'm new to mobile phones programming. ...

Reflector and compiler genrated code

I have a dll which I disassemble in Reflector, I then generate a class. The class contains code which does not compile in Visual Studio. I take it it's leagl IL code, but how can I generate the higher level c# from this. Seems yield and IEnumerator generate things like <>1__state; in the IL which will not compile. Does anybody know ho...

How to remove the xmlns:XSI and xmlns:XSD namespaces from the xml output of a webservice in .net framework1.1

HI, This is an old question, i have seen some solutions on this forum itself, but am trying to use webservices for the first time so please bear with me on this one. I have a webservice that returns XML in the following format <subs xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" msisd...

Graphical designer for asp.net controls.

Hi, I'm searching a graphical designer, better than visual studio designer for asp.net typical and ajax controls. Visual studio designer (VS 2010 B2) very often don't handle with html code and shows nothing. Is there any better tool for writing code behind and design graphically controls for asp.net web sites? ...

Why can't I inject value null with Ninjects ConstructorArgument?

When using Ninjects ConstructorArgument you can specify the exact value to inject to specific parameters. Why can't this value be null, or how can I make it work? Maybe it's not something you'd like to do, but I want to use it in my unit tests.. Example: public class Ninja { private readonly IWeapon _weapon; public Ninja(IWeapo...

Windows Event Log - how to register an event source?

I am creating a new event source and logging a message using the code below: static void Main(string[] args) { if (!EventLog.SourceExists("My Log")) { EventLog.CreateEventSource("My Application", "My Log"); Console.WriteLine("Created new log \"My Log\""); } EventLog myLog ...

BeginAuthenticateAsClient hangs when called from a client to a non-secure server

I am developing an application that implements a TCP client. It needs to be able to talk to a server with or without TLS, either via a NetworkStream or an SslStream. When I connect I don't know which settings the server uses. My code works fine from non-secure to non-secure and from secure to secure. However when I set my client to use ...

SmtpClient.SendAsync code review

I don't know if this is the way it should be done: { ... var client = new SmtpClient {Host = _smtpServer}; client.SendCompleted += SendCompletedCallback; var userState = mailMessage; client.SendAsync(mailMessage, userState); ... } private static void SendCompletedCallback(object sender, AsyncCompletedEventArgs e) { // Get the ...

Calling all the 3 functions while using or operator even after returning true as a result.

I am calling three functions in my code where i want to validate some of my fields. When I tries to work with the code given below. It checks only for first value until it gets false result. I want some thing like that if fisrt function returns true then it should also call next function and so on. What can be used instead of Or Operato...

Parsing a .NET DataSet returned from a .NET Web Service in Java

I have to consume a .NET hosted web service from a Java application. Interoperability between the two is usually very good. The problem I'm running into is that the .NET application developer chose to expose data using the .NET DataSet object. There are lots of articles written as to why you should not do this and how it makes interopera...

How do I use the web colour editor in my own property grid?

I have a custom configuration tool for an application that uses the .Net PropertyGrid control. The classes underneath have Color properties that are edited in the grid. If I don't decorate the attributes at all I get a drop down colour picker that lets me choose Windows system colours. However this is for a web site, so I want hexadeci...

Convert byte array from Oracle RAW to System.Guid?

My app interacts with both Oracle and SQL Server databases using a custom data access layer written in ADO.NET using DataReaders. Right now I'm having a problem with the conversion between GUIDs (which we use for primary keys) and the Oracle RAW datatype. Inserts into oracle are fine (I just use the ToByteArray() method on System.Guid)...

Using JQuery to get and display Categories and Sub Categories - ALL AJAX

Here is the scenario :: Setup I have a list of Categories, and within those categories i have sub categories, and wihtin those i would have sub sub categories, etc. Follow? Ex: Category Flow that Exists Ex 1. Auto -> Parts -> Tires Ex 2. Auto -> Body -> Hood Now On the ui i would initally display Auto and on "clic...

Free launcher or bootstrapper that checks OS Version or whether .net framework installed

I look for a free launcher or bootstrapper that checks whether the .net framework is installed, and starts my app1.exe, or app2.exe if not. Alternatively a louncher that checks for the OS version. ...

Managing multiple .NET languages in a web application

I am part of a development team building a new ASP.NET 3.5 web application. Two of us are C# coders, and the other is a VB.NET coder. I know that we can mix languages on a per-project basis, and one can build classes in one language that inherit from classes written in the other language in a different project (which we are already doin...

Asyncronously receiving data in an ASP.NET MVC application

I'm looking for the best way to constantly check if data has been sent to our ASP.NET MVC application from a server. I would like to asynchronously check for data and update the view when data has been read. I'm currently using a TcpClient to make a connection, and making the connection in the inherited custom base controller. Current...

.net3.5: xml file should not be part of dll?

I dont want xml files to be part of dll. I want to change xml files after deploying dll on production.What shd i do? ...

OpenXML SDK: Make Excel recalculate formula

I update some cells of an Excel spreadsheet through the Microsoft Office OpenXML SDK 2.0. Changing the values makes all cells containing formula that depend on the changed cells invalid. However, due to the cached values Excel does not recalculate the formular, even if the user clicks on "Calculate now". What is the best way to invalida...

MailMessage, difference between Sender and From properties

I've been using the System.Net namespace ever since we switched from .net Framework 1.1 to the 3.5 framework, but there's one thing that's been puzzling me since. What's the difference between the Sender and the From properties in the MailMessage class? Are they both the same, and if not is there a reason to use Sender together with Fr...