DataSet designer won't let me set GenerateDBDirectMethods to true

Discussion in 'ASP .Net' started by Alan Silver, Jul 20, 2006.

  1. Alan Silver

    Alan Silver Guest


    I am trying to persuade VS2005 to let me use a DataSet to insert to a
    table. I add a DataSet item to the App_Code folder, and the wizard comes
    up. I go through the steps, but when I get to the step where it asks if
    I want to fill or return a datatable, the third option, to generate
    methods for insert, update and delete is greyed out.

    According to MSDN... "This option is unavailable when the original SQL
    statement does not provide enough information or the query is not an
    updateable query. This situation can occur, for example, in JOIN queries
    and queries that return a single value (scalar)." I can't see how this
    is relevant as I tried it with the simplest of SQL queries.

    The really weird thing is that some of the tables in the database allow
    the option to be set, and some do not. I have stared stupidly at these
    tables trying to spot some difference, but I can't.

    Anyone any ideas? TIA

    Alan Silver
    (anything added below this line is nothing to do with me)
    Alan Silver, Jul 20, 2006
    1. Advertisements

  2. Alan Silver

    Alan Silver Guest

    In article <>, Alan Silver
    <> writes
    >Anyone any ideas? TIA

    In case it helps anyone, I discovered that if you use "select * from
    table" for the SQL, it works. You can then look at the properties of the
    adapter, and open the query builder for the select command. This will
    replace the * with the field names, at which point you can either just
    save it, or edit the field list and then save it.

    Having said that, I did discover further that you don't actually need
    this feature at all. Once you have the adapter set up, you can just add
    a new query, set it to be an insert and it will create a nice method for
    you. Much easier, and it only creates the methods you want, rather than
    extras that you don't want.

    I still think the behaviour I observed was a bug, but I'm not going to
    bother with it.


    Alan Silver
    (anything added below this line is nothing to do with me)
    Alan Silver, Jul 20, 2006
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dot net work
    Dot net work
    Jun 16, 2004
  2. Luigi Donatello Asero

    Let or not let the text float

    Luigi Donatello Asero, Jan 15, 2004, in forum: HTML
    Steve R.
    Jan 15, 2004
  3. Mo
  4. bdb112
    Apr 29, 2009
  5. devdoer

Share This Page