16,019,018 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 Visual Basic questions
View Javascript questions
View .NET 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 CLilium (Top 10 by date)
CLilium
13-Feb-15 8:23am
View
Sorry, I should have worded it better. I understand that you will have to use strings to call certain methods, but my point it whenever there is better way than using reflection.
I know there is switch/case approach, which I think is safer and a bit faster, but ugly and probably harder to extend. While reflection is a bit slower, elegant, but can cause exceptions if the input is wrong.
I'm just wondering which one is better or whenever there is new better approach to this.
CLilium
13-Feb-15 7:16am
View
Even though this answer is right concerning the question, shouldn't such approach be avoided? I believe there is definitely better way of doing this than using strings.
CLilium
13-Feb-15 3:38am
View
Deleted
Can you be more specific?
CLilium
9-Feb-15 4:10am
View
Wrong, read what is in first link Kenneth Haugland posted, you are using OR operator, if either of the conditions is true, then the result is true, so if your first conditions is true (not false as you mentioned) it doesn't need to check the other one, because it already knows the result.
If you need both conditions to be true to show the message you have to use AND operator, posted as 2nd link.
Other than that I don't know why you bind textbox1 and checkbox1 to that button1 event funtion, but if there is still something wrong just say it, don't know if you solved everything you needed.
CLilium
6-Jan-15 8:27am
View
Your echo "</table>"; is out of while statement, so you are making table within table within table. Also your <form> and </form> are in wrong order I think they should be both outside of <table></table> (they might be inside, but I'm not sure if it's correct way). Lastly please if you have some sense regarding web making, make all css in external file and actually use it instead of <center> for example.
If it doesn't help report back with following:
Did you check page source of the generated page for the value and did you check your data in your DB? If everything is fine, can you try to display the value just as a plain text to see whenever it's caused by <input>?
CLilium
5-Jan-15 9:22am
View
I had experience with data mapping so it's possible OP's case could actually contain integer or short, if you are right and it returns only objects then yes, I guess it will fail everytime if equals also compares types.
CLilium
5-Jan-15 8:34am
View
Can you check and report back your type of dtData.Rows[0]["Column1"], either by debuging or GetType? This is quite important.
As you mentioned in comments above if your column is tinyint, it's most likely cast to short, can you try this:
if(dtData.Rows[0]["Column1"].Equals((short)1))
I have no way to actually check it, but it might be possible that byte equals short might return true as they are same lenght bitwise, I'll be able to check this after few hours if still needed.
CLilium
5-Jan-15 7:20am
View
Well, 1 is integer, "1" is string.
If you meant to ask how datatype of a column is determined it depends on datatype of a column of a database you take from, I have't done this for a while so I can't give you accurate answer, sorry, it depends on how you do it in your case.
CLilium
5-Jan-15 7:12am
View
I think your datetype of column is not string, that's why when you cast it to string and compare it works, but without the cast it doesn't.
CLilium
30-Dec-14 9:22am
View
If you are just calling and event to log to the file it would be better to make a logger class for this job. Once you have just make a private property for counting and add it into the input. As far as I know there is no auto identity in c# like in DBs.
Show More