|
Ok i will try
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
currently i m using net 2005, 2.0 framework.
how to compare more than two date's in .net (web forms)? (both C#.NET,VB.NET)?
for example i have 4 date's
10/23/1987
7/11/2000
2/2/2008
2/1/2008
So, the resultant should be "2/2/2008" (among all the above date's this "2/2/2008" is largest)
how to achieve it? - KARAN
modified on Friday, May 2, 2008 5:52 AM
|
|
|
|
|
If you use .net 3.5 (VS 2008) you can use extension methods to easily do this:
Assuming dates is an array of DateTime objects:
DateTime maxDate = dates.Max< DateTime >();
|
|
|
|
|
currently i m using ASP.NET, with C# (.net 2005, 2.0 framework)
|
|
|
|
|
seeing as the OP actually stated that they were using the v2 framework, what's the point giving a solution using the 3.5 framework?
|
|
|
|
|
Sorry,I missed this point, or the OP added it as an edit.
|
|
|
|
|
hspc wrote: .net 3.5 (VS 2008)
The asker clearly mentioned his version requirement when an unsolicited post was done.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
I would say the easiest way to do this is to put all your dates into an array and sort them. The default sort will order them oldest first and most recent last. here's some example code (writen in a console app for testing):
DateTime[] dts = new DateTime[4];
dts[0] = new DateTime(1987, 10, 23);
dts[1] = new DateTime(2000, 11, 7);
dts[2] = new DateTime(2008, 2, 2);
dts[3] = new DateTime(2008, 1, 2);
Console.WriteLine("Before Sort");
foreach (DateTime dt in dts)
Console.WriteLine(dt);
Array.Sort<datetime>(dts);
Console.WriteLine("After sort");
foreach (DateTime dt in dts)
Console.WriteLine(dt);
Console.WriteLine("Most recent date: {0}",dts[dts.Length - 1]);
Console.ReadLine();</datetime>
Now, if they happen to be an a List, the code is pretty similar. If you want to sort them a different way Array.Sort can take a second parameter which allows you to specify how the sorting takes place. Check the docs for more info.
|
|
|
|
|
|
Hai vasudevan deepak kumar..... this is only to compare two dates . i want to compare 3 or 4 or 5 dates?
|
|
|
|
|
I am working on an ASP.NET web application. It uses a dll file as reference. I updated and rebuilt the dll file. However I found the web application is still using the old dll. I removed the reference and add the reference in again. It won't solve the problem. I also uninstall the dll from GAC, and add the new dll into GAC. However, the web application is still using the old one. I am very sure about that. Because my commmented out method is still getting called. The dll is updated. I used the windows console application to call the dll. It is working. So the dll is updated.
I have been working on this issue for whole night and am so confused now.
How can I make the web application using the updated dll.
I am using VS 2008. The web site is not precompiled one.
Thank you so much for your consideration. Please help me out...
Best regards,
Bin
|
|
|
|
|
OK are you running this on a web server or local machine?
|
|
|
|
|
Can a iisreset help?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
u r attempting to add a class to asp.net application , for a class to be generally consumable to ur site , it should be placed inside the app_code folder , would u like to place the class in the app_code folder
Why it is recommended?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
not sure why
But I tend to have my class files in the main folder next to my aspx files
Then any common method files I put in the app_code folder
|
|
|
|
|
It is not compulsory to put class file in app_code folder.
You can put it anywhere in your project but it is better you put it in app_code foler because its easy for you to access thls file in project.
if you put class file outisde the folder and when u r trying to access it in codebehind it throw error "Compilation error as it no longer recognize ur class in CodeBehind"
Hope this help..
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Sonia Gupta wrote: would u like to place the class in the app_code folder
I used to create separate projects for keeping my classes and refer that projects dll in ASP.NET application. I used to keep classes inside app_code folder too as it's a recommended practice since .NET 2.0. There are many advantages for keeping class in app_code, few of them are
1 - All pages in your application can access the classes in app_code
2 - All the classes in app_code are compiled into a single assembly.
|
|
|
|
|
|
Hi,
we have Image stream with hexadecimal values.
0xFFD8FFE000104A46494600010101
Now we need to convert it to asp.net image (System.Web.UI.WebControls.Image) ?
can any one assit for that?
|
|
|
|
|
pubududilena wrote: we have Image stream with hexadecimal values
Is it a hexadecimal string or a byte array?
*jaans
|
|
|
|
|
thanks for reply.
It is a hexadecimal string. It is comming with xml files. So we need to convert hexadecimal string to a Image to show on the asp.net web page.
|
|
|
|
|
You cant convert it to asp:Image , but you can display it to the user
1. Convert the hex string to a byte array by the help of HexEncoding class available in this article[^]
2. Display this data either using BinaryWrite method of Response class or HttpHandlers[^]
*jaans
|
|
|
|
|
Hello,
I have a doubt in Web TabStrip User Control Posted by jqd2001.
There is Main tab and subtabs.He was written raise event for subtabs only.I need to raise events for Main tabs also.How this is possible.?Anybody having idea please help me.
Following is the link for article.
http://www.codeproject.com/KB/user-controls/WebTabStripUserControl.aspx?fid=94911&fr=51#xx0xx
Regards,
Bijesh
|
|
|
|
|
Hello....
I have two DropdownList. and i want to bind second dropdownList on change event of First DropdownList from Database.and value fetch in both dropdownList from DataBase. But Without page Refresh or without autopostback true.
just like http://www.magicbricks.com/property/faces/jsp/user/loginMagic.jsp[^] on Property Search. when select state then bind value in City. without page refresh.
Please Reply me.....
modified on Friday, May 2, 2008 3:36 AM
|
|
|
|
|
The page you describe above is a Java Server Page (JSP)
The refresh is because the code is ran at server side and then posts back
AJAX does not refresh so maybe try that, the cascading drop down you want to look at
http://www.asp.net/ajax/ajaxcontroltoolkit/samples/CascadingDropDown/CascadingDropDown.aspx
|
|
|
|