15,886,518 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by jochance (Top 9 by date)
jochance
1-Feb-24 9:22am
View
We can be a terse and uninviting people.
We'll start "helping" leading off with, "As we expalined in your previous question on the same subject" and insist its simply giving advice.
If someone comes and says, "hey but you can't just run with appropriate types end to end here" we help those people by telling them they don't know databases.
I recall now why I mostly just avoid these sorts of discussions.
You weren't awful, I just thought it wasn't very nice.
jochance
1-Feb-24 9:03am
View
Hurr durr, yeah sure. Just because that's a concern also does not make it possible to just "use proper types" from the start.
I'll leave you alone though. Apparently it doesn't matter if it's a new programmer or an old one, you just like abusing them. :)
jochance
31-Jan-24 14:16pm
View
If you say so... "do not use strings for all your numeric, Date and Time values"
jochance
30-Jan-24 19:33pm
View
Unfortunately, you can't really set a type for a Text control so string->number conversion just has to happen. This looks like winforms/WPF.
jochance
30-Jan-24 19:26pm
View
GUIDs will almost definitely have less of a chance for collision than this snowflake thing.
"The odds of two GUIDs colliding are therefore one in 2¹²²" (from google)
Note that this is a larger value than the entirety of the 64bit int (long) range of possible values.
jochance
30-Jan-24 19:23pm
View
Yeah my ? to this ? is why does OP hate GUIDs?
jochance
30-Jan-24 19:17pm
View
textBoxCId.Text is not in the list of things you're checking to have values; it probably should be.
You should explore using a using() {} block for the connection object.
It's mostly OK how you have it but like PIEBALDconsult sort of mentioned... if you .Close() it 2x, then it will fail/throw. This code will always throw in the finally{} happy path scenario of all other lines executing.
Another bit I am going to throw out there is to be sure you're using Microsoft.Data.SqlClient instead of System.Data.SqlClient. It may not matter much for whatever this is, but it will matter eventually in something you do, and so adjusting for this now is a good idea.
jochance
30-Jan-24 18:31pm
View
Deleted
Sorry this probably should've been a comment not a solution.
jochance
30-Jan-24 18:31pm
View
Sorry this probably should've been a comment not a solution.
Show More