.net

How do DateTime.ToBinary() and DateTime.ToFileTime() differ?

Can anyone help explain the difference between DateTime.ToBinary() and DateTime.ToFileTime()? As far as I can tell they seem to always return the same value (when dealing with UTC times at least). The same applies to DateTime.FromBinary() and DateTime.FromFileTime(). I've tried using Reflector and I can see some differences, I just don'...

How to display dynamically the previous month name.

I want to display the previous month name. My code is given below but it displays the index of that month. I want the name of that month. According to this given code it dipslays the tool tip as "Balance up to 9", but I want to display "Balance up to September". How get the name of that month? lblPreviousBalance.ToolTip = "Balance up t...

Slow DB2 connection on .NET

Hi, I'm working on a project where we're gonna fetch data from a DB2 database. I've been testing with both the ibm provider and simple odbc and with both approaches the connection open method is very very slow. If I try doing the same thing with Java and the IBM jdbc driver, it is a lot faster. Does anyone have any tips on how to i...

how to handle this race condition?

hello, in my class i use a BackgroundWorker. at some point i need to cancel the asynchronous operation that can be in progress and start another one immediately. the code follows. one thing that i am not sure about is the race condition that can occur if the worker completes right before i assign my lambda to RunWorkerCompleted event. i...

.NET and MySQL working together and is it scalable

Hi All. I'm working on an application that will use .NET as the application platform. Originally, we were going to use SQL Server as the database, but after some research, MySQL came up as a popular database that is used by some high transaction based applications(i.e. Facebook, Craigslist, etc...). The app we're working on will involve ...

What's the purpose of xml files next to the dll?

For instance, log4net.dll comes with log4net.xml. What's the use of this xml? ...

Reflection: optimize performance

Hello, i want to know if i could optimize the reflection part of my app. Background information: the vb.net windows application checks if database records apply on different rules. So i created an Interface iRule and (so far) 54 rules-classes that are implementing it. They all belong to the same project(Rule.dll). Because people shou...

Code termination in .NET/VB

Possible Duplicate: How to terminate code that takes long in vb.net? how to terminate function/code (not entire page) when it takes some time, for example, more than 1 sec? If Code > 1 Sec Then Terminate the code.... I found the command "Server.ScriptTimeou", but it stops the entire page instead of one command. ...

How it is possible to reach a variable from a different code-block expression than the block where the variable was declared ?

Hi, Can someone explain the working principle of asp.Net below? I have 2 separate code-block asp.Net expressions in an aspx markup, with an html content between (span element in the example below). In the first code-block, there is "i" as an increment variable for the for loop. Then the code-block is cut with an html content. And a...

HTTP request with post

Hello. How can I make http request and send some data via post? I can do "get" request but have no idea how to make "post" one. C# ...

Monitoring Framework needed

Hello! I'm building a big application with a lot of modules, i want to monitor them. Every module has its own different parameters that I'm interested in, ranging from performance, to logical statuses of components. Eventually i need to concentrate all this information, and to be able to display it. Is there a framework i can use to ac...

Where to store encryption key

I am encrypting data (health care industry) using the aes encryption classes in the .net framework. What are some of the recommended locations for safely storing the key? I have it in the web.config for development, but that does not feel production worthy, to say the least. ...

Possible to pre-empt the Windows message loop?

I have a wpf application that populates an Infragistics XamDataGrid by the usual method of binding an observable collection to the grid. As each data item is populated into the collection, one at a time, the grid updates. I also have a cancel button that I would like to immediately stop the population if the user clicks it. However, it ...

Redirecting std output from Process object to file in .net

Is there a simple way how to launch a process in .NET and redirect its output(s) to a file? I know that in Win API I can pass a file handle to the CreateProcess function. In .NET I can do something like startInfo.RedirectStandardOutput = true; and then use BeginOutputReadLine and StandardOutput to get the data and save it to a file. ...

looking for a remote configuration solution

I'm writing a large distributed application, i want to be able to configure all my components remotely. is there a framework available to help me with this? using .net 3.5 ...

Coding standards for VB.NET

Possible Duplicate: C# Coding standard / Best practices What VB.NET or C# coding standards are you using for your .NET applications? I was looking at hungarian notation and I don't think it is a good idea for a .NET application. Any suggestions? Thanks ...

Error 1 Operator '*' cannot be applied to operands of type 'method group' and 'double'

I believe what i am trying to do is very simple but I get the error. Operator '*' cannot be applied to operands of type 'method group' and 'double' I want to multiply the number of days that have been stored in dayrental by the amount 19.95 if that checkbox is checked. I get the error that says I cant because dayrental is a method. Ho...

When to use Cast() and Oftype() in Linq

I am aware of two methods of casting types to IEnumerable from an Arraylist in Linq and wondering in which cases to use them? e.g IEnumerable<string> someCollection = arrayList.OfType<string>() or IEnumerable<string> someCollection = arrayList.Cast<string>() What is the difference between these two methods and where should I apply...

Is this an inefficient way to parse XML?

I'm probably worrying about wrong optimization, but I have this nagging thought that it's parsing the xml tree over and over and over again, maybe I read it somewhere. Can't remember. Anyways, here's what I'm doing: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using System...

Row doesnot exists in DB- Exception

We have a dataset dsActualCost which fetches query value: MonthName in one column and Cost in another. We have a code to display data in table format. For MonthIndex = 0 To dsMonth.Tables(0).Rows.Count - 1 Dim tdMonthlycost As New TableCell If dsActualCost.Tables(0).Rows.Count > 0 Then If IsDBNull(dsActualCost.Tables(0).Rows...