.net

Persisting Enums as byte or text to database

I am not able to make a clear decision on this one. I am OK by having numeric values on my tables and have the value information on the description of the column on the database for DBA. But I also don't want to come to a point in future where having these numeric values on database creating too much headache for maintenance. I'm not...

HttpModule with ASP.NET MVC not being called

I am trying to implement a session-per-request pattern in an ASP.NET MVC 2 Preview 1 application, and I've implemented an IHttpModule to help me do this: public class SessionModule : IHttpModule { public void Init(HttpApplication context) { context.Response.Write("Init!"); context.EndRequest += context_EndRequest...

Using Kerberos & LDAP

How do I implement Integrated windows authentication using ASP.Net kerberos protocol & LDAP in IIS? ...

Why can't I import this data to my RSACryptoServiceProvider? (C#.NET)

Hello :) For testing purposes, I have a set modulus and private exponent that I want to export into RSACryptoServiceProvider. Here is my code: byte[] N = { 0x00, 0x8C, 0x35, 0x04, 0xC8, 0x40, 0xB3, 0x67, 0xD8, 0x42, 0x35, 0x78, 0xF6, 0x2A, 0x02, 0xBE, 0xF7, 0x1C, 0xCD, 0x9D, 0x98, 0x55, 0x16, 0x3F, 0x81, 0xA4, 0xE5, 0x3E, 0x3...

Why does my comboBox go blank after selecting a value?

Given my table primary table for the binding navigator: CREATE TABLE [dbo].[asset]( [assetID] [int] IDENTITY(1,1) primary key, [assetTag] [varchar](15) NULL, [assetModelId] [int] NOT NULL, [employeeId] [int] NULL references employee(employeeid), [LocationId] [int] NULL, [purchasedDate] [smalldatetime] NULL, [purchasedby] [int] NULL refe...

Visual studio's debbugging and firefox

While I am debugging an app I notice when I try to open firefox when stepping through it will not pop up. I either have to run it or stop debugging. Does anyone know why? I don't use webcontrol, only WebRequest which AFAIK has nothing to do with firefox. also that section of code doesn't do anything with WebRequest. ...

"Bad Key." exception when decrypting with RSACryptoServiceProvider (C#.NET)

Hello. I am trying to decrypt data that has been encrypted previously in RSA (don't worry, I'm supposed to be able to, I have the keys. Nothing illegal :). However, I get a "Bad Key." error at the decryption line. I am sure this key is right, as I took it from vectors. The vectors are provided in the following code. Theoretically, I ha...

How do i check for a 302 response? WebRequest

Using WebRequest i want to know if i get a "302 Moved Temporarily" response instead of automatically get the new url ...

How to read the length and other info of a MKV movie files in C#?

Is there a .net library to do this? ...

A network-related or instance-specific error occurred while establishing a connection to SQL Server

Hello, I'm very frustrated. I have a website running on Visual Web Developper 2008 Express with my local database, everything works great. I also have the same web site running on a production server. Everything was working great but tonight I did a "reset" on production. 1) I deleted a couple of table, recreate them and insert data. E...

Shadowing events in .NET

Hi, In VB.NET there is a keyword 'shadows'. Let's say I have a base class called 'Jedi' and a derived class called 'Yoda' which inherits from 'Jedi'. If I declare a method in 'Jedi' called 'ForcePush' and shadow that out in 'Yoda' then when calling the method on an instance of the 'Yoda' class, it will ignore the base class implementat...

Securing access to a folder (IIS)

Hi, I have inherited a site which uses a flash ui with a .net 2.0 backend. The implemented login is very simple in that it just compares the username and password given with those in the db and returns true if ok. No session variables are kept. Once in the app, the user now has access to some pdf links. This works great, however, the c...

Can We Upload the Windows Application in IIS in .net

Hi, I have a windows application developed in .net c#. I want to put it in IIS similar to web application. Is it possible?? My requirement is: Just like web application, i want to get the URL for this Windows application and use the link to remotely access the windows application. Please suggest. Thanks Rupa ...

How do you map LINQ-to-SQL to your BLL classes?

I'm considering using LINQ-to-SQL for creating the DAL in my app. I normally create the DAL manually as I'm not a big fan of ORM (too much abstraction IMO) but I'm trying to save some time for an impatient client. My question is, how do you map the classes generated by LINQ-to-SQL to your BLL classes? Do you just add your code to the cl...

As a .NET beginner, what should I learn and where can I find open source projects?

I'm beginner programmer in the amazing world named ".Net". I've a lot of questions well, what I should learn C# or Vb.net What's the best blogs which talk about .Net technology and Open source projects Where can I find good tutorials, free books and ideas of projects how can I progress in ".Net" please, share your knowledge , your OPM...

Can ASP.NET outputCacheProfiles be used with Response.Cache?

When using the @OutputCache directive, you can define cache profiles as follows in web.config: <system.web> <caching> <outputCacheSettings> <outputCacheProfiles> <add name="myprofile" duration="30" enabled="true" varyByParam="myfield"/> </outputCacheProfiles> </outputCacheSettings> </caching> </system.web...

Self-referential enum attributes in a C# dynamic assembly

Consider the following code: [AttributeUsage(AttributeTargets.Field | AttributeTargets.Enum, AllowMultiple = true)] public class TransitionToAttribute : Attribute { public readonly object Next; public TransitionToAttribute(object next) { Next = next; } } [TransitionToAttribute(Directe...

WCF Security - Data origin security

I have a web service implemented in WCF. This service is only going to be called by a single client, a site with a static IP address. I would like to implement simple security that would verify that all calls to the service are only valid if they came from this particular static IP. What is the best way to do this? ...

Can I use the VC++ 2005 compiled DLL in not DOT-net application i,e compiled in VC++ 6.0 ?

I have a application developed using VC++ 6.0, I want to use some DLL's which are complied in VC++2005 (visual studio 2005), is this possible to use these dll in tat application? I can port my application to 2005 but there are few issues which need some time to fix, I want a fast release, Can anyone tell me is this possible to do this? ...

Wpf - centering on primary desktop

I know WPF has a "CenterScreen" value for centering a window on the desktop. However, on dual monitor, that is not very pleasant. How do I center on primary monitor? Do i need to go through the song and dance of detecting the primary desktop, get its geometry, etc, or is there a better way? ...