Click here to Skip to main content
15,560,073 members
Home / Discussions / C#
   

C#

 
GeneralRe: Changing Windows registry with C# Pin
Ismael_19998-Sep-22 14:00
Ismael_19998-Sep-22 14:00 
GeneralRe: Changing Windows registry with C# Pin
Dave Kreskowiak8-Sep-22 15:02
mveDave Kreskowiak8-Sep-22 15:02 
AnswerRe: Changing Windows registry with C# Pin
Eddy Vluggen6-Sep-22 6:17
professionalEddy Vluggen6-Sep-22 6:17 
GeneralRe: Changing Windows registry with C# Pin
Ismael_19996-Sep-22 11:22
Ismael_19996-Sep-22 11:22 
GeneralRe: Changing Windows registry with C# Pin
Eddy Vluggen6-Sep-22 11:47
professionalEddy Vluggen6-Sep-22 11:47 
QuestionVery slow deeper queries Pin
Antennista Televes30-Aug-22 3:57
Antennista Televes30-Aug-22 3:57 
AnswerRe: Very slow deeper queries Pin
OriginalGriff30-Aug-22 6:05
mveOriginalGriff30-Aug-22 6:05 
SuggestionRe: Very slow deeper queries Pin
Richard Deeming30-Aug-22 6:08
mveRichard Deeming30-Aug-22 6:08 
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

AnswerRe: Very slow deeper queries Pin
Gerry Schmitz30-Aug-22 6:22
mveGerry Schmitz30-Aug-22 6:22 
QuestionCheck Register Control Pin
Member 1575067028-Aug-22 18:54
Member 1575067028-Aug-22 18:54 
AnswerRe: Check Register Control Pin
OriginalGriff28-Aug-22 20:55
mveOriginalGriff28-Aug-22 20:55 
AnswerRe: Check Register Control Pin
Dave Kreskowiak29-Aug-22 5:48
mveDave Kreskowiak29-Aug-22 5:48 
GeneralRe: Check Register Control Pin
Member 1575067029-Aug-22 7:58
Member 1575067029-Aug-22 7:58 
GeneralRe: Check Register Control Pin
Dave Kreskowiak29-Aug-22 8:14
mveDave Kreskowiak29-Aug-22 8:14 
GeneralRe: Check Register Control Pin
OriginalGriff29-Aug-22 8:55
mveOriginalGriff29-Aug-22 8:55 
AnswerRe: Check Register Control Pin
Gerry Schmitz29-Aug-22 9:02
mveGerry Schmitz29-Aug-22 9:02 
GeneralRe: Check Register Control Pin
Member 1575067029-Aug-22 11:29
Member 1575067029-Aug-22 11:29 
GeneralRe: Check Register Control Pin
OriginalGriff30-Aug-22 1:30
mveOriginalGriff30-Aug-22 1:30 
GeneralRe: Check Register Control Pin
Member 1575067030-Aug-22 2:52
Member 1575067030-Aug-22 2:52 
GeneralRe: Check Register Control Pin
OriginalGriff30-Aug-22 3:14
mveOriginalGriff30-Aug-22 3:14 
GeneralRe: Check Register Control Pin
Member 1575067030-Aug-22 4:40
Member 1575067030-Aug-22 4:40 
GeneralRe: Check Register Control Pin
OriginalGriff30-Aug-22 4:42
mveOriginalGriff30-Aug-22 4:42 
GeneralRe: Check Register Control Pin
Mycroft Holmes30-Aug-22 13:54
professionalMycroft Holmes30-Aug-22 13:54 
GeneralRe: Check Register Control Pin
Member 1575067030-Aug-22 15:39
Member 1575067030-Aug-22 15:39 
GeneralRe: Check Register Control Pin
Richard Andrew x645-Sep-22 4:54
professionalRichard Andrew x645-Sep-22 4:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.