.net

Which is better for multi-core hardware? multithreading or asynchronous methods

We need to develop a dashboard application for a giant screen. What it is does is collect all KPIs(Key Performance Indicators) and shows it on the giant screen in realtime in a visual manner so that the management leads know whats going on. So giant screen will have 20 to 30 independent graphs & pie charts(the number might increase soon...

How can I add an event handler to an event by name?

I'm attempting to add an event handler for every control on my form. The form is a simple info box which pops up, and clicking anywhere on it does the same thing (sort of like Outlook's email notifier.) To do this, I've written a recursive method to add a MouseClick handler to each control, as follows: private void AddMouseClickHandler(...

Using NServiceBus with multiple application both act as Publisher and Subscriber

Hi, I'm trying to use NServiceBus to make 4 applications communicating together. All these applications have to act as Publisher and Subscriber. The only way i founded ti get it workiing is to create a "master" queue named Server, on which MessageEndpointMappings in all applications configuration is mapped to, but i think it's not th...

Cryptolicensing - in what way is the trial version limited?

Lots of information on the Cryptolicensing product home page except for saying precisely how the trial version (of Cryptolicensing itself) is limited. Nor is there any mention on the download page itself. ...

.NET Setting TileSize.Width gives either scrollbar or blank space

When you set listView1.TileSize.Width = ListView.Width You get a horizontal scrollbar because the item is too wide. This happens until you subtract 4 pixels. When you do listView1.TileSize.Width = ListView.Width -4 you get a 5 pixel blank space, because the item is too narrow ??? What's going on here ? Is this some kind of evil ...

.NET application silently fails to start when assembly missing

I have a .NET C# winforms application which works great on my machine, but if I try to run it on another machine, it doesn't start up. No error message, no crash message, no window - nothing. I've found that this always happens when a referenced assembly is missing. I guess this is .NET's general behavior and not specific to my app, is ...

Can Uploadify send e-mail on complete?

Uploadify is a jQuery/Flash plugin for uploading multiple files. It's working great, except I can't figure out how trigger e-mail when all files are complete. If I try to add something like <% SendEmail(); %> to the onAllComplete parameter, it just sends the e-mail when the page loads. Is there a way to do this within the handler recom...

embedding dll requirement in program

hi I am writing a C# Windows application program and I'm using an add-on for creating chart in it,but when I run this program on another windows which has .net framework but not that package it does not work and give me exception. I want to know how can I correct this problem even with setup file? and if the answer is setup file then how...

Make the text of a disabled textbox easier to see

I have a text box that when it is disabled the text in it is gray and kind of dithered. (This is the standard functionality.) Is there a way to make this easier to see? I have tried this: txtBoxNumber.Enabled = false; txtBoxNumber.ForeColor = Color.Black; and that has no effect. NOTE: This is a .net Compact Framework app, but I...

Reattaching an object graph to an EntityContext: "cannot track multiple objects with the same key"

Can EF really be this bad? Maybe... Let's say I have a fully loaded, disconnected object graph that looks like this: myReport = {Report} {ReportEdit {User: "JohnDoe"}} {ReportEdit {User: "JohnDoe"}} Basically a report with 2 edits that were done by the same user. And then I do this: EntityContext.Attach(myReport); InvalidOpera...

How to convert value of Generic Type Argument to a concrete type?

I am trying to convert the value of the generic type parameter T value into integer after making sure that T is in fact integer: public class Test { void DoSomething<T>(T value) { var type = typeof(T); if (type == typeof(int)) { int x = (int)value; // Error 167 Cannot convert type 'T' to 'int'...

Should I implement IDisposable here?

My method which calls SQL Server returns a DataReader but because of what I need to do - which is return the DataReader to the calling method which resides in a page code-behind - I can't close the connection in the class of the method which calls SQL server. Due to this, I have no finally or using blocks. Is the correct way of disposi...

How to capture SQL with parameters substituted in? (.NET, SqlCommand)

Hello, If there an easy way to get a completed SQL statement back after parameter substitution? I.e., I want to keep a logfile of all the SQL this program runs. Or if I want to do this, will I just want to get rid of Parameters, and do the whole query the old school way, in one big string? Simple Example: I want to capture the outp...

Silverlight: Limiting or Filtering Datatypes in Hierarchical Data Binding in XAML

So I'm binding to a generic datasource that's comprised of different types of classes. I'd like to filter the tree based on the class types. I.e., I don't want the tree to show a node at all for certain types of classes. Has anyone run into this? ...

Printing nice looking object graphs in the Visual Studio Debugger

I need to print out an easy to read object graph from Visual Studio because I need to show a customer the state of an object at runtime. Are there any debug visualizers for this? Expanding everything in a quick watch window isn't easy enough for the customer to comprehend. ...

How do I render .NET TableCell as TH instead of TD?

I'm dynamically building a .NET Table, including TableRows with TablesSection set, resulting in 1 THEAD row and multiple TBODY rows. Now I need to get the TableCells in the THEAD row to render with TH tags rather than TD tags. How do I do that? I haven't found a TableCell attribute for that, and it won let me add Literals to the row C...

Read only observable collection

I have my class that has an internal observable collection. I want to pass the data in this to a user of the class via a function. I don't want them to be able to change the objects inside of the observable collection or the collection itself. What is the best way to do this performance and ease of use wise? ...

How can I dynamically clear all controls in a user control?

Is it possible to dynamically (and generically) clear the state of all of a user control's child controls? (e.g., all of its TextBoxes, DropDrownLists, RadioButtons, DataGrids, Repeaters, etc -- basically anything that has ViewState) I'm trying to avoid doing something like this: foreach (Control c in myUserControl.Controls) { if (...

Combine multiple dataset columns to one dataset

I have multiple datasets that I would like to combine into one. There is a common ID field that can be associated to each row. Calling Merge on the dataset will add additional rows to the dataset, but I would like to combine the additional columns. There are too many fields to do this in one query and therefore would make it unmanagea...

Update an infopath field with return value from webservice submit?

Is it possible to update an infopath field with the result of a call to submit to a webservice? We have an infopath form used to create items in the database. I would like to add a read only field for the id (primary key) of the item in the infopath form which is filled when the form is submitted to the webservice by the return value. ...