convert (15,821)


Calculate relative time in C#

Calculate relative time in C#

Given a specific DateTime value, how do I display relative time, like: 2 hours ago 3 days ago a month ago…


c# - Filling a DataSet or DataTable from a LINQ query result set

How do you expose a LINQ query as an ASMX web service? Usually, from the business tier, I can return a typed DataSet or DataTable which can be serialized for transport over ASMX. How can I do the same…


c# - How do I get a distinct, ordered list of names from a DataTable using LINQ?

I have a DataTable with a Name column. I want to generate a collection of the unique names ordered alphabetically. The following query ignores the order by clause. var names=(from DataRow dr in dataTa…


Decoding T-SQL CAST in C#/VB.NET

Recently our site has been deluged with the resurgence of the Asprox botnet SQL injection attack. Without going into details, the attack attempts to execute SQL code by encoding the T-SQL commands in…


How to export data from SQL Server 2005 to MySQL

Closed. This question is off-topic.It is not currently accepting answers. Want to improve this question? Update the question so it's…


Embedding Windows Media Player for all browsers

We are using WMV videos on an internal site, and we are embedding them into web sites. This works quite well on Internet Explorer, but not on Firefox. I've found ways to make it work in Firefox, but t…


c# - Floating Point Number parsing: Is there a Catch All algorithm?

One of the fun parts of multi-cultural programming is number formats. Americans use 10,000.50 Germans use 10.000,50 French use 10 000,50 My first approach would be to take the string, parse it backwar…



Format string to title case

How do I format a string to title case?…


How to remove the time portion of a datetime value(SQL Server)?

Here's what I use: SELECT CAST(FLOOR(CAST(getdate() as FLOAT)) as DATETIME) I'm thinking there may be a better and more elegant way. Requirements: It has to be as fast as possible(the less casting, th…


Reading a C/C++ data structure in C# from a byte array

What would be the best way to fill a C# struct from a byte[] array where the data was from a C/C++ struct? The C struct would look something like this(my C is very rusty): typedef OldStuff{CHAR Name[8…




string how from java example array python get int format