Re: .net table adapter code behind missing UPDATE statement

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks, I think that might do the trick...

we are converting a legacy system and I know for a fact that the
original db didn't use primary keys. I thought the unique indexes might
have worked but I will try adding an explicit PK.

thanks again


Franklin M. Gauer III wrote:
Hi - I had the same issue with Oracle in VS 2003.

Check to make sure that the TABLE you are working with has a PRIMARY KEY
CONSTRAINT. It can't be a INDEX that enforces uniqueness on the table. It has
to be a PRIMARY KEY CONSTRAINT.

This issue with VS 2003 was that the UpdateCommand builder wizard (or
whatever you call it) would bail on creating the UpdateCommand if it could
not find a primary key on the table. In order words it could not build a SQL
statement that could update just ONE RECORD (i.e. so the dataset -
dataadapter could always find the right record to update).

In SQL Server the UpdateCommand builder is a little more forgiving - with
Oracle it's not.

Now I'm not sure if this is the case with VS 2005 (which is what you are
using) but I got a feeling it might be. It's worth a shot anyway.

Once you get beyond this you are going to like working with .NET and Oracle
8i. It works pretty darn well... and I have several production systems out
there working within this context.

ANOTHER CRITICAL TIP! Make sure your Oracle field names are less than 20
characters or the command builder is going to give you troubles. If you want
more information on this - feel free to ping me directly...

Good luck!

--
Franklin M. Gauer III
Applications Development Manager
Integrated Companies, Inc.


"travhale@xxxxxxxxx" wrote:

in a new project using .net 2005, c#.

getting err message "Update requires a valid UpdateCommand when passed
DataRow collection with modified rows."

source RDBMS is oracle 8i. I add a new dataset to the project and drag
a datatable from server explorer onto the dataset design surface. In
the configuration wizard, under advanced options the "refresh data
table" is disabled ie I am not able to check it (note if the source db
is sql server this option is enabled).

I click next and accept defaults. The Insert and Select commands are
created, but not the Update command (note if the source db is sql
server the update command is created). The Insert, Select, and Update
methods are all created, just not the update command.

I am trying to use typed datasets to pass into the DAL for updates, so
I'm not sure that I need to use command builder as a workaround as it
appears cb will take a generic dataset only (unless an overload for
each typed dataset is written).

I also suppose a workaround could be to type the update command
manually but we have over 100 tables ...

I tried copying the SQL Server update command into the code behind of
the oracle equivalent but it didn't take (I receive the same error msg
as when there is no update statement).

the connection types I've tried are ODBC, OLEDB, Oracle Database etc
all seem to give the same result.

please let me know if there is a way to have the adapter automatically
create the update statement from an oracle 8i db.



.



Relevant Pages

  • .net table adapter code behind missing UPDATE statement
    ... source RDBMS is oracle 8i. ... is sql server this option is enabled). ... but not the Update command (note if the source db is sql ... create the update statement from an oracle 8i db. ...
    (microsoft.public.dotnet.general)
  • RE: .net table adapter code behind missing UPDATE statement
    ... Check to make sure that the TABLE you are working with has a PRIMARY KEY ... Once you get beyond this you are going to like working with .NET and Oracle ... is sql server this option is enabled). ... but not the Update command (note if the source db is sql ...
    (microsoft.public.dotnet.general)
  • Re: Informix Licensing and Pricing Schemes.
    ... Many of my clients have Oracle somewhere in their ... along with SQL Server and DB2 and Informix. ... columns in a table except the primary key could/should be nullable. ... and you don't have a parent row for it, just do an insert into the parent ...
    (comp.databases.informix)
  • Re: Is Primary Key always the index of the table in Oracle?
    ... An IOT in Oracle resembles a SQL Server table ... IIRC you can make Oracle create a constraint without an index. ... Actually what you can do is use a non-unique index for a primary key ...
    (comp.databases.oracle.server)
  • Re: Is Primary Key always the index of the table in Oracle?
    ... An IOT in Oracle resembles a SQL Server table with CI. ... make an index for the primary key. ... IIRC you can make Oracle create a constraint without an index. ...
    (comp.databases.oracle.server)