|
Antennista Televes wrote: query.Add("SELECT ID, matricola, disegno, descrizione, nodeid, result, coppia, angolo, prgnr, prgname, date, NomeFile, lastcmd, laststeprow, laststepcolumn, qualitycode, rootobj_ID FROM dbo.Channels where rootobj_ID IN (" + string.Join(",", array_id[i]) + ") ORDER BY ID");
Don't do it like that!
Your code is almost certainly vulnerable to SQL Injection[^]. NEVER use string concatenation/interpolation to build a SQL query. ALWAYS use a parameterized query.
Everything you wanted to know about SQL injection (but were afraid to ask) | Troy Hunt[^]
How can I explain SQL injection without technical jargon? | Information Security Stack Exchange[^]
Query Parameterization Cheat Sheet | OWASP[^]
Beyond that, your question is not clear. Your code mentions Entity Framework, but you seem to be using a method from Dapper[^]. You haven't explained what array_id contains. You haven't explained why you're loading an array of List<T> instances. And you don't appear to have profiled your code to find out which part is slow.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You've got dates and names in your query; and no grouping / summing or range checking.
It's basically a "data dump" and not a meaningful query in any sense of the word.
You need to ask yourself at some point: Why am I running this query? Why am I not using a stored procedure?
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I wish to write a program like Quicken, only better. I am having trouble finding a control that looks like a check register. Does anyone know of such an animal?
Thanks in advance!
|
|
|
|
|
What the heck is a "check register"? Without using Quicken - which I don't - we have no idea what you are after.
And to be honest, copying the "look and feel" of an app but making it "only better" is probably not a good idea - it's asking for corporate lawyers to start writing you some very unpleasant letters ... in much the same way that coming out with a new soft drink in a red can called "Caca Cola" would .
I'd suggest that you think about what the original does well, work out ways that can be done better, and then design your own unique UI to makes the whole task easier for the user - then start designing the new app.
"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!
|
|
|
|
|
For such a specialized application, you're most likely not going to find such an animal.
You'll probably have to write your own control for that.
|
|
|
|
|
I am wondering if someone or some company already has. I do not know how to write a control, and I really don't want to take the time to learn it right now.
I thank you very much for your input! 
|
|
|
|
|
It would benefit you greatly to learn how to write controls. This will come up a lot more often then you think.
|
|
|
|
|
Quote: I do not know how to write a control, and I really don't want to take the time to learn it right now.
So ... your app is going to be largely bits of stuff you don't understand slammed together with a lot of "I hope it works" glue?
When something goes wrong, how do you propose to work out where the problem is, let alone how to fix it?
"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!
|
|
|
|
|
"Check Register" is an "application"; and more than just one control. It includes check runs / printing and bank reconciliation. Controls are building blocks; views are composed of controls. One "view" might be outstanding checks; one aspect of a check register (which is starting to look like the infamous "data grid").
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
That's just it. I need a datagridview-like thing. I tried using datagridview, but it has too many bugs, and is too hard to understand. I can take care of all of the data manipulation. It's just the GUI that I am struggling with now.
|
|
|
|
|
Member 15750670 wrote: I tried using datagridview, but it has too many bugs
Like what? I've been using it for well over a decade and it hasn't shown any bugs in all that time.
Member 15750670 wrote: I tried using datagridview ... is too hard to understand
I suspect that the "bugs" comment and this are related by a common factor: you don't know how to use a DataGridView.
Maybe this wold help: C# DataGridView Tutorial[^]
"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!
|
|
|
|
|
Yes, part of it is exactly that: I don't know how to use a DataGridView. I have not found enough examples (that's how *I* learn). I DID find (and document) some squirrelly behavior in one program that I have since discarded.
|
|
|
|
|
Member 15750670 wrote: I have not found enough examples (that's how *I* learn)
Then stop trying to learn like that: you don't learn properly by looking at existing code because code doesn't tell you *why* it is like it is: what was tried, what was rejected, why was it rejected.
Development isn't a "memory exercise" like learning a language, or chemistry, or biology - it's a skill, and the only way to learn a skill is to think and try. You can watch as much of the Tour de France as you like, it won't teach you to ride a bicycle!
"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!
|
|
|
|
|
I don't need to know "why" until I can get it to work the way I want. My goals are clear. I am an accomplished mainframe professional. I learned most of what I know from examples, not by poring through reams of unintelligible documentation. Now I am embarking on a hobby of learning C# and .Net. I appreciate the advice of people who have been there.
You are wrong. Watching the Tour de France can give you a lot of insight to riding a bicycle in a crowd. I believe you are a little narrow-minded to think that everyone learns the way you do (or did).
How is step 1. Why is step 2.
Thanks for your input.
|
|
|
|
|
And that's why you have problems getting stuff to work.
When you have kids, expose them to loads of Tour de France, then put them on their first bike - no training wheels needed! - and let them cycle away down the hill.
Have an ambulance on call.
"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!
|
|
|
|
|
Member 15750670 wrote: I am an accomplished mainframe professional Wow mainframe work must be lot simpler than what we do then! So if you cannot find a "control" that does exactly what you want then get a good book (most people ask for recommendations here) and work through the relevant examples customising it to meet your requirements.
You don't need to go through "ream of documentation" but you will need to understand the details of the datagridview is you are going to get a good looking and functional result. Do the work!
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I didn't think there was going to be so much condescending commentary out here.
Mainframe work is NOT simpler. It's the same, just a different environment and a different language.
I have done LOTS of research for a "good book". They don't exist. I have spent hours going through online searches. There is lots of beginner-level stuff, but nothing to assist me.
My motto is "work smarter, not harder". None of this is from the lack of "doing the work". I have not found enough examples. I have not found enough mentors who are willing to ASSIST instead of SCOLD, especially here. It's really easy to sit up there and spout general instructions. If you have something specific and useful to contribute, then it's welcome. Otherwise, please keep your remarks to yourself; they are not appreciated.
|
|
|
|
|
Your "my way or the highway" attitude is what's condescending. People were trying to help, but you reject it as not up to par.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Member 15750670 wrote: I don't need to know "why" until I can get it to work the way I want
If you don't understand the "why" behind the functionality, how are you going to "get it to work"? The only way that can happen is if you guess and get it correct, and that will almost never happen on the first try.
|
|
|
|
|
"Why" sometimes takes a lot longer to figure out than following a good example, trying it out, and seeing if it works. I have used that technique many times. I would love to know the "why" every time, but oftentimes, you don't have the luxury of the time to study that. You're right about not getting right on the first try, especially if the example is too general. That is where tenacity comes in. 
|
|
|
|
|
I used to think like you, way back in the day. I'm entirely self-taught. Eventually, you, like I, will find out that "trying stuff is faster" is actually false. You may find code that works for what you want, you'll even figure out how it works, but you will not figure out the WHY behind the code. You'll also miss the limitations and design considerations that went into the "why".
All that missing information is what is going to make your "find, copy, paste" approach take much longer than you think it does now.
|
|
|
|
|
Member 15750670 wrote: I don't know how to use a DataGridView. I have not found enough examples There are lots of good examples here on CodeProject: Search: DataGridView[^].
|
|
|
|
|
If you can't write the control, how do you expect to create an application that is "like Quicken, only better"?
|
|
|
|
|
I'd like to know what his "new app" is going to be called - just so I can avoid it.
Would you trust your money to somebody who wants to swap one control he doesn't know how to use for another he still doesn't know how to use, and expects it to work exactly how he wants it to right out of the box?
"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!
|
|
|
|
|
Maybe he works for Microsoft, or TSB. 
|
|
|
|