.net

Database Changes Rolled back when rebuilding the .SLN (VS2008)

So, folks. Got an interesting occurrence going on here. I have a windows forms application made in VS2008 which has, up until recently, been connecting to a SQL Server 2008 database. I was able to edit, insert, delete, or select any of the various tables within the database, and the changes were commited -- each time I made a change to ...

WCF - Win App "The maximum string content length quota (8192) has been exceeded while reading XML data."

I am at a loss... not sure exactly why this is happening. I have gone through at least 50 pages in Google and scoured StackOverflow for this answer. When I run this code I keep getting the error message: "There was a an error while trying to deserialize parameter http://tempuri.org/:message. The InnerException message was 'There was ...

how do I get a subset of strings from list 1 which are not present in list2?

I have two lists list 1 = { "fred", "fox", "jumps", "rabbit"}; list2 ={"fred", "jumps"} Now I need to get a list3 which contains elements of list1 which are not present in list2. so list 3 should be list3 = {"fox", "rabbit"}; I can do this manually by using loops but I was wondering if there is something like list3 = list1 - list...

Creating Non-stroked Region in C# StreamGeometry Xaml markup

I am looking for a way to create non-stroked regions for a StreamGeometry in xaml. In other words, I want to know if it is possible to recreate the following code (taken from msdn) with the StreamGeometry Xaml markup syntax. StreamGeometry geometry = new StreamGeometry(); geometry.FillRule = FillRule.EvenOdd; using (StreamGeometryCont...

Use LINQ to find complex combinations of items in two lists

This question is very similar to a previous question of mine, Use LINQ to count the number of combinations existing in two lists, except with some further twists. I have a list of CartItems that can receive a discount based on the items specified in the list of DiscountItems. I need to be able to pull out the items in the Cart that c...

What happens if I call a event handler declared inside a function that is not being executed?

Something like this: void SomeFunc() { int InsideVar = 1; EventHandler handler = (s, e) => { MessageBox.Show(InsideVar.ToString()); }; SomeEvent += handler; } And then SomeEvent is invoked after SomeFunc is executed. I actually tested it and it worked but cannot understed why. I thought InsideVar wo...

Connect Windows Mobile to client PC over WIFI

What would be the best way to transfer a string across a network from a windows mobile device(so .net) to a .net app running on a pc on the same wifi network? Would normal sockets work or would i use something like a webrequest? The client can be any version of .net. Thanks ...

How to get started on using NorthScale Memcached Server

Hi, I'm looking to use NorthScale's Memcached Server with Amazon EC2, I've launched a new instance using one of the AMIs on http://labs.northscale.com/memcached-ami/ but how do I go about configuring the bucket name, login credentials and the pool URL? Do any of you guys know of any good introductory material to help me get started on w...

Can I replicate the IsStroked property for a PathSegment in Silverlight 4?

In WPF it is possible to use the IsStroked property of a PathSegment to make the Segment invisible, I'm looking for a way to replicate this behavior in Silverlight, which doesn't have this property. Is this possible? [EDIT] I'm looking for a way to do this in code-behind, not in Xaml. ...

Is this a safe way to execute threads alternatively?

I would like to run code alternatively, so I could stop execution at any moment. Is this code safe? static class Program { static void Main() { var foo = new Foo(); //wait for interaction (this will be GUI app, so eg. btnNext_click) foo.Continue(); //wait again etc. foo.Continue(); ...

ASP.NET MVC and Test Driven Development

I am novice.NET programmer. I've learned C#, Windows Programming, SQL Server 2005, ASP.NET 3.5. I want to ask if it would be difficult or not appropriate for me to start working at a job which requires ASP.NET MVC and Test Driven Development. I've already obtained the book "Pro ASP.NET MVC Framework", but this book overburdens me. So wha...

Having trouble getting rid of redundant code via inheritance or generics

Sorry for the vague title, but I wasn't sure how to summarize this in one phrase. I have a situation with a lot of redundant C# code, and it really looks like some kind of crafty trick using some property of inheritance or generics would solve this. However, I'm not a terribly experienced programmer (particularly with C#) and just can't ...

loop one sequence and check againt other list

Hi, i have a namespace string like "Company.Product.Sub1.Sub2.IService". The Sub1/Sub2 can differ in their count, but normally their is one part which matches to a Dictionary with AssemblyFullname as key and path to it as value. Now ive written this code string fullName = interfaceCodeElement.FullName; var fullNamePart...

WPF ScrollViewer

Hi, I was wondering if there is anyway to check if the up arrow or the bottom arrow of a wpf scroll viewer is clicked. I am trying to do it within a wpf textbox but, I want it to snap to the next line of a text instead of displaying partial text. So, the way for me to do this is when up/ or down is clicked. i would say textBox.lineup...

DataTable to XML and ViceVersa in C# .Net

I am having a Problem with reading a xml file onto a DataTable. Initially I am writing a Datatable to a XML file and saving it. Now when I want to read the xml file back to the datatable, its not happening. The following is the code for writing and reading private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) ...

SQL server reporting; missing data in sub-reports when exported to EXCEL

i am having 2 independent reports which pulls data from sql database; when i run those reports independently, the reports shows data perfectly and i can export it to excel without any issue of missing/incorrect data in EXCEL. but when i tried to make either of the report; a sub-report of other report, then the data exported in excel is m...

Load independent assembly in a another App Domain

Hi, simple question, probably easy for you to answer. I have a dll named "MigrationSteps.dll" in the same output folder of my application. What I want to do, is to load this assembly in a new AppDomain and execute a method on an instance of a class inside this DLL. Here's my code string migrationStepsDllPath = Path.Combine(AppD...

How to show full row highlighting for a ListViewItem?

I've got a ListView and, for View = List, would like to have the list items fill up the entire width of the control. That is, when you click an item the whole row is highlighted. I can't find any setting in the ListView or ListViewItem to control this behavior, and padding with spaces doesn't work very well because I cannot rely on the...

Entity Framework 4.0 Creating a new entity derived from other entities

I currently have a complex entity relationship setup based on my data structure in sql server 2008. What I'm trying to do I would think would be ridiculously simple but I'm pulling my hair out and have spent days trying to figure it out. I have an Address and AddressType table which are joined on addressTypeID. There are 2 AddressType...

MySQL's utf_general_ci in C#

Is there an easy way to replicate the behavior of MySQL's utf_general_ci collation in C#? In particular, given a Unicode string, I want to generate a(n ASCII?) string that can then be trivially sorted or compared, as utf_general_ci would. I found this question, which shows how to strip accents from strings, which looks like a similar b...