.net

Detecting if two png images are different

(Context: running autohotkey scripts to try and automate some tests. The plan is to take screenshots and then compare them to 'standard' screenshots to detect if output has changed). Is there a 'clever' way to check if two png images are different? By clever I mean other than comparing them byte by byte? (after having compared their s...

What data structure would be the least painful DataTable replacement?

I'm storing a lot of sorted ~10 row 2 column/key value pairs in ASP.NET cache-- they're the data for dropdownlists. Right now they are all DataTables, which isn't very space efficient (the rule of thumb is 10x increase in size when data is strored in a dataset). Old Code DataTable table = dataAccess.GetDataTable(); dropDownList.Data...

How to Update database through storeProcedure without knowing parameter names?

I have one table and a stored procedure(sp). I have to update the table using the stored procedure. At present I am using sp with four parameters but in the future may increase parameter list so, how can I update tge table without knowing parameters name and parameters count from Ado.Net. Note: I don't know even single parameter name bu...

Accessing a Windows App Object from another Class using C#.NET

Hi, I have a simple windows application where I have a window with some buttons and labels together with a couple of other classes. My problem is that I have some methods in the classes in which I would like to update some labels in the main form. How is it possible to access the labels directly from the classes? thanks EDIT: A littl...

Dynamic Table Column

Hi All, I have one scenario in which the user can define the column and that can be the master table. This master table has transaction table by ref its Primary key and also has some common column whose value is differ for each record. Example, user created table called XYZ and defined the column X1,X2,X3 etc,. And the Transaction tabl...

The targeted version of the .net compact framework does not support late binding warning?

Hi, i am developing a mobile application on visual studio 2008 under .net compact framework for windows ce platform. i use vb.net language i want to add a new row to datatable using Bindingsource object. my code is Me.BindingSource1.AddNew() Me.StokBindingSource1.Current("id") = "01" when i use Current methot of bindingsource it gi...

What are the pros and cons of using .Net to develop Facebook Apps?

Choice of programming language is an early decision which it is expensive to get wrong. Does anyone have any practical experience of developing for Facebook using .Net and MS vs LAMP? What are the pros and cons? ...

.net Regular Expression to match any kind of letter from any language

Which regular expression can I use to match (allow) any kind of letter from any language I need to match any letter including any diacritics (e.g. á, ü, ñ, etc.) and exlude any kind of symbol (math symbols, currency signs, dingbats, box-drawing characters, etc.) and punctuation characters. I'm using asp.net MVC 2 with .net 4. I've trie...

Is it okay to violate the principle that collection properties should be readonly for performance?

I used FxCop to analyze some code I had written. I had exposed a collection via a setter. I understand why this is not good. Changing the backing store when I don't expect it is a very bad idea. Here is my problem though. I retrieve a list of business objects from a Data Access Object. I then need to add that collection to another busine...

Detect when a users session has exipred

Hi, Can anyone tell me how to detect when a users session has exipred in asp? I want to redirect users to a logged out page once the session has expired Thanks Sp ...

Migrating a Classic ASP application to ASP.NET

We are in design phase of a project whose goal is replatforming an ASP classic application to ASP.Net 4.0. The system needs to be entirely web based. There are several new requirements for the new system that make this a challenging project: The system needs to be database independent. It must, at version 1.0, support MS SQL Server, Or...

How to simulate a corrupt state exception in .NET 4?

Well, in .NET 4 Microsoft added the HandleProcessCorruptedStateExceptions attribute: HandleProcessCorruptedStateExceptionsAttribute Class I want to test this feature. How can I bring my application to a "corrupt state"? ...

moq SetupSet is obsolete. In place of what?

Let's say I want to use moq to create a callback on a setter to store the set property in my own field for later use. (Contrived example - but it gets to the point of the question.) I could do something like this: myMock.SetupSet(x => x.MyProperty).Callback(value => myLocalVariable = value); And that works just fine. However, Setup...

Calling a function in the Form Class from another Class, C# .NET

Hi, Can someone please let me know by some code how I can call a function located in the Form class from another class? Some code will be of great help! thanks EDIT: This is my current code public partial class frmMain : Form { //*******Class Instances******* ImageProcessing IP = new ImageProcessing(); //************...

Is there anything like Enumerable.Range(x,y) in Java?

Hello there. Is there something like C#/.NET's IEnumerable<int> range = Enumerable.Range(0, 100); //.NET in Java? ...

Stack Overflow problem transforming with a custom xslt

I've got a system that allows the user the option of providing their own XSLT to apply to some data that's been retrieved, as a means of specifying how that data should be presented. However, if the user includes code in the XSLT equivalent to: <xsl:template match="/"> <xsl:element name="data"> <xsl:apply-templates select="." /> ...

How to replace HEX character in an xml document?

I'm trying to import an xml file into vb.net XmlDocument but am getting the error: '.', hexadecimal value 0x00, is an invalid character. Line 94, position 1. I'm wondering if there is a way to replace the hex character 0x00 The following are lines 92,93,94 the file ends on line 94 92 | </request> 93 |</rpc> <!-- XML Finishes he...

Start to Finish Advanced Project Tutorials

Can anyone recommend some start to finish project tutorials that really emphasize good design principles and best practices. I am looking for things that demonstrate and emphasize any or all of these: Domain Driven Design Unit Testing Inversion of Control Separation of Concerns Use of interfaces Object Relational Mapping Preferably ASP...

Learn to use Unit testing and Nunit application

Hi All I need to start using unit tests in my code . The problem is that i never written unit tests . Can you please recommend me some good sites and book how to write correctly unit tests and to use nunit application . Thanks a lot for help. ...

XXXX does not have a naming container... asp.net

I am working with a 3rd party datagrid (Janus Grid for ASP.Net) and I have the following exception caused when trying to bind the control to my data source: The GridEXDropDown control 'grdLocationHistorydd0' does not have a naming container. Ensure that the control is added to the page before calling DataBind. The Janus gr...