.net-3.5

Entity Framework: Setting EntityReference EntityKey causes exception on save

I have a table with a ModifiedUserID field that is a foreign key to a User table. In entity framework, I'm loading the first table, but not the users table. I have the user ID of the current user, and would like to set the ModifiedUserID to that value for all entities that have been modified prior to saving. Before calling SaveChang...

Visual Studio 2008 breakpoint is not working

I am working on an ASP.NET project and I cannot make the breakpoints work! The project does not stop where I place a breakpoint. It does not seem to matter where I place the breakpoint. I am in debug mode; I am using IE 8, Windows 7 OS; Has anyone ever had this problem? ...

removing diffgram from .net web service returning dataset

per my client request I have been requested to return a dataset. basically it's an arraylist that i convert to dataset as follow DataSet ds = new DataSet(); DataTable tbl = new DataTable("Table"); DataRow drow; tbl.Columns.Add("ID", Type.GetType("System.String")); tbl.Columns.Add("Name", Type.GetType("System.String")); foreach (Na...

Determining if a .NET type is dynamic (created using Reflection.Emit)

While the .NET 4 framework provides the Assembly.IsDynamic method, that's not the case with .NET 2.0/3.5. The use case is simple: for logging purposes, I want to determine the underlying type name of an entity that might be wrapped by a dynamic proxy without having any references to NHibernate or Castle (which know about the proxy) For...

A generic list of generics

I'm trying to store a list of generic objects in a generic list, but I'm having difficulty declaring it. My object looks like: public class Field<T> { public string Name { get; set; } public string Description { get; set; } public T Value { get; set; } /* ... */ } I'd like to create a list of these. My problem...

.net, C# Interface between Business Logic and DAL

I'm working on a small application from scratch and using it to try to teach myself architecture and design concepts. It's a .NET 3.5, WPF application, and I'm using Sql Compact Edition as my data store. I'm working on the business logic layer, and have just now begun to write the DAL. I'm just using SqlCeComamnds to send over simple ...

How can I prevent my asp.net site from being screen scraped?

How can I prevent my asp.net 3.5 website from being screen scraped by my competitor? Ideally, I want to ensure that no webbots or screenscrapers can extract data from my website. Is there a way to detect that there is a webbot or screen scraper running ? ...

Custom activity designers in Workflow Foundation 3.5: How do they work?

Intent of this post: I realise that Workflow Foundation is not extremely popular on StackOverflow and that there will probably be not many answers, or none at all. This post is intended as a resource to people trying to customise workflow activities' appearance through custom designer classes. Goals: I am attempting to create a cust...

How can I have my Windows Form application minimize to system taskbar?

My dream is to make a very good, open source Help desk application for companies to use for free. My client application will run on every client computer have minimize itself to the task bar. When the user click the icon, it'll open the actual Winform window. I'm using .NET 3.5; is there a simple way to minimize/maximize from the taskb...

Subset sum problem

I'm having a problem with counting which is continuation of this question. I am not really a math person so it's really hard for me to figure out this subset sum problem which was suggested as resolution. I'm having 4 ArrayList in which I hold data: alId, alTransaction, alNumber, alPrice Type | Transaction | Number | Price ...

How can I get the processor NAME of my machine using C#(.NET 3.5)?

I need to find the Name and speed of the processor on my machine. I'm building an open source help desk suite and finding this really entertaining! Thanks for the help guys! ...

How can I get the IP address of my local machine the .NET 3.5 way?

I've found a ton of tutorials, however they are all very old for 1.1 or 2.0; there must be an easier way now with .NET 3.5. Care to share? :) ...

is there a way to remove duplication in this code

i have a method that looks like this: private double GetX() { if (Servings.Count > 0) { return Servings[0].X; } if (!string.IsNullOrEmpty(Description)) { FoodDescriptionParser parser = new FoodDescriptionParser(); return parser.Parse(Description).X; ...

Setting my PictureBox to transparent background color doesn't really make it transparent. Bug?

Here's what I have in VERY simple easy to grasp terms. My form background is Blue. I created a gradient image from white to the Blue from the form background. This is to give the form a nice gradient look. I added a picturebox to my Form and set this image as the Image. I added a picturebox with a Logo on top of the gradient Picturebox...

What Windows Form control would be a good fit for this use case?

I'm going create an open source Help desk solution free of charge for small to medium businesses to use. I'm currently working on the client application. I want to have a list of tickets that have been opened by the user. So it would be like a table TicketsByUser: Ticket Number | Type | Description | Date | Handled? 1234...

Creating an "list" of valid peripherals for my program.

Do I need to make an enum? I want something like: MyHardwareReport.Peripheral = ListOfPeripherals.Mouse or MyHardwareReport.Peripheral = ListOfPeripherals.Printer How can I achieve something like this? ...

Is it possible to load items from an Enum to a ComboBox in .NET 3.5?

Thanks for the info! ...

I'm trying to grasp the concept of creating a program that uses a SQL Server database, but I'm used to running it only on my local machine.

How can I make a program use a SQL Server database, and have that program work on whatever computer it's installed on. If you've been following my string of questions today, you'd know that I'm making an open source and free Help Desk suite for small and medium businesses. The client application. The client application is a Windows ...

Is the "SQL Server 2005 Database Project" the thing I'm looking for in this use case?

Please refer to my previous question here: Link Here Will this project type be useful for installing the necesary database on a servers machine? ...

How can I figure out my SQL Server address without having the Management Studio installed?

I have Microsoft SQL Server 2008 installed. It appears in the add/remove programs window. How can I create/delete/alter tables and find the address of my server if I don't have Management Studio installed? I'd like to create the tables and such directly in Visual Studio 2010 premium. ...