.net

Is there a reason why software developers aren't externalizing authorization?

The value proposition of externalizing identity is starting to increase where many sites now accept OpenID, CardSpace or federated identity. However, many developers haven't yet taken the next step to externalize authorization and use approaches based on XACML. Is the reason lack of awareness or something else? How would you expect to l...

How to validate SMTP server

Hi there, I am working on a project where I have to validate the given SMTP server i.e in a textbox user will provide the detail and then he will click on a test button. I want to check whether the server entered by the user is an Smtp Server or not? Any Idea?? ...

Gridview column sizing in edit mode

Hi, Is it possible to specify a size for the grid view cell when it is in edit mode. The size should be in terms of letters (like we have maximum size for a text box) and not in pixels. My requirement is that user should be able to input not more than 100 characters in the cell when he is editing it. I want to avoid validating after the...

DataLayer of a new Application: MyGeneration and/or Entity-Framework

The platform is ASP.Net 3.5sp1, with an Oracle db. We've considered both MyGeneration and Entity Framework for time and convenience in the DataLayer (and maybe some base classes in the Business Layer). My questions are: 1) Any pros and cons of using Entity Framework vs MyGeneration? 2) Any thoughts on using MyGeneration to generate...

Can I order the enum values in intellisense?

I have an eum type with 5 members. Is it possible to tell intellisense to order them the way I want? public enum numbers { zero, one, two, three, four } Intelisense shows (in alpha): four one three two zero ...

fieldInfo.SetValue throwing ArgumentException "Object type cannot be converted to target type"

This is driving me nuts. Perhaps I'm missing something obvious? The fieldInfo.FieldType is correct (DateTime), and the value I'm applying is also a DateTime. for(int i=0; i<objectArray.Length; i++) { FieldInfo destinationField = GetFieldInfo(i); object destinationValue = objectArray[i]; destinationField.SetValue(this, des...

[MBUnit 3] Is there any good way to run one set of tests with two different AssemblyStartups

I'm working on a pretty standed ASP.NET MVC application. We've got the core logic behind a set of services and we're using StructureMap to inject appropriate instances of appropriate IRepositories to abstract communications with the data layer proper. We've also got a rather exhaustive series of unit tests on these services. But, as thin...

.NET equivalent of this native code using crypto api

Hi, I have following native code (Powerbuilder) with uses the Crypto API to encrypt a string. I need C# code to decrypt the encrypted data. Can somebody give me a hint or sample? Thanks, Jaap private function blob of_encryptdecrypt (blob ablob_data, string as_password, boolean ab_encrypt) // ------------------------------------------...

Getting Session is not a memeber of My while converting a web site to web application

Currently I have a web site project having refernces to many other projects. I am converting the website to Web Application. I am keep getting Session is not a member of My, Cache is not a member of My, Logon is not a member of My. Any one has any idea how to get rid of these errors ...

Why doesn't Edit and Continue work on the x64 CLR?

Microsoft have explained that they won't be supporting Edit and Continue under the x64 CLR in Visual Studio 2010: When creating a new Visual C# Console Application in VS2010 for .NET 4.0, the default target settings for the project is to target the x86 platform instead of Any CPU (MSIL) like Visual Studio 2008 does [...] Ad...

C#: What is the best way to implement a 'filter' mechanism for ListView Items?

C#: What is the best way to implement a 'filter' mechanism for ListView Items? I want to filter out some listview items from view in 'details' mode where it contains rows and columns. What would be the best option to create such a mechanism where I could rapidly remove the items in question from view, leaving the others intact, and putt...

MVC Html.TextArea overload issue

I have a form in an MVC view which contains a number of text boxes, drop down lists and text areas. I am using the HTML helper to create these controls, including pre-populating them with View Data where appropriate, and applying styles via the htmlAttributes parameter. This is working fine with TextBox controls and DropDownLists etc, h...

How to lookup and invoke a .Net TypeConverter for a particular type?

I would like to implement a general purpose runtime type conversion function that makes use .Net TypeConverters to do the conversion. Does anyone know how to how to look up and invoke a TypeConverter for a particular type? Consider this C# example: // // Convert obj to the type specified by 'toType'. // object ConvertTo(object obj,...

Creating nice GUI

I'm seeking graphic advice on how to have your interface look better. So far I've been focusing on usability but its starting to look like a Jakob Nielsen kind of interface. I'm searching for tutorials on how to pimp up my windows forms application or at least general guidelines on how to do so edit : thank you for the info. I was lo...

TypeLoad Exception.....

Hi, I am working on standard windows mobile 6.i created an application in VS 2008 using sqlserver compact version 3.5.when i am deploying my application/cab file on real device.i am getting this error. TypeLoad Exception File or assembly name. 'system.data.sqlserverCe, version =3.5.0.0 culture=3.5.0.0 culture=neutral publickeyTo...

MSBuild error when building projects for the first time

When i try to run my MSBuild script for a project before opening it in IDE, I get this error: "The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild" What's the reason i'm getting this error? ...

WPF - OnPropertyChanged for a property within a collection

In a view model, I have a collection of items of type "ClassA" called "MyCollection". ClassA has a property named "IsEnabled". class MyViewModel { List<ClassA> MyCollection { get; set; } class ClassA { public bool IsEnabled { get; set; } } } My view has a datagrid which binds to MyCollection. Each row has a button whose "I...

Can C++/CLI yield?

In C#, I can use the yield keyword to implement a generator, viz: int GenInt() { for(int i = 0; i < 5; i++) yield return i; } Then, calling the function multiple times will return 0 through 4. Can the same thing be done in C++/CLI? There's no yield keyword, so my gut reaction is that there isn't, which sucks, but what ...

Datasets. Why use the query adapter instead or table adapter?

Hi, Can someone tell me why I would use a query adapter within the dataset designer instead of adding queries to the table adapter? Regards ...

ALT+ENTER Keyboard Shortcut to open Properties

I am writing a winforms application and one of the functions is to open an item's properties. I'm not able to find out how to handle this. A menu item doesn't allow to define such a keyboard shortcut and implementing the handler manually with the keyup or keypress event handlers doesn't work either. Anyone out there who knows how to do t...