.net

SQLite Pivot and Cross Tab Queries

Hi, Is there any way to create a pivot and/or cross-tab query using for SQLite using any of the available .NET wrappers? Thanks. ...

ORM supporting mapping of generic types

Are there ORM tools for .NET supporting mapping of generic types? I imagine at least two possible mapping scenarios: Mapping of particular generic type instances Mapping of all possible generic instances (based on constraints & other mapped types). ...

Closing or Hiding forms causes a cross thread error

I am baffled by this simple task i do over and over again. I have an array of child forms. The array is initiated in another form's constructor: frmChildren = new ChildGUI[20]; When the user requests to see a child form, i do this: if (frmChildren[nb] == null) { frmChildren[nb] = new ChildGUI(); frmChildren[nb].MdiParent = ...

Is there a good way to convert between BitmapSource and Bitmap?

As far as I can tell the only way to convert from BitmapSource to Bitmap is through unsafe code... Like this (from Lesters WPF blog): myBitmapSource.CopyPixels(bits, stride, 0); unsafe { fixed (byte* pBits = bits) { IntPtr ptr = new IntPtr(pBits); System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap( width,...

Does SharePoint 2003 support .NET 3.5 framework?

Hey everyone, I would like to know if there are any concerns that we should be aware of if we were to upgrade our SharePoint 2003 server to .NET 3.5. Does this version of SharePoint even support 3.5? Thanks in advance. Clint ...

Add table column names automatically in an ASP ListView?

I have an ASP ListView which I am using to display some pivoted information (across years) in a table. Currently I have the ListView templates defined as: <LayoutTemplate> <table id="listViewTable" class="tableData"> <tr class="rowHeader"> <td style="text-align: left;">Rank / Equivalent Rank</td> <td>2004</td> ...

Why did .NET's EnableDecompression default value change between 2.0 and 3.0?

We use .NET Web Services--both non-WCF and WCF, though the overwhelming majority is non-WCF, for legacy reasons--pretty heavily, and as I was testing something in Fiddler, I noticed that the response body size was pretty large. Then I noticed that the request headers didn't have any Accept-Encoding headers. After doing some digging, it ...

Using OpenGL to draw directly to a .NET Bitmap

I'd like to use OpenGL to draw directly to a .NET System::Drawing::Bitmap (C++/CLI). It seems like it should work like this: char buf[48]; ZeroMemory( &buf, sizeof(buf)); System::Drawing::Bitmap bmp( 4, 4, 12, Imaging::PixelFormat::Format24bppRgb, (System::IntPtr)buf); Graphics^ g = Graphics::FromImage(%bmp); HDC loc...

How to dispose managed resource in Dispose() method in C#?

Hi, I know Dispose() is intended for unmanaged resource, and the resource should be disposed when it is no longer needed without waiting for the garbage collector to finalize the object. However, when disposing the object, it suppress finalization of the garbage collector (GC.SuppressFinalize(this); in the code below). This means t...

How do get the path of Program Files regardless of the architecture of the target machine.

I'm programming in C#.NET. I want to be able to return the Program Files directory from the target machine no matter what the architecture of the target machine is. To clarify, I want it to return C(or whatever drive the OS is on):/Program Files no matter what bittness their version of windows is. I could just hardcode in the directory ...

Can I debug a compiled assembly?

I am looking for a way to debug compiled assemblies from Visual Studio. Is it possible? Maybe using some kind of reflector add-in? I am not looking for a way to decompile/recompile and then debug. ...

What are these extra parameters in my ASMX Proxy Methods?

If I add a web reference from a .NET 1.1 client to a WCF service, the proxy methods generated at the client contain an extra parameter ending with the suffix 'Specified' for each service method parameter, e.g. [OperationContract] string HelloWorld(string foo, int bar); results in: Service1.HelloWorld(string foo, bool fooSpecified, in...

How does C compute sin() and other math functions?

I've been poring through .NET disassemblies and the GCC source code, but can't seem to find anywhere the actual implementation of sin() and other math functions... they always seem to be referencing something else. Can anyone help me find them? I feel like it's unlikely that ALL hardware that C will run on supports trig functions in ha...

Shorter way to express regular expression matching a space or "&nbsp;"

I have a regular expression that is getting some information from a string. I need the values on both sides of either a space or a nbsp. Problem is that I believe the only way I can specify either or is with groups and bar. Is there a more concise or readable way to do this? There has to be! Using Regex in C# Regex: (\d)(?:(?:\s)|(?:&...

How to set Outlook contact "Notes" Property from .NET

I need to programatically Insert a contact to outlook Contact using C# application. I am using the Microsoft.Office.Interop.Outlook.ContactItem Object. I am able to set name, email, phone, etc. However, it does not seem to have a property for "NOTES" How can I set the notes for the outlook contact? Here is the code I am using: ...

SpiceIE Internet Explore extension - backspace doesn't work

I've seen this question circulate around the internet a lot, but haven't found an answer that has solved my problem. I am basically using SpicIE.Controls.Toolbar (C#) to create an explorer bar for IE. It has a few text-boxes on it among other things. The problem I have is that when I am typing in the text-box and hit backspace, the brows...

Efficient way to call a T-SQL built-in function from a .NET CLR UDF?

From a CLR UDF (C# syntax) is it possible to acquire a more or less direct handle to a built-in TSql function, instead of trying to kludge it into an ADO.NET SQL text like so? // Programming .inside NET CLR UDF: // Is there a more efficient way than this command? SqlCommand cmd... = new SqlCommand( ...'SELECT EncryptByKey(@Param, @Para...

WPF - FrameworkElement - Enumerate all decendents?

I have a FrameworkElement (really a ToggleButton) that has inside its content a Popup. I access it like this: ToggleButton button = (ToggleButton)sender; Popup popup = (Popup)button.FindName("popSelectIteration"); Usually this works fine. But sometimes popup is null. I am trying to find a way to debug this. Is there a way enumerat...

Is there anything special I need to do to get the Paint message sent to a Control in C#?

I have three classes derived from Control...Class1, Class2 and Class3. Class1 is the parent. It contains a list of Class2 objects, which, in turn, each contain a list of Class3 objects. Each class overrides the OnPaint method to paint itself. Class1 and Class2 paint themselves fine but Class3.OnPaint is never called. Do I need to do...

How To Call The RenderAction in my Html Helper?

im extending the htmlhelper. but it i cannot call the renderaction of it. using System.Text; using System.Web.Mvc; using System.Web.Mvc.Html; public static class ViewHelpers { public static string Text(this HtmlHelper htmlHelper, string name, object value, bool isEditMode) { htmlHelper.RenderAction(......