18

I just voted to close "How do you pull information from a datatable into a dropdownlist?" as too broad. It seemed to me that it was implicitly asking for a tutorial on data access in ASP.NET. Was I wrong about that?

17
  • 5
    You must be wrong, nobody downvoted it. Mar 4, 2015 at 19:53
  • 5
    @HansPassant: "nobody downvoted it" - yet. Mar 4, 2015 at 19:55
  • 2
    Somewhat borderline, in general OP seems well-intentioned. I often wonder if there were a more benign way of "closure" that simply says "hey this is incomplete, go do your HW" Mar 4, 2015 at 19:58
  • 11
    @Coffee: I sometimes wish we could take these people by the hand and give them the "clue" they need. But there are far too many of them to help like that. This OP and the tens of thousands like him need to make better use of local resources. And then come back here with more specific questions. Mar 4, 2015 at 20:00
  • 2
    @JohnSaunders I don't necessary support the accepted answer (I up-voted yours), but here's a reminder: Is “too broad” a valid reason to close a question that doesn't show any research effort? Mar 4, 2015 at 20:06
  • 17
    This question does not have a single well-defined solution. The answer to this question could be a small book "Beginning ASP.NET Data Access, Fifth Edition" Mar 4, 2015 at 20:18
  • 10
    I also wish there were some resources as high quality as SO that would help people who are completely new to a technology help them choose good approaches/tools. Some of the now disallowed "lists of things" questions were great for this. Online resources are a jumble of opinions with very few places where people come together to collectively express their experience, as we had in "lists of things" questions. There are things that sound great from reading articles and individual opinions(some being very strong and convincing) that in practice most people avoid for one reason or another.
    – AaronLS
    Mar 5, 2015 at 1:02
  • 1
    @AaronLS: I think that a "How to Access Data in ASP.NET" canonical question would not be acceptable. I really don't know what else to do besides take the time to write some blog posts. Mar 5, 2015 at 1:21
  • 1
    @AaronLS but there is!
    – Braiam
    Mar 5, 2015 at 2:39
  • 1
    @Braiam: there are so many books listed there that I would be surprised to find they are all good. That seems like too much of a good thing. Mar 5, 2015 at 2:44
  • Well, some of them are actually wiki/git repositories that are formatted in chapters, so I think that if you find something factually wrong you can fix it rather easy. The ones that are not, the authors have emails where you can submit corrections. Granted, I didn't read every one of them, but that's my impression of the few I saw.
    – Braiam
    Mar 5, 2015 at 14:09
  • Although the title could be better, I think the user asked two specific questions: 1. how to access the MyDbConn1 connection string that I created in the web.config. 2. when the code goes into the source area (ASP.NET) versus when it goes on the actual page in VB.NET
    – Bolu
    Mar 5, 2015 at 16:56
  • @AaronLS There are sites like that, Pluralsight is one of them. Coursera is another. And most conferences I attend put videos out on youtube or vimeo. The web is packed with resources to help someone who are completely new to a technology. Why they can't find it is beyond me.
    – ivarni
    Mar 6, 2015 at 7:19
  • @ivarni You missed the point. I acknowledged that there were resources available. Very few represent collective experience though. Someone getting into ASP.NET will find articles on everything from classic ASP to Dynamic Data framework. I see a lot of articles that take an approach that is way out in left field or has a lot of flaws, but because it is not in a very strong community setting(such as SO) it isn't apparent to newcomers that it is a really unconventional and/or bad approach.
    – AaronLS
    Mar 6, 2015 at 16:27
  • 2
    @ivarni We can debate what resources are good quality and which aren't, but without a good community process that allows for open feedback the way SO does, it's hard for passer-bys to see what is and is not a good resource. If you are inexperienced with a technology then you can't gauge the quality of a resource. With SO I can look something up regarding a language I know little about, and see from comments on an answer whether there are pitfalls to the approach or not. I don't have to wonder, the same way I would if I got the resource from elsewhere.
    – AaronLS
    Mar 6, 2015 at 16:33

3 Answers 3

21

