|
You don't seem to be joining the two tables, so try this:
SELECT TOP 1 Count(*) AS Expr1, ScrapCodeID
FROM ScrapCodes
INNER JOIN Repairs ON ScrapCodes.ID = Repairs.ScrapCodeID
WHERE FailureCode = 13
GROUP BY Repairs.ScrapCodeID
ORDER BY Count(*) DESC;
The Scrap Codes to Repairs tables above assume a one-to-many relationship - I presume that is what you have.
It’s not because things are difficult that we do not dare, it’s because we do not dare that things are difficult. ~Seneca
|
|
|
|
|
I could give this a try. But I have other fields in the Repairs table which are linked to other tables (the "Failure Code" field, for example, links to the table "Failure Codes"). And I can work with that data without any issue.
I'm not very strong at all on JOIN's yet. It's a subject which I have been reading a lot into lately though.
|
|
|
|
|
|
It is customary and courteous to use a clicky link when posting a URL so people don't have copy and paste the URL, which most will not do and thus you will not receive any positive responses.
Please edit your post and use the link[^] toolbar item.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
It's a command line interface, so you can start the program with Process.Start and talk to it through its redirected stdin/stdout streams (they are available from Process). Obviously to do that it needs to be on the same machine as you are – if it is a *nix-only app then that will mean you will have to run your C# app under Mono.
I didn't investigate in any detail but assuming the app has a sensible command line interface you should be able to write code to talk to it.
|
|
|
|
|
Hi, thank you for the response.
Which program would I want to start, a bash client, in a hidden window?
I will be local on the box, they link gives command lines to return values, but the unix portion of it is what has me confused.
|
|
|
|
|
If it is a tool which takes a command line, executes and closes, then for each 'command' you should start a new process, with the command line you want to send, and capture the output. You can do that with Process.Start (set the ProcessStartInfo up to redirect the console streams). The fact it's on Unix shouldn't matter as long as Mono supports that part of the framework, and I'd be astonished if it doesn't.
|
|
|
|
|
|
I'm not sure, I will have to see if that is possible.
It is a Unix/Solaris SAN server connected to a fiber card of the windows server.
|
|
|
|
|
Hi,
I have a string with the format yyyymmdd.
I'm trying to convert it to date time by DateTime.Parse(myString),
but i'm getting an error.
How can i convert it?
|
|
|
|
|
DateTime.ParseExact("20011215", "yyyyMMdd"); //note the capital M's
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: DateTime.ParseExact("20011215", "yyyyMMdd"); //note the capital M's
What about the IFormatProvider at the constructor?
There is no constructor at the ParseExact that takes 2 parameters
modified on Wednesday, June 15, 2011 3:37 PM
|
|
|
|
|
DateTime d = DateTime.ParseExact("20011215", "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
|
|
|
|
|
10x
|
|
|
|
|
In addition to the other answers, there is also Convert.ToDateTime(something)
Always nice to know different methods of doing something.
|
|
|
|
|
That would not help in this case.
|
|
|
|
|
Probably not, but I don't know all the possible Culture formats available. There might be one out there who decided to use sensible dates.
|
|
|
|
|
1. What is the error it gives you
2. Use the TryParseExact function.
3. Read up on MSDN for the format string options[^]
Hope this helps.
V.
|
|
|
|
|
I have Invoice entity wich I change and then add InvoiceRows and then I want to cancel the whole operation.
What is the easiest way of doing this?
I can use Context.refresh() to get a fresh copy of my Entity but is this really the way to do it?
//h
|
|
|
|
|
I would use Context.Refresh(RefreshMode.StoreWins, obj) as my "Plan B".
My "Plan A" would be keeping changes outside of Context until they are ready to be committed, and then apply and commit them in an atomic operation. This requires more work as you need to track the state of newly added entities, but I think it is worth it, because the approach is cleaner overall.
|
|
|
|
|
Transaction. I've not worked with them with Entity Framework myself, but that seems like what you want.
|
|
|
|
|
Hi experts,
there is a PropertyGrid in my application. It shows properties of an object. Some of these properties can hold values that are illegal to business logic. Those values show a warning symbol by using a custom TypeEditor. Mentioned properties are marked by an attribute.
Some of the properties are even linked. Business logic decides whether or not a combination of linked properties is illegal.
To this point all is fine.
Now the PropertyGrid has to show properties of multiple objects and the warning symbols don't work any longer.
This method should tell whether a property can, depending on its value, warn by setting the symbol
public override bool GetPaintValueSupported(System.ComponentModel.ITypeDescriptorContext context)
{
if (
context.PropertyDescriptor.PropertyType.IsEnum
&& Enum.IsDefined(context.PropertyDescriptor.PropertyType, "Invalid")
)
return(true);
foreach(Attribute attribute in context.PropertyDescriptor.Attributes)
if(attribute is WarnableAttribute)
return(true);
return (false);
}
The marked line fails for multiple objects.context.PropertyDescriptor is a PropertyGridInternal.MergePropertyDescriptor , which is not accessible due to access levels.
How could I test for an icon to be painted?
Edit: It's working now thanks to ITypeDescriptorContext containing an object called instance , which is an Array when selecting multiple objects.
Knowing that, it's possible to check for attributes with some reflection.
Ciao,
luker
modified on Friday, June 17, 2011 3:19 AM
|
|
|
|
|
Environment – VS2010, Window 7;iis7.0
We have created a Web service (EDI_Translate) and we are consuming this webservice in C# console application. This console application calls the web service in a loop continuously in different thread. The web server handles the request sequentially (like first in first out) but we want web server to handle the request parallely to boost the performance. What should be done in webservice code or web server in order to handle the request paralley by webservice code .
Ramesh Kumar Singh
Software Engineer
Ness Technologies
India
|
|
|
|
|
Without knowing anything at all about what the webservice actually does or how it does it how do you expect anyone to accurately answer this?
I know the language. I've read a book. - _Madmatt
|
|
|
|