TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhilash J A
530
2.4k
600.5k
If list contain duplicate value then get total count - C#
Jan 1 2017 9:25 AM
Hello Everyone,
I have list items.
This 3 records contain images, that is image path from database. I want to get total size of the image group by
ArchievedName .
1st item,
2nd item,
3rd item,
I have tried,
List<Tble_Documents> objDocumentUserSetup =
new
List<Tble_Documents>();
bjDocumentUserSetup = objUserSetUp1.AsEnumerable().Select(m =>
new
Tble_Documents()
{
ArchievedName = m.ArchievedName,
UpdatedDate = m.UpdatedDate,
Fullname = m.Fullname,
FilePath = m.FilePath + m.Parent_File_Name +
"_"
+ m.Child_File_Name,
docCount = m.docCount,
FileSize = FormatBytes(
new
System.IO.FileInfo(m.FilePath + m.Parent_File_Name +
"_"
+ m.Child_File_Name).Length)
/*How can do here?*/
}).ToList();
private
static
string
FormatBytes(
long
bytes)
{
string
[] Suffix = {
"B"
,
"KB"
,
"MB"
,
"GB"
,
"TB"
};
int
i;
double
dblSByte = bytes;
for
(i = 0; i < Suffix.Length && bytes >= 1024; i++, bytes /= 1024)
{
dblSByte = bytes / 1024.0;
}
return
String.Format(
"{0:0.##} {1}"
, dblSByte, Suffix[i]);
}
Please help me.
Reply
Answers (
5
)
Crystal Report throwing Missing Parameter while PDF export
data table to another data table