.net

Filtering SQL by correct time spans in vb.net

I have a table that has two time columns. One is a login time one is a logout time. I would like to be able to filter between the two, basically greater than the minimum selected and less than the maximum selected. I am using a monthly calendar to get me the spans of time but it is not working correctly. From there I would like to add th...

Share object instance between web service invocations

I have an object that has relatively high initialization cost that provides a thread-safe calculation method needed to process web service requests. I'm looking for the best way to keep an initialized instance available between requests. One method is to declare it as a static variable. It would then remain available until the AppDoma...

Autocomplete jQuery on User Controller within Repeater .NET

I have a Multiview search feature on a Web User Controller that is called within a Repeater, OHMY!! I have some training sessions being listed out on a page, each calling an employeeSearch Web User Controller so people can search for employees to add to the training session. I have the Employee Names and Employee IDs listed out in JS on...

Func<T, TResult> for with void TResult ?

Func<> is very convenient in .NET. Is there a way i can specify the param type and have the result value as void? I'd like to pass void Write(string) as a parameter. ...

Efficiency of putting a query in the C# foreach condition

Hi all: I came across this c# code in a project today and I couldn't help but question its efficiency: SPList spList = spWeb.GetListCustom("tasks"); foreach (SPListITem item in spList.GetItems(query)) { //... do something with the SPListCollection it returned } Being from a Java background, the spList.GetItems(query) definitely m...

Is there a dtrace equivalent for .Net

Is there a .Net equivalent or analogue for dtrace? ...

Help me a solution for a .NET real-time application

Hello everyone, I am developing a system which include a server app & a client app, note: the number of clients can be to million. These are my requirements: Client must authenticate (username & password) to server to be accepted connection. And client will listen to server, and receive any data which sent from server. When server has ...

Response.Write(object)

Hi All, If I have a web page that does something like this, protected void Page_Load(object sender, EventArgs e) { List<string> items = new List<string>() { "test1", "test2", "test3" }; Response.Write(items); } How do I get the List back out at the other end...

Setting up Axiom3D (or finding a 2d C# openGL engine)

I have a computer that won't let me enable direct3d acceleration (i've tried almost everything). So I need a 2d engine in c# that supports openGL. I found Axiom3D, but I can't run the samples and I can't build the project, and it's driving me crazy. When I try to run the samples, it just blits open the command prompt and closes right a...

Tools to thumbnail multiple extension types

My requirements are to be able to thumbnail the major image and file extensions: doc(x), txt, xls(x), pdf, rte, and as many others as possible. We have been hooking into Office extensions to do this in the past, but they are not really supported on Vista and Windows 7 operating systems. Are there any third party thumbnailing applicatio...

Is there a way to flatten a .Net ILookup<TKey, TElement> into a List<TElement>?

Is there a quick way to get a flattened List<TElement> from an ILookup<TKey, TElement> that was created from the IEnumerable<TElement> extension? Updated with example List<int> list = new List<int>(); var lookup = list.ToLookup(key => key); list = lookup.?? // How to convert the lookup back to the list ...

User Settings vs Application Settings vs Resources in Visual Studio 2008

I'm a little confused by the different ways visual studio allows dynamic values to be saved to a project, and how they are intended to be used. I understand that if I need to include binary information like an image or a sound file with my application I need to add that to a resource file. But if I'm saving something like a file path as ...

Is ADO.NET the only native way to access databases in .net?

I have used code like this: http://msdn.microsoft.com/en-us/library/dw70f090.aspx to access database before when working in ASP.NET (2-3 years ago). I didn't realize I was working with ADO.NET. I am just a bit confused...is there another way data in a database can be accessed? How else would you do it? ...

ASP:GridView How to access value of a control set in <EditItemTemplate>

Hi - In my Gridview when a user edits a row, I'm showing couple of asp:TextBox boxes using the EditItemTemplate. One of the Text Box is bound to the UpdateParameters of my asp:ObjectDataSource. However the Second Box is not bound to any of the update parameters. I'm assigning a custom value to the second box. Now my problem is, when t...

fire button click event in a webpage rendered in webbrowser control from a winform

I'm accessing a login page rendered in webbrowser control and i need to login to it from code behind. What i'm aiming is to automate the login authentication to the site i'm accessing. I'm using C#.net. please help.. Thanks, jepe d hepe ...

Question about bitmap saving in .NET

I have a bitmap object and draw some curves on it by setpixel method. when I save this bitmap as jpg file, the background of my picture is not a white surface. the background is transparent. what is the problem? How can I resolve this problem? ...

Can color cycling be achieved in GDI+?

Is "color cycling" possible in GDI+ with WinForms? I'd like the modify one or more colors in the palette of an on screen surface so that whenever the surface is repainted, GDI+ will use the modified colors. Rather than perform the transformation manually pixel-by-pixel, I hope to use GDI+'s capability to render surfaces using indexed...

how to auto refresh user list in chat

i am developing chat application using .net, here i have to refresh the online users periodically, is there any way please suggest me. now i am getting user name once the user is logged in, and i am removing the user once he press the logout button, its ok and working fine, but some users just close their browser its not possible for me...

problem creating a worker app domain in .NET

I am trying to create a worker app domain in C# in VS 2010 to try out the simple sandboxing technique as mentioned here: http://blogs.msdn.com/shawnfa/archive/2005/08/08/449050.aspx My code inside the function Main looks like this: PermissionSet pset = new PermissionSet(PermissionState.None); pset.AddPermission(new SecurityPermission(S...

Why System.Enum is not a value-type?

I write the following code for some test, and the output is out of my expectation. public enum Days { Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday }; Console.WriteLine(typeof(System.Enum).IsValueType.ToString()); // False Console.WriteLine(typeof(Days).IsValueType.ToString()); // True So I check with Reflector ...