.net

Where can I find the ASP.Net MVC2 combo box?

I can't find it in the toolbox anywhere. What control do I have available that is similar to a Windows Forms combo box? ...

Keep settings in sync between forms application and windows service (or any n-tier, really)

I have a Windows Service that performs a number of periodic activities, and I want to change the settings of this service from a Windows Forms app. I'm not sure, though, about the best way to make sure the service has the most updated user preferences in it (how often to run, what folders to use for things, whatever else the user can spe...

KeyValuePair Is Nothing

How can we verify (.NET 2) if a KeyValuePair has a value assigned or not? Dim pair as KeyValuePair(Of A, B) = Nothing if pair.??? Then Return As is it a structure, it can't be verified with pair Is Nothing. Point structure, by eg. has a p.IsEmpty verification. ...

Control of type 'ImageButton' must be placed inside a form tag with runat=server. I thought MVC didn't use this?

I thought one of the benefits of using ASP.Net MVC2 was the cleaner and more logical markup you could make for a webpage. I'm creating the design of my master page and when I try to run it I get this error: Control 'ctl00_ImageButton1' of type 'ImageButton' must be placed inside a form tag with runat=server. Here's the code: <body> ...

How Can I Prevent Rounding Decimals?

I'm using c#, every time i insert 3 decimal places, the number gets rounded e.g. 1.538 rounds to 1.54 I want the number to be as is e.g. 1.53 (to two decimal places only without any roundings). How can i do it? ...

Fetch XML files from a web service to iPhone faster?

0 I am developing a iPhone App coupled with a .Net Web Service as the Backend. Need few clarifications on the same. The configuaration of my project. SQL SERVER2008 to store the data, .Net Framework 3.5 to provide Web Service interface, Iphone 3.1. The Project Description: The SQL Server will store my data in the form of XMLs. Each X...

TabControl.Items.Remove(TabItem) does not free memory used by TabItem

I am having a WPF application where when I close a TabItem from TabControl using TabControl.Items.Remove(TabItem) does not free memory used by TabItem. It just makes TabItem invisible and TabItem object still remains in the memory. Is there any way to remove this TabItem object from memory ? Any help would be appreciated. ...

Datatable subset of columns from another datatable

I have a datatable with 17 columns and a bunch of data. I wnat a datatable with only 6 of the columns and the data for those 6 columns. So I need a subset of the original datatable. How do I loop through the original datatable with 17 columns and end up with a datatable with only the 6 columns I want with the corresponding data for th...

Howto read service endpoint name from inside service implementation

I am hosting several endpoints under same service host, which implement same service contract. I need to start different business layer based on the endpoint name, so is there a way I get endpoint name inside my service implementation constructor? Basically, as a service I need to know which endpoint I was started under. ...

How do you tell if a window is modal or mdi window?

Given an window handle, is it possible to tell if the window is modal, or maybe an mdi child window? ...

Determine uniqueness of a delegate across app domains, for use in hashing for a distributed memory cache

Currently looking into distributed memory cache solutions, such as Memcached and Microsoft's AppFabric caching. It seems to me that one of the difficult hurdles in implemented a distributed cache for an application is determining appropriate keys for the hash. A naive approach is to hard code hash keys in your application so that all i...

How to Properly Hash a String

Will the following function correctly hash my provided string? Or am I missing something fundamentally important? Private Function HashString(ByVal value As String, ByVal salt As String) As String Dim dataBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(value + salt) Dim hash As New System.Security.Cryptography.SHA512Manage...

.Net SSL server library

I have created a server application that accepts connections over SSL. It's simple and works well enough. However, I'm wondering if there's a library out there that already does that. Ideally, it would be as easy to use as: authenticate with this certificate, listen on this port, and let me know when there's a new client connected. The l...

C#: using the iterator variable of foreach loop in a lambda expression - why fails?

Consider the following code: public class MyClass { public delegate string PrintHelloType(string greeting); public void Execute() { Type[] types = new Type[] { typeof(string), typeof(float), typeof(int)}; List<PrintHelloType> helloMethods = new List<PrintHelloType>(); foreach (var type in types) ...

how to run SSIS in ASP.NET

I Have the c# code here. using Microsoft.SqlServer.Dts.Runtime; string filedts = "C:\\SSIS\\SQLtoFLAT\\PQFormTEST2.dtsx"; Application app = new Application(); Package package = app.LoadPackage(filedts, null); DTSExecResult result = package.Execute(); I see all website code is the same like this, but when I run it I in ASP.NET, ...

.NET CF Listbox that can scroll like iPhone

Any know any Listbox control that can scroll with momentum like the iPhone's listbox? (Free / OpenSource preferable) EDIT: NO? REALLY Nothing for .NET CF that can scroll like iPhone? ...

CultureInfo issue with Modelbinding double in asp.net-mvc(2)

In my Jquery script I post two doubles using the browser's CultureInfo (en-UK) that uses the .as a fraction separator. My MVC app is running on a server with locale nl-BE using the , as a fraction separator. [AcceptVerbs(HttpVerbs.Post)] public JsonResult GetGridCell(double longitude, double latitude) { var cell = new GridCellViewMo...

How do I avoid namespace and class name collision in "vertically partitioned" assemblies?

By "Vertically partitioned", I mean having namespaces named after modules rather than "layers" So, MyApp.Core MyApp.Accounting MyApp.OrderManagement MyApp.HR instead of, MyApp.UI MyApp.Business MyApp.Data The only issue I am running into is that sometimes those assemblies might have a part of the namespace that is same as a ...

VB.NET Structs and Nothing - problems.

I'm having some headaches using Structures and functions that return Nothing in VB.NET. Let me try to explain here with this code: Public Class Form1 Structure Test Dim field1 As String End Structure Private Function Foo() As Test Return Nothing End Function Private Sub Form1_Load(ByVal sender As ...

Learn UML but from C# perspective... (i'm beginner)

Hi, I need to learn UML but from a C# perspective. I'm beginner with C# language, so I don't have any experience in C/C++ and other languages. I'm a freshstart learner with C#. So I check google/books but they explain with VB/JAVA code and other IDEs. I need to find a book or extensive page about learn UML with C#. I know a little ...