ADO.NET DataRow - check for column existence
The accepted answer is factually incorrect; one can simply call
row.Table.Columns.Contains(name);
What should be done?
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.
Sign up to join this communityADO.NET DataRow - check for column existence
The accepted answer is factually incorrect; one can simply call
row.Table.Columns.Contains(name);
What should be done?
Your options are:
As a moderator:
format c:
)Here is a list of similar questions (questions that have accepted negatively scoring answers)
This topic has been covered quite extensively; though I am not sure it is quite resolved. See:
* This is a joke. Meta shouldn't be used to target specific posts or users. For more information, see this question
Downvote the answer?
(This is mostly a response to waffles.) So, wait... I hate wrong accepted answers as much as the next guy, but I thought that awarding the checkmark was the asker's privilege. If it's going to be "the asker's privilege unless a bunch of people in comments and/or on MSO agree that it's wrong," then where do you draw the line? What if a lot of people complain, but there are people supporting the OP, too?
I'm not against changing truly terrible accepted answer marks, but we should have some sort of system in place for it. Doing it on an ad-hoc basis will eventually cause more problems than it solves.
Also... here's another one.
Post a bounty to attract more attention. Hopefully this bounty will draw at least one better answer (if one hasn't been contributed yet).
Then award the bounty to a better answer.
(I haven't made up my mind what I think about this yet; I'm posting this here since it's the solution I've picked up through SE folklore, and I was surprised not to find this option posted here yet.)
? true : false
doesn't cause any real problems. Why would you call it "blatantly wrong"? It works, doesn't it, silly and superfluous as it may be.