Hi folks,
I'm trying to randomize the value for a simple DateTime datafield.
I wish to get a random date/time between two date/times (e.g. min date/time and max date/time).
So lets imagine I'm after a random date/time between
1/1/2000 10am and 1/1/2000 5pm.
Also, this code will be used in a for loop, with 100 items .. meaning all 10...
/want to put a musical easter egg into my app
The SoundPlayer code below seems to only like mp3s :-(
Stream stream = new MemoryStream(Properties.Resources.MyMp3, false);
using (SoundPlayer player = new SoundPlayer(stream))
{
player.PlaySync();
}
Thanks
...
[Test]
public void TestUserProfileInsert()
{
using (new TestBindingsWrapper("TestBindings", "", new TestModule()))
{
// Setup the mock the dataprovider
MyMocks.MockDataProvider.Setup(x => x.InsertUserProfile(It.IsAny<IUserProfile>())).Returns(1);
IUserProfile up = new UserProfile();
IUserProfileManager manager =...
Hello everyone,
I am using ADO.Net + C# + VSTS 2008 + ADO.Net to connect to SQL Server 2008 Enterprise. I am using almost the same pattern/sample mentioned here -- using ADO.Net DataReader to retrieve data one entry (row) by one entry (row).
http://msdn.microsoft.com/en-us/library/haa3afyz.aspx
My question is, if I set the SqlCommand ...
how can i connect win nt sqlexpress?
i am using this code to connect.it works with any version and kind of sql.
internal string GetConnectionString()
{
return "Data Source=" + "MyPC\SQLExpress" +
";Initial Catalog=Master;User ID=" + username +
";Password=" + password;
}
when connectiong with expr...
I'm trying to find a resource that shows what default conventions Fluent NHibernate uses with no custom (user) conventions applied.
Thanks!
...
Hello. I'm trying to implement code-completion popup window in my project. The window is derived from Form. It contains two controls: custom list derived from UserControl (it shows completion possibilities with icons) and a VScrollBar.
When the popup appears, it doesn't steal focus from the editor (form's ShowWithoutActivation is overri...
Look at the following program.
The comments show the order of execution when I use Visual Studio 2008, and start, and step through the program only hitting the F11 (Step Into) debugging hotkey. The first column is what I actually experience now, the second column is what I expected to happen.
Note that the method in the class marked wi...
I have some C# code that walks XML schemata using the Xml.Schema classes from the .NET framework. The various simple type restrictions are abstracted in the framework as a whole bunch of classes derived from Xml.Schema.XmlSchemaFacet. Unless there is something I've missed, the only way to know which of the derived facet types a given fac...
I'd like to know what the advantage of using a DataRelation in .NET is, as opposed to crafting the relationship in the data layer itself? Or is this largely a decision by the developer about which tier to place their logic in?
...
I am writing a financial application where the concept of 'Price' is used a lot. It's currently represented by the C# decimal type. I would like to make it more explicit and be able to change it to maybe double in the future, so I was thinking of creating a 'Price' struct that would basically act exactly the same as the decimal type (may...
I'm trying to add copy/paste to an application that edits items. Having a copy of the data for a set of selected items, should enable duplicating them or transporting them to another instance of the program. I've tried this:
const string MyClipboardFormat = "MyClipboardFormat"
private void copyToolStripMenuItem_Click(object sender, Eve...
I have developed a Windows service in C#. I have created a installer with Visual Studio 2008, which installs the Windows service. Everything is good so far. I want to make sure that the event source has been created at install time, so that any error/exception conditions at runtime are correctly logged to the Windows event log.
Does the...
I have an application written in .NET. The previous version had no problems: you double-click on the icon or run it from a command line and when it starts up, it's the main window and has focus as you'd expect.
The latest version displays a splash screen before the main window and now the splash screen comes to the foreground ok but th...
I need a link for some good tutorials about crystal report using C#
If there was also a free ebook or other resources that would also be great.
...
Hey guys
I'm a .NET web developer and just bought a new Mac.
I'm interested in developing, and debugging .NET in OSX, but I'm not interested in deploying to OSX. Although, in the future, I will be interested in deploying to Linux.
What are your experiences with Mono web development in OSX?
In particular, how does it compare in terms ...
I'm implementing a server component that needs to expose a web-service interface, but there is no application need for it to run with ASP.NET on IIS. Is there a straightforward way to implement Web Services in .NET without ASP.NET/IIS? (I'm using .NET 3.5 / C# 3.0)
...
I got "The question you're asking appears subjective and is likely to be closed." but you can answer YES or NO.
-- edit: Subjective questions are those typically answered with an opinion, so what's so bad about asking the opinion of the community? Also BTW, I'm asking for your opinion, your opinion doesn't depend on the nature of my pro...
I have done a global mouse event in my windows application. When i click the center button of my mouse, i want to make a particular form topmost...
There are some applications which runs in the full screen mode, so i need to do this, in order to make my form visible to the users, because this is the only way to view it. Since Alt + Tab...
Can someone please help me understand the following:
In the previous version of NHibernate (2.0.1) the following property will
validate and is compatible with the Castle Proxies:
internal virtual BusinessObject Parent
{
get { /*code*/ }
}
However, in 2.1 it errors saying that the types should be
'public/protected virtual' or 'prote...