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

    Hello,

    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
    1. Advertising

  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.

    HTH

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

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
    Replies:
    4
    Views:
    532
    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
    Replies:
    6
    Views:
    471
    Steve R.
    Jan 15, 2004
  3. Mo
    Replies:
    0
    Views:
    1,138
  4. bdb112
    Replies:
    45
    Views:
    1,346
    jazbees
    Apr 29, 2009
  5. devdoer
    Replies:
    5
    Views:
    86
Loading...

Share This Page