.net

"Noisy" Logging Problem.

Throughout our enterprise we have many applications that log activity to text files for diagnostic purposes. Generally if something fails or breaks an email notification is sent to notify our team of problems. Also we have a monitoring application that notifies our team via email when an application has a longer than expected period of...

Using Shockwave Flash object in Win Form, But it is asking for Adobe Flash player Installation

Hi, I have used the Shockwave Flash object com component in my .net Windows form. The problem is in one of the user's system,it is asking for the installation of Adobe Flash player as it is not already installed. But it is installed in his system. Kindly let me know why this is happening. ...

Drag & Drop Shapes on Canvas

Hi, I put several shapes (like Ellipse and Rectangle) on a Canvas. Now, I want user to be able to drag & drop these shapes. Is there some predefined functionality that I can use, or I should implement the drag & drop myself using the mouse events ? Thanks ! ...

DateTime.Parse issue, not support in System.Globalization.GregorianCalendar

I'm having an issue where a specific time string, contained in the Gmail Atom feed isn't parsing using DateTime.Parse(). I understand I could use DateTime.TryParse(), but I'm curious to why these two don't work, where as all of the rest do. 2009-12-28T24:11:48Z 2009-12-30T24:16:20Z the specific exception is: System.FormatExceptio...

Conversion of IEnumerable<T> to IList

If a method takes a parameter of type System.Collections.IList can I legitimately/safely pass a value of type System.Collections.Generic.IEnumerable<T>? I would appreciate a thorough explanation of why this is possible and what actually happens to the object T when the IEnumerable<T> is used inside of the method. Is it converted to t...

ASP.NET MVC 1 or MVC 2

I recently recieved the ASP.NET MVC 1.0 Professional book by Wrox, and in the intervening time, I found out that ASP.NET MVC 2.0 is being released soon. Questions Should I MVC 2.0? Are there any resources specifically for MVC 2.0? Should I learn MVC 1 and then unlearn concepts and then learn MVC 2? ...

Having trouble uploading files in ASP.NET MVC

I can see there are plenty of questions and resources about this but I just cant seem to see what I am doing wrong. HTML Snippet <form method="post" action="<%=Url.Action("Create", "Image") %>" enctype="mulitipart/form-data"> <input type="file" name="ImageFile" id="ImageFile" /> And here is the Controller code, none of the Console.W...

WPf Datepicker Input modification

I am creating a form using wpf/c#. I am looking to programatically change/interpret the user's typed input in the wpf toolkit DatePicker. For example, the user types "Today", and when the control looses focus the date is interpreted and set to the current date using my c# function. Should I listen to the lostFocus event or is there a...

Validate NT User via SQL CLR

I need to be able to validate a given username and password against Active Directory and return whether that user exists. My setup is that I have two web servers in a DMZ, and then a SQL Server in the LAN. The sales people have a admin panel that is on the web servers. When they login to the admin panel, I want it to run a stored proc...

Error when calling a .net dll from Com Visible dll using javascript

I am developing a windows 7 gadget.I am creating an activex object and loading the assembly.I am following the methodlogy mentioned here at codeproject (GadgetInterop). One of the tasks of the gadget is to interface with Facebook. This is how I am referencing: Javascript creates a GadgetBuilder object. From here I load the my library. s...

How should I integrate SqlTransaction legacy code with TranactionScope?

I have an existing application that uses a lot of SqlTranaction calls. The way the application is built we get a bunch of code that looks a bit like this (error handling etc removed for brevity): Using transaction As SqlTransaction = Database.CreateSqlTransaction() If Not Me.FitnessSession.FitnessTestSessionID.HasValue Then ...

CRM 3.0 Callouts Running in CRM 4.0 Causing Infinite Loop

I recompiled a library of CRM 3.0 callouts and deployed them to my CRM 4.0 instance. One of my PostUpdate callout calls service.Update(). This is causing the update method to fire many times. It eventually stops due to timeout errors. This does not happen when these callouts are used with CRM 3.0. The method signature is as follows for ...

Extending Enumeration Definition in a child class in .NET

I have a base class which needs to define an enumeration: BaseClass - SomeEnum I then need to create two derived classes from the base class and extend the values in the enumeration: ChildClass1 : BaseClass - SomeEnum - SomeEnumValue1 ChildClass2 : BaseClass - SomeEnum - SomeEnumValue2 In C# or VB.NET can someone provide th...

regex hour:minute (hour > 24)

I would like to validate and extract the hours and minutes from a string using Regex in .NET. Just to recuperate the two numbers, separated(or not) by :. Accepted format h:m or m. Unaccepted :m, h:. EDIT: This is to note, that the number of hours could overflow the 23 till... 32. The overflow for hours(over 32) and minutes(over 59) I w...

Tagging images in document

Hi, I 'm trying to do add tags to images which are in embedded(added) to word/pdf documents like taggify does. I was looking for suggestions on how to start? This question is an extension of http://stackoverflow.com/questions/128305/tag-images-in-the-image-itself-how-to thxs ...

How do I draw an image reflection in WinForms?

I want do draw a reflection in C# (WinForms) of an image, so I need to be able to flip the image horizontally. I know I can do this with image.RotateFlip, but the problem with this approach is that I have to flip the image twice so I can draw it again the right side up on the next paint. Doing this twice per paint per image seems to be...

Trouble deep-copying a 'List<T>' C#

I am having trouble with deep-copying a list. My main window, called Form1, has an instance of System.Collections.Generic.List<T> and I wish to provide the ability to edit this list through a separate SettingsForm which has an OK- and a Cancel-button. If the user presses "OK" then the changes to the list shall take effect but if the use...

Serial COM-connections 64bit versions

Hi, I have a .net Application that writes text to a serial COM port, a POS reciept printer to be more exact. i am using the Rs232 class library to write and read to a serial device. My problem is now with some clients that have updated their operatingsystem to WIN7 64bit version, have trouble to create a connection to the COM-port. th...

“Could not find type” error loading a form in the Designer

This is the exact same question as this one: “Could not find type” error loading a form in the Designer Before anyone goes closing my question please read that one. You will realize that it did not get a real answer. I hope to get a full answer (rather than a workaround) from this question. When I create a class that descends from Co...

Nhibernate doing updates on select?

Hi, I have the following class: public class Product { public virtual Guid Id { get; set; } public virtual string Name { get; set; } public virtual Decimal PricePerMonth { get; set; } public virtual BillingInterval DefaultBillingInterval { get; set; } public virtual string AdditionalInfo { get; set; } } and the mapping look...