.net

how to get all countries w/ corresponding RegionInfo.GeoId

As I've seen, not all countries are listed with CultureInfo.GetCultures(CultureTypes.AllCultures & ~CultureTypes.NeutralCultures) If I look at the dialog below, I can see the missing countries are there. How can I get this complete list (with corresponding RegionInfo.GeoId) from .Net? ...

Assembly becoming 32bit specific when built in release rather than debug in VS2008

Hi All, I am having a strange issue when building assembly's for one of my modules. I was getting errors when running on 64bit which I traced back to being related to the assembly being 32bit specific. Our modules are(or should) all be built to be bit agnostic. Running CorFlags.exe on the assembly showed the following. Version : ...

What is LINQ exactly ?

Possible Duplicate: Learning about LINQ Hi everyone, I just want to understand what exactly is LINQ in DOTNET? And How does it work? Tx ...

Excel: ListObject can't write into a data-bound object's Nullable<int> columns.

I have a VSTO 4 (Visual Studio 2010) document-level Excel 2007 add-in where I use a ListObject to display data I retrieve from a WCF web service, which uses EF to fetch the data from the database. Some of the columns are Nullable<int> (as the database column is defined with NULL, and EF maps DBNull to null), and those that have null are ...

Send key stroke to window

I need to send a key stroke to some application. Now I use SendInput for that but it requires window to be foreground. I am going to use PostMessage/SendMessage for sending keystrokes but I heard there are some problems with them and they are not reliable. I would like to know what is wrong with PostMessage/SendMessage concerning KeyUp/K...

NHibernate second level caching with AppFabric

Has anyone used AppFabric for their second level caching? I know it's to follow the same api as for Velocity (nhibernate.caches.velocity) but wanted to know if anyone already had some production experience of using it and if they knew of any particular tips or problems? ...

Update textbox value into sql

Hi..When im trying to update the textbox values into db.It throws me an exception "Invalid syntax near (value of the txtkey.text)" Can anyone Help SqlConnection con = new SqlConnection("server=server1;Database=testdb;User Id=dev;password=sqlad@2006"); SqlCommand com = new SqlCommand("insert into tbl_licensing(UserName,Co...

Recording request page time with google analytics

It's easy enough to record how long a page takes to load using Events with Google Analytics and I can find plenty of examples of how to do that by searching. The problem is most of these methods record the start time as being the moment the page starts to load so in effect all it tells you is how long the page took to render in a browser...

Is there any book like "C# in Depth" for VB.NET devs?

C# in Depth (http://csharpindepth.com/) is an excellent book aimed at experienced .NET developers, however it's only for C-Sharpers. Anything like that available for VB.NET folks? ...

How to get mouse captured element.

I need to get mouse captured element to ReleaseMouseCapture for it. I have a problem with cancelling MouseLeftButtonUp event when element is already pressed. I need to cancel it before execution MouseLeftButtonUp. ...

How to cast a value of generic type T to double without boxing?

Dear ladies and sirs. Imagine the following simple code: public void F<T>(IList<T> values) where T : struct { foreach (T value in values) { double result; if (TryConvertToDouble((object)value, out result)) { ConsumeValue(result); } } } public void ConsumeValue(double value) { } The problem with the above ...

How do I pinvoke to GetWindowLongPtr and SetWindowLongPtr on 32-bit platforms?

I want to P/Invoke to GetWindowLongPtr and SetWindowLongPtr, and I'm seeing conflicting information about them. Some sources say that, on 32-bit platforms, GetWindowLongPtr is just a preprocessor macro that calls GetWindowLong, and GetWindowLongPtr doesn't exist as an entry point in user32.dll. For example: The pinvoke.net entry for S...

Data templates in WinForms

Hey guys I'm trying to have a grid that has items that have a custom layout/feel. If you have a look at the following http://mdavey.files.wordpress.com/2007/05/ldmain.jpg this is kinda what I am trying to do (see the aqua/red pods on the left and the graphs on the bottom right). Under WPF/ASP.Net I would know how to do this but in WinF...

JAVA or .NET which is more secure?

To make a secure website which language is more preferable .NET, JAVA or others and why? ...

skipping over potential nulls c#

I have this block of code that eventually get serialized to JSON, for use in the Jquery FullCalender plugin. The ToUnixTimeSpan method taskes in a DateTime object and returns the number of seconds since 1970. DateEnd could be null. In this block of code how do i test for the null and skip the end = ToUnixTimespan(e.DateEnd), if Dat...

FTPWebRequest behind NAT (PASV,SSL)

Has anyone successfully used the .Net FTPWebRequest class to ftps to a remote server from behind a NAT? My code is as follows: Dim URI = "ftp://" & sRemoteDir & "/" Dim ftp As FtpWebRequest = Nothing Try ServicePointManager.ServerCertificateValidationCallback = AddressOf ValidateServerCertificate ftp = CType(FtpWebRequest....

C# app runs in Windows 7, but not in Windows XP

Hey everyone, I have created an application in VS C# Express 2008 using Windows 7 as my OS. It runs perfectly fine on other W7 machines, but when we try and deploy it on a machine with XP it doesn't even run. I just get the usual "Application needs to be terminated" error message. The app was built using .NET 3.5 and all the machines ha...

Passing badly structured information to WCF method. Best practice

I have legacy Reporting Engine class that is responsible for 50+ reports with a single method CreateReport(Guid reportId, ReportParams params); Reports require 12+ of different parameter types (Guid, int, bool, enumerations) and their combination. For example: Report #1: No parameters are required Report #2: 2 Booleans (checkboxes pop...

How do I limit overriding in a hierarchy?

Hi, This is an example, I'm just curious as to how it would be achieved. I want to enable only subclasses of Animal to be able to set the number of legs that they have, but I still want them to be able to set their own colour. Therefore, I want to restrict classes further down the hierarchy from then altering this Legs property. publi...

How to get Messenger contact list through .NET

Hi, I want to be able to get the list of Messenger contacts of a certain user through .NET. I've seen Messenger Connect, but it's still under beta and with limited access. Any ideas for easier alternatives? I thought it would be as easy as invoking a WCF service. Thank you for your help. ...