.net

What are some good sql databases for home Vista computer?

I have been trying for a long time to get SQL Server Express on my computer to practice my C#/SQL with and I still haven't gotten it to work. Are there other programs I can use to setup an SQL database to practice with? If so, which are the best ones for Vista? EDIT: To be clear I am not new to SQL programming, I just haven't done a...

System.Windows.Forms.Timer performance

We have an application containing a lot of user controls that update frequently based on a System.Windows.Forms.Timer. Am I safe to add a Timer instance to each control peformancewise? Or should I have one Singleton Timer that runs all the time that is to be used by all instances? What is acutally happening under the hood? Will there be ...

Identifying DDD Bounded Contexts and Structuring Project

Hi, I'm trying to get my head around Domain Driven Design and the examples I've seen seem to make sense but I am still unsure of how to apply them to my specific situation. I am designing a CMS where a user can post/edit an article. These can then be viewed by other users who can also make comments, add tags etc. The question I have is...

Linq To Sql Many-Many Join Table

I am a somewhat experienced Rails developer and I thought I would try out ASP.NET's version of MVC. In doing so I also decided to try Linq->Sql... I am a bit confused about the way Linq->Sql handles joins. A trivial example of my schema is : books: id title categories: id name books_categories: book_id category_id Simply dragging...

Do users have problems adopting Silverlight?

My group is thinking about switching our platform for web UI from ASP.net to Silverlight for several reasons. To be clear, these are business websites that provide a service to our users, we develop and host them ourselves. Has anyone switched their business / intranet web site from a traditional server-based web technology such as ASP....

Targeting ARM architecture with .NET compiler

When you compile windows application in .NET you can set "Platform Target" to be x86 or x64. This would optimize your code to a specific architecture of the processor and allow to escape IL. Does anyone know if there's something that would allow to achieve the same result for Windows Mobile application? I'm only interested in running my ...

Are asp.net AJAX page methods very secure?

We're currentlly thinking about secureity in our applications. Our preferred method of getting data from the back end is to use jQuery AJAX functions to directly access .aspx pages with page methods on them (without using a scriptmanager), as described brilliantly by Dave Ward here... http://encosia.com/2008/05/29/using-jquery-to-direc...

ASP-MVC: Object Instance Lost When Redirecting After Authorizing

I have an "Authorize" attribute on the Action that binds the form data. If the user submits the form but is not authorized, the login prompt appears. Once logged in, the user is properly redirected, but the model is null. How to handle this? ...

Testing a class with HttpContext.Current.Session in ASP.NET MVC

Hello. I'm adding some tests to a class that uses HttpContext.Current.Session internally and we are porting to ASP.NET MVC. My class looks like this: class Foo { public void foo() { HttpContext.Current.Session["foo"] = "foo"; } } I thought to change it like this: class Foo { IHttpSessionState session; pub...

extension method as a way to rename property

Some class has ugly field called URL, but Id rather call it file. public static void setFile(this AxWMPLib.AxWindowsMediaPlayer mp, string filename) { mp.URL = filename; } and public static string file(this AxWMPLib.AxWindowsMediaPlayer mp) { return mp.URL; } Is there any way to not use setFile, but make file act like p...

Raising event from base class

I understand that one can raise an event in the class that the implementation declaration occurs, but I wish to raise the event at the base class level and have the derived class's event be raised: public interface IFoo { event EventHandler<FooEventArgs> FooValueChanged; void RaiseFooValueChanged(IFooView sender, FooEventArgs ...

How to get a full node path with LINQ to SQL?

Hello, I have a basic hierarchy defined in an SQL table: Id ParentId Name ---------------------- 1 Null Root 2 1 Node1 3 2 Node2 Is there a good LINQ-ish way to get the full path of a node? For example, i want to pass the Id of Node2 and get the full path like Root/Node1/Node2. Thank you in advanc...

LINQ: Using AssociateWith and Distinct together

I haven't found a way to use these two elements together. Here is my issue: A web page has many bookmarks. A user owns a bookmark. A user can bookmark the same page multiple times (for my purposes). What I want is a list of the distinct users who have bookmarked a page. I'm trying to use the LoadWith() and AssociateWith() methods of...

Heap versus Stack allocation implications (.NET)

From a SO answer about Heap and Stack, it raised me a question: Why it is important to know where the variables are allocated? At another answer someone pointed that the stack is faster. Is this the only implication? Could someone give a code example where a simple allocation location change could solve a problem (eg. performance)? Not...

Visual C# for Macs

Is there a C# compiler for Macs that is compatable with Microsoft Visual C# 2008? ...

What is the Visual Studio 08 C# Assembly Information GUID setting for?

I am developing a C# Application and I was verifying the setting for publishing the application. What is the GUID setting under the Assembly Information section? ...

Is there a (relatively) painless upgrade path from ASP.NET 1.1 to 3.5?

One of my clients has an e-commerce CMS written in VB.NET 1.1. (The original solution was authored with Visual Studio 2003.) It's not an enormous site, but it does consist of around 40 or 50 Web forms, and I'd like to upgrade it to .NET 3.5, and to maintain and continue developing it it with VS 2008. I's sure I could do it surgically,...

Can I return a DataTable to fill an ASP.NET AJAX Client Template?

The following Server-Side code works: [OperationContract] public IEnumerable<object> GetBooks() { var people = new List<object> { new Book{ Author="Richard Preston", Title="The Hot Zone"}, new Book{ Author="Jim Norton", Title="I Hate Your Guts"} ...

In C#, where should I keep my timer's reference?

The documentation of System.Threading.Timer says that I should keep a live reference for it to avoid it being garbage collected. But where should I do that? My main is very simple that I don't know where to keep the reference: class Program { static void Main() { new System.Threading.Thread(myThreadStart).Start(); ne...

ASP.NET MVC: Access logs

On an ASP.NET MVC website, what's the best way to implement access logging? I want to answer the following questions: What are the most popular pages? Which pages were accessed in the last 24 hours? etc. I could log in to the server using Remote Desktop and poke through the IIS logs myself (even using Microsoft Logfile Parser), but I...