16,022,536 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Greysontyrus (Top 17 by date)
Greysontyrus
7-Feb-13 11:03am
View
This answer does not relate to the question. That is exactly what sukumari1 doesn't want to do
Greysontyrus
7-Feb-13 6:21am
View
Please post the code showing how you are populating the dropdownlist.
Thanks
Greysontyrus
21-Nov-12 8:56am
View
ManojDhobale: "I am looking for LINQ sort of code, instead of for/foreach loops" was in in the question but your solution is sound ^_^
Greysontyrus
19-Nov-12 12:00pm
View
Actually I have a kinda solution. Bit of a cludge as I would like to execute a 'slimmer' query, but it works.
I waited for your reply before posting the solution
Greysontyrus
19-Nov-12 5:57am
View
That would be my answer You wouldn't want the total to appear for each anon type in the array anyway. It would be calculated each time if it were possible.
Rather than gathering the days into an array, just so you can use the linq Sum(), it would be better to simply add them (j.day1+j.day2+...+j.dayn) as that would be executed in the SQL.
Greysontyrus
19-Nov-12 5:09am
View
Thanks BobJanova, It appears that you have identified the problem but you have not offered any solution so I wonder why you have posted it as such. I feel that this would make a good comment, one that I would even edit into by question, but I cannot accept it as a solution. As the post now appears to have a solution to the casual 'Authority' poster the number of views has remained nearly constant ever since. Is there a way that you can re-organise this post as a comment instead?
Thanks ^_^
Greysontyrus
15-Nov-12 5:58am
View
I'd rate that as an answer, digimanus
Greysontyrus
12-Oct-12 5:42am
View
Please use the reply button on the comment. That way the conversation is easy to track and I get a note letting me know that you've replied ^_^
To update a record you have to change the record you got back from the data context, not a new instance. I think what you need is:
foreach(industries ind in indList){
ind.workfor_id = Convert.ToInt16(k.id);
ind.workfor_industry_id = Convert.ToInt16(k.industryid);
}
dbContext.SubmitChanges();
or am I getting the wrong end of the stick?
Greysontyrus
11-Oct-12 4:21am
View
It looks like you're taking a csv list in 'industryParts' and are creating new 'industries' instances for each item in the csv. First, without anything else within that 'for' loop, you are losing every instance of 'ind' apart from the last. Second, each instance 'ind' is identical.
Q: where are you expecting this update to take place? Is this the whole code?
Greysontyrus
11-Oct-12 4:12am
View
Thank you very much ^_^
I'll have to wait for another lock to try these out.
Greysontyrus
10-Oct-12 10:25am
View
There is now. Just had another incident with a different query but still included Event_log and Package. I've killed the process but kept a copy of the two tables you spoke of. What am I looking for here?
Greysontyrus
10-Oct-12 5:53am
View
The problem there is that if the query is regarding a large volume of data then that data has to be transported raw from the database to the web server and back again. MicroSoft have decided that developers don't know what they are doing so they have restricted us from writing elegant insert queries in Linq in 4.0. Thanks MicroSoft for changing my nappy >_<
Greysontyrus
10-Oct-12 5:46am
View
A sound suggestion but the fact that SQL has no idea that anything is wrong means that the issue will not stand out. This wouldn't be much of an issue if not for the volume of traffic. The database in question receives around 5000 or more transaction per minute which does not abate overnight.
The most puzzling thing is that the db is set up for row locks, not page locks. I have had to avoid any page locks due to the volume of traffic.
Thanks for the response ^_^
Greysontyrus
10-Oct-12 5:08am
View
Could we have a few rows (or the whole) of the input file please.
Whenever I see items[#] where # is hard coded I always shudder. The message says that there is a line that has less than 4 elements in a 'item'
You can confirm this by testing the file with your code but replacing the t1 linq to:
var t1 = lines
.Where(l => !l.StartsWith("#"))
.Where(l => l.Split(' ').Length < 4);
.Select(l => "'" + l.Replace(" ", "' '") + "'");
the Console.WriteLine(t); with then print any rows that causes an error in quotes so you can see each line and item as the lamba see it. You may find that a row is missing some ' 's so the .Split(' ') is failing to find 4 seperate elements
Greysontyrus
19-Sep-12 11:22am
View
The error message and question have changed
Greysontyrus
19-Sep-12 10:46am
View
Thx Andrei ^_^
Greysontyrus
19-Sep-12 10:28am
View
Deleted
partial class DecoPlatform
{
public static IQueryable<decoplatform> Query
(
CarmaContext db = null
)
{
if (db == null)
db = new CarmaContext();
return db.DecoPlatforms;
}
public static IQueryable<decoplatform> QueryByDecoId
(
int decoId,
CarmaContext db = null
)
{
if (db == null)
db = new CarmaContext();
return Query(db).Where(dp => dp.deco_id == decoId);
}
}
Show More