|
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();
|
|
|
|
|
That method depends on the text string and the sort order, the text string is going to change when they add/subtract a period and changing the order of the data totally screws up you query.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
"Q A" is not dates. "Between" should ignore it, and as intended it does.
Or as the others said, your database is crap. Learn normalization and you wont have these problems ever again. Or don't, is all the same to me.
Homework? Welcome, as long as you don't ask for a solution but a hand or hint. But given your history and your last slosh of questions; I'm not here to answer, but to make fun. You treating this board as a cheap source of labor which it isn't. If I work for you, you pay.
If you reply to my messages, you agree to pay for them. Any questions? (hahaha, you'd pay for them, if you would, including this one!)
I'll inform you of my rate after you reply.
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.
|
|
|
|
|
i have created sample small program to learn how to report progress from Async function but not getting expected result. here is my code. please tell me what is my mistake in the code.
i am trying to write in textbox from async function which is not working and also not throwing any error.
public async Task<int> Getdata(int i)
{
IProgress<string> progress = new Progress<string>(str =>
{
textBox1.Text = str;
});
await Task.Delay(90000);
progress.Report("Task completed "+i.ToString());
return 10;
}
private async void btnTask1_Click(object sender, EventArgs e)
{
List<Task<int>> tasks = new List<Task<int>>();
for (int i = 0; i < 5; i++)
{
tasks.Add(Getdata(i + 1));
}
var result = await Task.WhenAll(tasks);
}
|
|
|
|
|
You haven't described your expected result, nor told us what "not working" means.
Bear in mind your task will all complete at roughly the same time, 90 seconds after you start them. You will only notice a single update to the textbox.
It's generally better to avoid async void methods[^]. And I'd be inclined to create a single Progress<T> instance and pass it in to the Getdata method.
public async Task GetData(int i, IProgress<string> progress)
{
progress.Report($"Task created {i}");
await Task.Delay(60000 + i * 1000);
progress.Report($"Task completed {i}");
}
private async Task Run(IProgress<string> progress)
{
List<Task> tasks = new List<Task>();
for (int i = 0; i < 5; i++)
{
tasks.Add(GetData(i + 1, progress));
}
await Task.WhenAll(tasks);
}
private void btnTask1_Click(object sender, EventArgs e)
{
IProgress<string> progress = new Progress<string>(str => textBox1.Text = str);
_ = Run(progress);
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|