.net

Adding new Scalar types to EF 4

Entity framework maps DB types to .NET types, for instance SQL Server's BigInt is mapped to .NET's long. Is it possible to create a new type and have a store type (such as BigInt or VarChar) mapped to it? If so, how? FYI, my goal is to change the way the .NET scalar writes its value to the query, and specifically the way its default v...

Getting a value after gridview row updated

Hi I have a gridview that shows a list of questions. Only one field is editable and if the information has been edited an email is sent to a specific "destiny". All works fine but when I try to get the Question ID in my SendEmail function (using Findcontrol) I get "Object reference not set to an instance of an object." How Can I get th...

Container for Constants in VB.NET

VB.NET (.NET 2) Say I have some constants that depends one of other, and I decided to keep them together in a container instead of keeping it as individual constants in a class. I thought use a Structure for that scope, but compiler force me to declare a private member for that structure. ' Compile error: at least one private member...

Custom extensions in System.Security.Cryptography.X509Certificates

The .NET class System.Security.Cryptography.X509Certificates.X509Extension does not support some X.509 extensions I want to parse (subject alternative name, name constraints). The MSDN page for this class states "Custom extensions can be registered in a CryptoConfig file" (link), but the description of the CryptoConfig class discusses o...

Unwanted references in Setup Project

Hi, Recently when I compile my setup project, I receive the following error: Unable to find source file 'SomeDll.dll' for assembly 'SomeDll.dll', located in... When I create a new setup project with the same output it works, until I reopen VS, than it gives me the same error again. The problematic dll is one for which I have a config...

mdx DirectInput.CooperativeLevelFlags problem

I have this problem using MDX: i am trying to set up a keyboard device with the Foreground and Exclusive flags (up until now I let it to Background - which worked - and did the KeyUp / KeyDown events only when the app was focused, but with these settings I recon you can get some antivirus alerts because it could think that the app is a k...

Make debugger stop at System.Data.Services.Client.DataServiceClientException

I want to make the debugger in Visual Studio 2010 stop at the exception System.Data.Services.Client.DataServiceClientException. I use Debugging -> Exceptions -> Common Language Runtime Exceptions. When I drill down I would expect to see System.Data.Services entry, but that's not the case. How should I mark the exception for stopping,...

WCF Https vs Http.

Hello, There are two samples: for http: using System; using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; using System.ServiceModel; using System.ServiceModel.Description; using System.ServiceModel.Security; namespace ConsoleApplication1 { internal class Program { private s...

Nhibernate Facility Lazy loading problem

I am migrating my mvc web app to use Nhibernate Facility to manage Nhibernate sessions. I am encountering this strange problem; When I register SessionWebModule under web.config/ httpmodules via: <add name="NHibernateSessionWebModule" type="Castle.Facilities.NHibernateIntegration.Components.Web.SessionWebModule, Castle.Facilities.NHib...

Should I choose Line or FastLine in Windows Forms Chart Control?

I am currently using Microsoft's chart control - the MSDN documentation for it is here I am examining the SeriesChartType documentation, which is mostly unneeded, except for one question: What is the difference between the Line and FastLine types? When should I favor one type over the other? Thank you in advance for any help. ...

How to use Unmanaged Exports in Delphi

I'm making a project in C# and I want to use Unmanaged Exports and later to use it in Delphi. So can anyone explain me, how does Unmanaged Exports works, then how to use/import in Delphi. I'm using Visual Studio 2010 Express, on Windows 7 64 bit ...

Learning advanced Java concepts, techniques, frameworks, internals, etc for a .Net dev in the context of Android development?

I work with .Net professionally in a lot of different contexts, so it's easy for me to read about new frameworks, runtime internals, advanced techniques/design and put them to use and understand them. In the Java world, I have limited experience and am really only working with it for Android development these days. I've been able to le...

Windows system time with millisecond precision

Related to my previous question, but with C#, I need the precise system time including milliseconds. C# time function has accuracy up to 10 to 15 milliseconds, but not exactly 1 millisecond. The same is the case with Queue performance counter. Is there any other way to get accuracy up to exact millisecond? ...

C++/CLI exchange object references between multiple gcrooted managed objects

Hi unfortunately I'm not so good in the whole garbage collection thing. Now I am unsure if I'm going to get into trouble if I'm doing the following: // unmanaged Class class CUnmagedClass : public CCmdTarget { auto_gcroot<Dictionary<int, System::String^>^> m_dict; auto_gcroot<SomeManagedClass^> m_managedClass; // create fir...

What is the best way to make many versions ((Or history)) of Table's rows

Hi everyone, I'm trying to make my application support Logging but I'm very new at this approach. I were going to add new tables to my database for each table that i want to support logging to it and then deal wit that by my DAL "EF in my approach". But this will make me add a lot of work to both DB and DAL. ...

Silverlight 4 RIA Services, the SIlverlight 4 Toolkit controls and many to many relationships in database

I was looking at snippets and tutorials for quite some time now, but I can't find a complete answer - just some bits and pieces. I have a database with 3 tables: Product: id uniqueidentifier name nvarchar(50) Category: id uniqueidentifier name nvarchar(50) ProductCategory: fk_product uniqueidentifier fk_category uniqueiden...

UserControl in Custom DataGridViewCell Ignoring First Keystroke

I have a custom DataGridViewCell with a user-control as its editing control. The cell was built in the style of this article: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell.initializeeditingcontrol.aspx For the most part, this works great. The problem is that the regular behavior of a DataGridViewCell is t...

ComboBox SelectedValue property doesn't work

Hi iam trying to add objects into a combobox and use SelectedValue property to select and item in the combobox but it does not work, SelectedValue is still null after the assignment. class ComboBoxItem { string name; object value; public string Name { get { return name; } } ...

Windows 7, VS2010, .NET and AxMSCommLib

I have a project that is referencing the AxMSCommLib in VS2010 C#.. My Windows 7 Dev machine doesn't have or can't find this reference. Does anyone have any info on where to get this reference to make it work? ...

AxMSMAPI Windows 7 C# .NET Interop Missing

I have a project that is referencing the AxMSMAPI in VS2010 C#.. My Windows 7 Dev machine doesn't have or can't find this reference. Does anyone have any info on where to get this reference to make it work? ...