.net

Asynchronous processing in SQL Server vs. .NET Asynchronous processing

What's is the advantage of using Asynchronous processing in SQL Server over .NET Asynchronous processing? Aren't they the same? I have a hard time to understand what is the benefit of using Asynchronous processing in SQL Server instead of .NET APM. I can easily wrap a SQL call in a lambda expression and do a BeginInvoke(...). Can someon...

Serializing a dataset to a strongly type business object property

In a vb .net winforms app I am trying out something for "wide and shallow" children of a record. I use strongly typed business objects ( Strataframe ). My plan is to have a number of "child tables" collected in a dataset I drop on the form. they have no correspondence in persisted data, so the dataset is untyped and I am creating th...

Unable to call c# code from vbscript - ActiveX error

Hi, i am trying to call a method i have written in c# from vbscript. I have followed just about all of the instructions i can find on the web and am still having problems. Specifically i am getting the error, ActiveX component can't create object, Code: 800A01AD. So far i have done the following.. 1] Set ComVisible(true) 2] Registere...

linq paging - get total rows

Hi, i have a question about linq. I'm using Skip and Take to do paging: (from l in db.ProductList select l).Skip((page - 1) * row_per_page).Take(row_per_page) It work, and i need retrieve total rows of product list to calculate max page. I think i must use another query to count rows but have another way to do this in one qu...

Which name for a "smart" dictionary (hashtable) ?

Hi, I'm looking for a good name for a custom dictionary which automatically initializes the value for a requested key if it doesn't exist, using a delegate. The indexer implementation should help understand what it does : public V this[K key] { get { V value; if (!_dictionary.TryGetValue(...

Custom GhostDoc Rules

I am a huge fan of GhostDoc and use it in all of my development projects. Knowing that it supports custom rules I'd like to ask what custom rules have you written? ...

How to access sharepoint data using C#?

I am working on project where I have to access SharePoint data in C#. I've never done this before; and have the following questions? How would I access SharePoint data from C#? What API do I use? Are there any tutorials out there that will help me get started? ...

Are there any tools to ease porting of .NET code to silverlight?

Dear ladies and sirs. We have some .NET client side code, which we would like to port to Silverlight. However, the current .NET code simply does not compile on the Silverlight platform. Along with some subtle issues, there are many simple issues, like: - some exceptions have less constructors in SL - Debug.Fail does not exist in SL -...

How do I redirect to a not-authorized page instead of the login page when the user is already logged in?

How do I set my Authorize(Roles="blah") token to redirect to a "You're not authorized to do this" when a user is already logged in but isn't in the correct role? Currently it redirects to the login page which isn't what we're after. We feel that it's confusing for the user to be redirected to this page as they're already logged in. In...

IIS 6.0 Not loading SessionState for .NET 3.5 Application using HttpHandler

QA and Dev enviroments work perfectly. Handlers all implement the IRequiresSessionState marker. Config File contains: <pages enableSessionState="true"> and <sessionState cookieless="AutoDetect" mode="InProc" timeout="20" /> IIS has session state enabled in application properties and Application is running in its own Application Po...

Draw an image with custom transparency in GDI+

I'm drawing lots of images (all of them dimensions=24x24 pixelformat=32BppPArgb) onto a Control using a Drawing.Graphics object and the DrawImage() function. It's possible to zoom out in my application which means that the Graphics object has a Transform Matrix attached to it which controls both zooming and panning. There's no point in ...

creating a .NET custom control

I want to create a control which is basically a ListBox, but each ListItem is a collection of controls. So each item of that list box is a combination of a Label, a CheckBox, a Timer and a TextBox. Can this be done with the .NET framework? If so, do you have any recommendations on how to get started, any links to samples or discussion,...

The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

Can someone help me with this error? When I try to open a connection to an mdb, I get "The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine" error. How can I correct this? My code is pretty simple: class ImportTDB { private string filename; private string connectionString; private int collisions = ...

Where should a Windows application's working files be written?

If you have a Windows application that needs to write working files as part of its normal operation (not prompted by the user): Where on the file system should they be written? What's the correct way to get this directory in .NET for all Windows versions (XP/V/7/Server)? (Writing to the same directory as the executable or a "temp" di...

How to handle recurring dates (dates only) in .NET?

I am trying to figure out a good way to handle recurring events in .NET, specifically for an ASP.NET MVC application. The idea is that a user can create an event and specify that the event can occur repeatedly after a specific interval (e.g. "every two weeks", "once a month" and so on). What would be the best way to tackle this? My br...

object instantiation

Hi Guys, I am new To .NET Programming, Can anyone please explain me about object instantiation with the real time example ? Thanks In Advance ...

Does the end user of an asp.net application needs .net installed

When creating a asp.net page, which uses the .NET framework, does the client accessing the page need to have the .NET framework installed on their computer? I.e. User goes to www.fakesite.com/default.aspx, if they do not have the framework installed will they be able to access the website? I ask because I'm not sure if the server proce...

Manipulate Hyper-V from .NET

Are there any means for a .NET application to create, delete, start, and stop Hyper-V virtual machines? I would like to create an automated means of starting and stopping (the create & delete are bonus) virtual machines from a C# application. I figured that (atleast) there would be a means of doing this via P/Invoke, but I cannot find a...

Are Strongly typed ArrayLists the better choice in C#?

When I programin C#, there are times I need a strongly typed collection: I often create a class that inherits from the ArrayList: using System.Collections; public class Emails: ArrayList { public new Email this[int i] { get { return (Email)base[i]; } set { base[i] = value; } } } I r...

VB.NET app works in IDE but throws an error when compiled and run on another machine

I have created an application using VB.NET in VS2008. When I run the app in the IDE on my development machine it works fine. It also works fine when I build it and run it as an exe on any machine that also has Visual Studio installed (at least 2005 and 2008 anyway) However, when I try to run the compiled executable on any machine with...