|
Mou_kol wrote: i saw these post Is it possible to Pivot data using LINQ? Prolly is, but why move that to the client in the first place?
Why do you prefer to hold a dataset in memory, when it is more efficient on the server?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
SQL server taking long time to return result set and we have network problem. also we do not have a DBA. using my knowledge i am not being able to suppress the issue. so decided to move the whole part in c#. so please guide me how to achieve it in c# alone. thanks
|
|
|
|
|
Mou_kol wrote: SQL server taking long time to return result set and we have network problem. also we do not have a DBA You missing DBA is prolly reason why it takes that time.
Mou_kol wrote: using my knowledge i am not being able to suppress the issue Welcome to my world.
Mou_kol wrote: so decided to move the whole part in c# Without knowing if that would improve anything?
Mou_kol wrote: so please guide me how to achieve it in c# alone. thanks No. Ethics. Not going to reccomend you wrong because you ask/want/need it.
Get someone who knows databases. Profit that way.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Your answer to meeting a deficiency is to ignore it and pursue a less efficient alternative.
(You can look at it as a question or a statement).
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Damn. You brutal
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Existentialism.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
This could mean anything. When you say that SQL Server is taking a long time to return the result set, you have left a wide open area here. Does the pivot table take a long time to create on the server? Is it returning a massive amount of data? Has anyone run a profiling session on the pivot operation to see if you are doing sequential scans? Doing an analysis in SQL Server does not need a DBA - the developers should be able to pick this up.
In reality, I doubt you could build a pivot that would work as quickly as the SQL Server implementation which is heavily optimised. In order to pivot, you would have to pull all of the data back from the server then write your own code to transform the data, applying aggregation operations yourself, so you will need to potentially drag back large amounts of data.
My advice - profile the PIVOT operation.
|
|
|
|
|
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hello,
I am teaching myself xaml and C# and have a question which is probably trivial but I cannot find a resource that is pointing me in the correct direction. If I have a simple app with a copy button, a textblock and a textbox is there a way to bind the textblock text to the entered textbox text? In other words the textblock text is predefined and will not change, once the user enters something in the textbox and hits copy the string copies to the clipboard with the textblock text and the entered textbox text i.e.:
What is your age:(this is the textblock static text) 14 years old (entered text in textbox)
<Grid>
<Button x:Name="button" Content="Copy" HorizontalAlignment="Left" Height="39" Margin="10,10,0,0" VerticalAlignment="Top" Width="110"/>
<Grid HorizontalAlignment="Left" Height="287" Margin="138,10,0,0" VerticalAlignment="Top" Width="370">
<TextBlock x:Name="textBlock" HorizontalAlignment="Left" Height="22" Margin="10,10,0,0" TextWrapping="Wrap" Text="Enter your age:" VerticalAlignment="Top" Width="87"/>
<TextBox x:Name="textBox" HorizontalAlignment="Left" Height="22" Margin="113,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="247"/>
</Grid>
</Grid>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void button_Click(object sender, RoutedEventArgs e)
{
}
}
|
|
|
|
|
private void button_Click(object sender, RoutedEventArgs e) {
string s = textblock.Text + " " + textbox.Text;
Clipboard.SetText( s );
}
(I'd pick better "names" for my controls).
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Hello all,
I have a client project that I was working on for around 6 months and my HDD got infected with ransomware and I lost all the data.
I have the last debug version and I want help to decompile it and recreate the project
I tried .net Reflector and Jetbrains Dotpeek but I don't know how to use any of them I can see the code but can't recreate the full project.
the project debug is uploaded at github here: https://github.com/ahmedtsadek/Elmrkt-Inventory-Tool/raw/main/Debug24-04-2021V2.rar
If anyone can help please contact me asap 
|
|
|
|
|
First off, restore from your latest backup - it's always the best way. you can then re-implement any changes you made since then.
While decompilation can regenerate code from a compiled EXE, it won't be exactly what you had, and if it's only the release version you can access then it may be useless to you - if you use an obfuscation tool when you created it then it's going to be pretty useless by design. Regardless, the production version will not contain any comments and may be very different to your original source due to optimisations.
Some tools can generate project and solution files for you: ReflectorFileDisassembler[^] but I've never used them.
Basically, restoring from the backup is the best way. You do take regular backups, don't you?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
If you can't rebuild a one-man (6 month) project in a day or two, having recovered the source code, then it wasn't "your" project in the first place.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
What's wrong with you, didn't you see it's urgent?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
nice words instead of helping or motivating u just here to hurt by ur words
|
|
|
|
|
Well, that was 5 hours ago; time you could have used to rebuild. New project; add item(s).
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
List<string> periods = new List<string>();
periods.Add("2010 FYA");
periods.Add("2011 FYA");
periods.Add("2012 FYA");
periods.Add("2013 FYA");
periods.Add("1Q 2014A");
periods.Add("2Q 2014A");
periods.Add("3Q 2014A");
periods.Add("4Q 2014A");
periods.Add("2014 FYA");
var xx = periods.Where(a => a.ToString() == "2010 FYA" && a.ToString() == "3Q 2014A").ToList();
IN LINQ there is no any between operator. so tell me how to use LINQ to extract data between two period.
i need to extract all data from period 2010 FYA to 3Q 2014A using LINQ. please show me how to achieve with LINQ. thanks
|
|
|
|
|
You will need to convert your "date strings" to actual DateTime values - which won't be trivial, given they don't appear to have a consistent format and that means it's likely there are a lot of "oddities" in there - then you can use
.Where( d => d >= startdate && d <= endDate); But you will get absolutely nowhere trying to process them as strings: they are always sorted by the first character difference encountered in the two strings being compared.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Where(a => a.ToString() == "2010 FYA" && a.ToString() == "3Q 2014A")
The item in question cannot be equal to both of those literal strings. It can only be one or the other. And you should not need to call ToString on an item that is already a string:
Where(a => a == "2010 FYA" || a == "3Q 2014A")
|
|
|
|
|
i have to put a condition in where clause as a result all periods between two periods will be fetched....how to achieve with LINQ ?
|
|
|
|
|
You need to convert all those strings to proper Date values as suggested by @OriginalGriff earlier. As it stands there is no way to do such a comparison with them.
|
|
|
|
|
Bogus data. Your DBA should be retired.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I'm with Gerry on this, garbage data in the database. I would add another field to the table and convert the garbage to datetime values ON THE WAY IN. Use the garbage for display only.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I have done the job this way and it worked.
int startIndex = periods.IndexOf("2011 FYA");
int endIndex = periods.IndexOf("3Q 2014A");
var anybetween = periods.Skip(startIndex).Take(((endIndex - startIndex) + 1)).ToList();
|
|
|
|