I have just refactored a colleague's code that, roughly, looked like this...
public class Utility
public void AddHistoryEntry(int userID, HistoryType Historytype, int companyID)
{
// Do something...
}
public void AddHistoryEntry(int userID, HistoryType historyType, int companyID, string notes)
{
// Do something...
}
...
How do I prevent my double value from being rounded when converting to a string? I have tried both Convert.ToString and ToString() with the same result.
For example my double may look something like 77.987654321, and the two strings conversions convert to to 77.98765. I need to keep the precision of the value as is.
...
I'm new to LINQ to SQL and I would like to know how to achieve something like this in LINQ:
Month Hires Terminations
Jan 5 7
Feb 8 8
Marc 8 5
I've got this so far, and I think there is something wrong with it but I'm not sure:
from term1 in HRSystemDB.Terminations
...
When I make a list box in WPF I frequently set its ItemsSource to be a List. Is there a Tree for TreeView (or what goes in ItemsSource for TreeView)?
Is there a collection or generally accepted method for handling tree data in C#.NET?
...
Model #1 - This model sits in a database on our Dev Server.
Model #2 - This model sits in a database on our Prod Server and is updated each day by automatic feeds.
I have written what should be some simple code to sync my feed (Model #2) into my working DB (Model #1). Please note this is prototype code and the models may not be as...
Say, you have a custom Windows service installed on a server. The service is written using .NET, and it is installed using either InstallUtil, an MSI package or the ManagedInstallerClass (if it makes a difference, pick the one that solves the problem). Regularly, you will need to deploy changes to the service, and of course you want to m...
ASP.Net MVC 2.0 will be released in a few months. There are some bug fixed and some new features. Which feature is more useful for you and you will use more?
...
It's not quite as simple as the title says but I hope you understand.
Consider this scenario:
Class MyClass
Property SubProp1
End Property
-TypeEditor(whatever)-
Property SubProp2
End Property
End Class
Class MyButton
Inherits Button
-MyCustomAttribute-
Property MC as MyClass
End Property
End ...
Hello there,
I'm just starting out in WPF and I'm building a simple movie library as a test project to help me find my feet.
I'm storing my movie information in XML, for example:
<movie id="1" title="Back To The Future" date="1985" ... />
The movies appear in a list and when clicked the fields will become editable. I've got that w...
I am trying to create a simple Network Tool to ping all possible IPs on your local subnet and provide a list of such IPs in a DataGridView. I am new to having to consider threading which is a good thing to come across as a budding programmer. Sorry, but you are probably going to have to do some explaining to me, but in my mind this sho...
I have a bunch of data in pipe-delimited format, where odd entries are index numbers, and even entries are the data e.g.
1|cat|2|dog|3|manatee|4||5|gerbil|6|etc
(note occasional missing values)
and I'm wondering if there is a nice .NET type way of turning this into a class pet with id and name parameters.
I've got some code which do...
This machine only have SDK and .Net3.5 installed. No VS2008 installed. after this warning,
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKe...
I am having a bit of trouble figuring out how to make a specific design in fluent nHibernate. I have a small workflow prototype with two aspects to it. First, you can design a workflow, that has a collection of 'phases' and a phase has a collection of 'Tasks'. I have this part loading and saving using nHibernate. Second part, these wor...
I made a splash screen and want to have some text change on it as different parts of the program are loaded but the screen isnt updating when i use refresh or update.
Dim splash As New BMSSplash
splash.Show()
splash.lblStatus.Text = "Retrieving active users..."
splash.Refresh()
buddyList.setuserList()
System.Th...
Recently discovered that the variables inside ToGadget, and presumably the delegate as well, weren't getting garbage collected. Can anyone see why .NET holds a reference to this? Seems that the delegate and all would be marked for garbage collection after Foo ends. Literally saw *B*illions in memory after dumping the heap.
Note: 'res...
Has anyone had any success converting a VS 2008 C++/CLI (vcproj) project to a VS 2010 project (vcxproj), whilst maintaining .NET 3.5 as the target framework? I haven't been able to do this and get the project to build successfully. The project compiles fine in VS2008 as .NET 3.5, and fine in VS2010 as .NET 4.0, but I am unable to target ...
I am using LINQ to SQL
and want to add functions to autogenerated EntitySet< TEntity > collections.
eg.
City.Houses
where Houses is automatically generated EntitySet < House >
I am using extension method to add extract function to the EntitySet < House > class
so that I can get something like
City.House.FindByID(id);
but now I ...
Collections that are bound in a WPF View must be updated on the UI thread.
ViewModel exposes a collection
Therefore when collection in the ViewModel is modified it must be done in the UI thread
Best practice is to keep ViewModels ignorant of View and presumably such details as Dispatcher.
What is the cleanest way to resolve this whil...
I am writing an application in which application errors are logged and posted to a listening HTTP port on our server. We decided against email since many of the clients running the server "would not be able to send anything through SMTP" (according to boss dude)
I was just going to send the data as-is using log4net and a custom-written ...
I have been asked to convert a legacy app containing some crystal reports from vb6 standalone to .net c# web based application
This is my first .net c# web app so I am learning as I go
My attempts to get crystal reports .net (included version not licensed) have failed.
I was pleasantly surprised to find that I could simply copy the ....