This could easily fall under too broad, but not because it requires too long of an answer, but because there are so many answers.

"How do I hook up my control to a database" can be done directly with ADO.NET (as in one of the answers), you can use a service layer, an ORM, etc.

I'm not sure the asker is actively looking for a tutorial (in the "resource recommendation" vein), but the question still has too broad a scope.

2
  • As I said in my question, "implicitly" asking for a tutorial. Or, at best, a survey "ways to access data in ASP.NET". Mar 4, 2015 at 19:55
  • @JohnSaunders I would agree with the second version :) Mar 4, 2015 at 20:00
35

I was the OP for that question. I wasn't asking for a tutorial, but like I stated in my question I am new to programming so I couldn't clearly state what I was asking. I watched several YouTube tutorial videos on how to do it, but none of them seemed to answer what I wanted directly.

Likewise, all the forms I read online were geared towards experienced programmers, so I couldn't understand what their instructions were. When someone is ignorant of the answer/topic they don't always realize how their question can be misinterpreted. Since asking that question, many more experienced programmers have left many comments to help me better understand the problem I was having.

8
  • 19
    Thanks for coming over here to the discussion. My concern was that you didn't seem to know anything about accessing data in ASP.NET. You didn't seem to have a specific problem, only that you didn't even know where to start. If you actually _do_know something about accessing data in ASP.NET, then you should edit your question to make that clear, and then should clarify which specific problem you're having. Mar 4, 2015 at 20:52
  • 6
    Okay, thank you for the advice. Mason was already able to fix my problem, but I will keep all of your guys recommendations in mind if I ever need to ask another question. Like I said, after knowing the answer, I can see how frustrating it can be for people trying to answer the question when you don't provide them with enough information. Mar 4, 2015 at 20:59
  • 9
    Your first sentence says that you're not asking for a tutorial, but everything after it seems to indicate that you're asking for a tutorial. You're more or less saying, "I read a bunch of tutorials, I didn't understand them, please write me a tutorial on this subject that I can understand." That's asking for a tutorial on the subject.
    – Servy
    Mar 4, 2015 at 21:03
  • 11
    Not for nothing but rather than YouTube spend some time at MSDN. There are gobs and gobs of examples there even if you cant be bothered to read the explanation. Especially with VB there are a number of broader step by step tutorial articles as well. Mar 4, 2015 at 21:51
  • Although the quality has deteriorated over the years, The Code Project may be useful. It has tutorial content with actual code. Mar 5, 2015 at 2:05
  • Sample Mar 5, 2015 at 2:13
  • @Plutonix I've actually been disappointed with the code quality at MSDN lately. It seems like it follows a lot of bad practices or might at least lead you to do something that we wouldn't do in production quality code. For example, the SqlConnection documentation shows an example of a static method for database access that accepts a string for the command. It should probably accept an SqlCommand, allowing the command to be properly parameterized.
    – mason
    Mar 5, 2015 at 14:35
  • 5
    On its worst day, with half the words redacted, MSDN is still better than the average click-here-then-type-this YouTube video Mar 6, 2015 at 1:23
11

I answered the question, and my answer was accepted. So I feel I should give my input. Now that I think about it, the question was probably too broad. But I'd like to share my mindset on what I was thinking at the time.

It didn't even occur to me that it was too broad. I know there are many ways of having gone about what the OP was trying to do, and quite honestly the cleanest implementation would be to create a proper data layer and pass strongly typed models back and forth. However, I don't think such approaches are necessary to have a valuable website. They just make things easier to maintain. So I approached it with the mindset of "what's the simplest and most direct way to get data from SQL Server and bind that data to a DropDownList control." For me, the way to approach it seemed straightforward.

So while I now agree it was too broad and could have used some clarification to narrow the scope, I think we should all remember that we were once new to programming as well, and that there's a lot of bad information out there on how to do things, and sometimes it's helpful to ask how to do it properly and receive a canonical answer on a well frequented site where bad implementations will likely get judged as such. Otherwise you'll end up confused and doing something unnecessary and then have to support your bad code.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .