.net

Populate a class from Linq to XML

Ok, so I have an XML file that pretty much looks like this: <Templates> <Template> <TemplateID>00X500000011iTSEAY</TemplateID> <To> <To type='User'>00550000000mfOU</To> <To type='User'>00550000000mb3pAAA</To> <To type='Group'>00G50000001PiHz</To> <To type='AccountTeam'...

Self-tracking entities original values

Self-tracking entities do not save original properties values. So all properties are marked as modified when you call ApplyChanges. But I need to log the properties which actually changed. I tried to use ApplyOriginalValues, but in this case AcceptChanges throws an exception as finds entities duplicates. Are there any ways to make STE ke...

Are the keys in a Dictionary<TKey, TValue> immutable?

I get a Dictionary<string, string> back from an API but depending on certain rules need to modify some of the key names. Before I head down the road of copying to a new Dictionary I just wanted to confirm that the keys in a Dictionary<TKey, TValue> are immutable. ...

Table LayoutPanel Problem - Urgent

Hi, I am creating a TableLayout in which the rows and columns are set by the user at runtime. There initial controls on the form are rowsTextBox, columnsTextBox, button1 and tableLayoutPanel1. I modified some of the code from my initial program. Here's the old code. private void button1_Click(object sender, EventArgs e) { tableLay...

Why do my tests fail with System.Security.VerificationException?

I'm in the process of migrating one of my projects from VS2008 to VS2010. Now that I converted all of my projects in the solution to .NET 4.0 (Client Profile) when I run the test harness, almost all tests fail with the following exception: System.Security.VerificationException: Operation could destabilize the runtime. I've been...

High performance database queries

Hi I have a .NET desktop application, which is used by 5000 users who are distributed across Canada. One of the functionality is to communicate with some modems using some parameters that we get from the database. The unique thing about this functionality is: 1 - it should be extremely fast because it is communicating with modem tools...

Is there anything out there that will make it easy for me to allow my users to share their Facebook photos (and videos) on my site?

I see a bunch of .NET open source projects out there that look to be able to get at the users information, but I just want a user to be able to "post" media that's already on Facebook on my site as well. Other websites seem to allow you to do embedding of their media (I'm really liking oEmbed) but FB seems a bit of a mystery to me. I h...

string array.Contains?

.NET 2 string[] myStrings = GetMyStrings(); string test = "testValue"; How can I verify if myStrings contains or not test? ...

Mock/fake test data generator into NET classes

Does anyone know of a test data generator that will create the code to populate a .NET collection class which can then be copied into a unit test? Searching this site, all the tools mentioned seem to hit databases and I already have Red Gate's SQL Data Generator for that task. However if one follows the TDD paradigm and/or model first d...

Faster to declare variables inside a loop or outside a loop?

Is it faster to declare variables inside a loop or outside a loop? For example: ' Declaration inside of the loop For each item in items Dim newVariable as String = GetAString() Next ' Declaration outside of the loop Dim newVariable as String = String.Empty For each item in items newVariable = GetAString() Next Which one is fa...

Silverlight 4 custom control child items style

I have custom control where i want to show some items. In generic.xaml defined style for custom control: <Style TargetType="local:Custom"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:Customl"> <!-- Root Grid--> <Grid x:Name="CustomLayout" ...

Good book for building enterprise software with .Net platform

This book should cover such topics: recommendations for building and layering enterprise applications methodologies tools libraries and frameworks (I would prefer open source ones) best practise’s patterns code examples ...

SQL CE vs Jet in winforms application

I have a legacy desktop application using JET for the database. The application needs to be able to access the database file from a network drive. Should I migrate the data access to SQL CE (or SQL Lite), or leave it in JET? Maximum table row size is around 50000. ...

Single Sign on from Multipe Domains...

Hello, I have one domain such as http://www.mydomain.com and I have multple domains pointing to the same location in IIS by defining host headers, such as http://www.myONEdomain.com, http://www.myTWODomain.com, etc. In the code I use Request.Url.Host to determine which url the user came from and then I act differently in each page base...

C#/.NET Macro Recording and Playback

I'm in charge of taking an Excel VBA app and turning it into a stand alone piece of software. The main point of the functionality is to be able to record macros and play them back, think Website testing, mass SAP entries, anything a macro would be good for. I am not looking to re-invent the wheel, but I won't have the ability to install ...

What Exceptions Is .NET App Throwing

I am using a .NET app written by someone else, and I can see that's its refreshing very slowly today. Using Process Explorer, I see that its throwing thousands and thousands of exceptions (which are presumably being caught somehow by the app). Is there any way to see what type of exceptions these are if I don't have access to the sourc...

cannot add linqpad.exe to global cache.

i am trying to add MongoDb Linqpad Driver via NoRM. I am following instructions as in http://normlinqpaddriver.codeplex.com/ however i cannot add it. i get the following C:\Program Files\LinQPad>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\gacutil.ex e /i LINQPAd.exe Microsoft (R) .NET Global Assembly Cache Utility. Version 1.1.4318....

Media Center Style app

Hi, I was wondering how I can make a GUI that looks like Media Center, so like this: I don't know if it can be done with simple c# .net or if I have to use WPF or something. (The app needs to be written in C# style) I found a couple of tutorials for WPF but nothing I can use to create such an nice looking GUI. Hope somebody knows so...

IIS to access SQL server on different machine

I have a Gui running on a server with the IIS and the SQL database both on the same machine. I have this connectionstring in the webconfig. Data Source=localhost\SQLEXPRESS;Initial Catalog=XYZDB;Integrated Security=True Now i want to access another database on a different server, i thought it would just take me to change "localhost" ...

Looking for a free PDF Render library or command line utility

Good Day, I spent many hours looking for a free PDF (.NET or ActiveX) rendering library or command line utility that can be used in a commercial application. There are a few well-known tools and libs under GPL and numerous of expensive PDF Rendering libraries. GPL: xpdf, poppler, mupdf, GhostScript Commercial: PDFVew4Net, AbcPDF, Tall...