.net-3.5

Binding a method that returns List<employee> to a gridview

Hello, I have method in my N-Layered application that returns List. Below is the sample code for the method public List<employee> GetAllemployees() { List<employee> empl =new List<employee> empl=DAL.GetEmployees(); return empl; } Now I have a gridview in my aspx page and how do I set the gridview datasource as GetEmployees() ...

Nhibernate Projection Query DTO, use method in stead of property

Hey, This works: projections.Add(Projections.Property(Member<MailOrder>.From(x => x.AssigneeCode).QualifiedPath), Member<MailOrderItem>.From(x => x.AssigneeCode).Path); projections.Add(Projections.Property(Member<MailOrder>.From(x => x.AssigneeName).QualifiedPath), Member<MailOrderItem>.From(x => x.AssigneeName).Path); proj...

Export any kind of object for a further reuse ?

I'm working on different data structures which are obtained after long computation time. Is there a way to create an object in a first build and use this same object in a second build (for the sake of time computation) ?? I need to do this without specifying the type of object.. Thanks ...

load images using jquery ajax in asp.net

Hi Guys, I am looking for a good approach on how to do the below I have a file server where i store all of images. I need to display these images onto my webpage using jquery and ajax. Can someone please advise on how to do the above i can do the reading of the image from file server using a web service hosted on the file server whic...

disable / remove .NET Framework 3.5 language pack in windows 7

Windows 7 comes with the .NET Framework 3.5 already installed. Because I installed the Dutch version of Windows 7, the errors thrown by .NET 3.5 are also in Dutch. Not very practical when debugging in Visual Studio, I want the English exceptions. In Windows XP this was not a problem, you could uninstall the language pack (Install / Unin...

List with a key

Before I embark on writing my own, is there a List like construct that also contains a Dictionary like key? And before someone suggests using a Dictionary instead, the order of items is important to me and Dictionary cannot guarantee a position. So, I'd like to be able to retrieve the item in the following manner: int position = 4; M...

How do I convert month names to int?

I have a column called Month in a stored proc which returns to me the month in string name terms (eg. January, Febuary, March etc.) I would like to convert that to an integer. Is that possible without just using a number of select case statements? I would like to do this in .NET 3.5 ...

How to put a label over an image

I was trying to look out for a possible solution and am yet to find one. Could you help me out how to add a text over an image. Below is my code and I want lblWelcome and lblUsername to come over the image. <img alt="Logo" src="../Resources/Images/Header.gif" style="height: 70px; width: 1000px;"/> <asp:Label ID="lblWelc...

Array of tuple not working

hi, this snippet of code Tuple<int,double>[, ,] myArray = new Tuple<int, double> () [xsize, ysize, zsize]; returns this error Cannot apply indexing with [] to an expression of type 'Tuple' Where I'm using Tuple structure as defined here. Thank you for your help and many thanks to this website authors, this site helps me a lo...

Can I create a custom desktop icon for a shortcut in ClickOnce Deployment?

My application creates a shortcut on the user's desktop with a standard icon. How can I change the icon to something custom? I'm using VS2008 with .NET 3.5. Thank you. ...

WCF Service - Accept Client Certificates

I have a requirement (govt client) to turn off all authentication schemes (No anon, NTLM, digest, basic, etc) in IIS6 and enable client certificates only. This part is non-negotiable. This WCF web service provides the data to a Silverlight client. With Basic authentication is on, everything works peachy. When it is turned off, we get...

Why is ASP.NET trying to generate a temporary class for a Web Service reference?

In Visual Studio 2008 I have a Class Library project (called Media) to which I added a Web Reference (not a Service Reference) to a third-party web service (wsdl). In the Class Library project a proxy class is created for using the service along with several classes for the types used in that service. I also have a second Class Library ...

How can I programmatically select or scroll to a TreeNode in a TreeView based on a string path?

Hello, I am implementing one of the common scenerios of a TreeView control and I am using a drives, files and folders. to make a File System. That means each node potentially has a path. Problem is, we have the ensureVisible method but am not entirely convinced this does what it says it does. There is no explicit 'setVisible' to false ...

How to make a .NET COM wrapper generic

I think this is a factory / provider type story but I'm not sure how to describe my problem. It goes like this. InstallShield has a COM Automation Interface that they change the name of it with each release. If it was VBScript I'd say set project = CreateObject("ISWiAuto15.ISWiProject) ' InstallShield 2009 set project = CreateObject(...

Why can't I use AsyncMethodCaller?

This is the first time I've used a thread that requires returning values to another class via a callback method. I've read up on it, and it seems that everyone is using the AsyncMethodCaller. However, even though I've added the necessary reference to my project, VS 2008 thinks it's undefined... what else could I possibly be doing wron...

If I have two time periods, how do I find out if they overlap?

Possible Duplicate: Determine Whether Two Date Ranges Overlap Say I have two objects, and each of these objects have a date ranges which is between its end date and start date, how do I figure out if there is any overlap between the two date ranges in the most efficient or quickest way. I would like to do this using .NET 3.5 ...

How do I find if two variables are approximately equals?

I am writing unit tests that verify calculations in a database and there is a lot of rounding and truncating and stuff that mean that sometimes figures are slightly off. When verifying, I'm finding a lot of times when things will pass but say they fail - for instance, the figure will be 1 and I'm getting 0.999999 I mean, I could just r...

I need to develop a webservices monitoring .net Application. What is best way to design this

Need to develop a Webserver Monitoring system. There may be Hundreds of webserver running on different servers. This system need to keep monitoring of each webservice at a given interva and update the status in DB. The current options designed. Options1: Created class Monitorig it has Method1 which call the webservice dynamically on re...

Linq: Xml to IEnumerable<KeyValuePair<int, string>> deferred execution?

I'm trying to pull out the Roles below into an IEnumerable<KeyValuePair<int, string>> <PROJECT PROJECT_NO="161917"> <CONTACT CLIENT_ID="030423253272735482765C" CONTACT_NO="1"> <ROLE ROLE_ID="2" ROLE_DESC="ARCHITECT" /> <ROLE ROLE_ID="5" ROLE_DESC="INTEGRATOR" /> </CONTACT> </PROJECT> private static ProjectContact Buil...

How can I accomplish ThreadPool.Join?

I am writing a windows service that uses ThreadPool.QueueUserWorkItem(). Each thread is a short-lived task. When the service is stopped, I need to make sure that all the threads that are currently executing complete. Is there some way of waiting until the queue clears itself? ...