DataAdapter.Fill doesn't include PrimaryKey Info

We are using Oracle 9i and Odp.net verion 9.2.0.401.
I am using the data adapter on a command that is a simple select statement in our code. The code is written generically to support multiple providers using ado.net.
The problem I am having is that when I call Fill with "adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey" specified that DataTable comes back with no primary key. Other providers bring this information back.
I read in the manual that indicates that "schema and key information is not brought back even if MissingSchemaAction = MissingSchemaAction.AddWithKey is specified". This seem to function a bit different than other providers (both SqlServer and Oracle).
How would I load this info when I load the table using fill?
Thanks in advance
Sample of our code:
public static DataTable LoadTable(string name)
IDbTransaction transaction = null;
IDbConnection connection = null;
DataSet dataSet = new DataSet();
string query = string.Format("SELECT * FROM {0}", name);
DataTable tableToReturn = null;
try
OpenConnection(out connection, out transaction);
IDbCommand command = InterfaceDataProvider.CreateCommand(transaction.Connection, transaction, query);
DbDataAdapter adapter = InterfaceDataProvider.CreateAdapter(command);
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
adapter.Fill(dataSet, name);
tableToReturn = dataSet.Tables[name];
finally
CloseConnection(connection);
return tableToReturn;

It's unfortunate that the OracleDataAdapter doesn't retrieve this information. Anyway, here's how to do it yourself:
  static void derivePK(DataTable t, string name, OracleConnection con)
    OracleCommand c = new OracleCommand(@"select column_name
                                            from user_cons_columns ucc,
                                            user_constraints uc 
                                            where  ucc.constraint_name =  uc.constraint_name
                                            and    uc.constraint_type = 'P'
                                            and uc.table_name = upper(:1) order by ucc.position",con);
    cmd.Parameters.Add("name",name);
    System.Collections.ArrayList keyColumnList = new System.Collections.ArrayList();
    using (OracleDataReader r = c.ExecuteReader()) 
    while (r.Read())
      keyColumnList.Add(t.Columns[(string)r[0]]);
    DataColumn[] keyColumns = (DataColumn[])keyColumnList.ToArray(typeof(DataColumn));
    t.PrimaryKey = keyColumns;
  }David

Similar Messages

  • How can i change the ID on my wifi so it doesn't include my first and last name?

    How can I change the ID on my Wifi so it doesn't include my first and last name when others see it?

    If you are still having difficulty
    Open Macintosh HD > Applications > Utilities
    Locate the listing for AirPort Utility and Right Click on it
    Click Get Info
    Look for the Version in the next window that should appear on the left side of your screen.

  • Private me card that doesn't include notes?

    I have enabled the private me card so that I can send a work related v-card to all of my colleagues that doesn't include my home and personal contact info. However, there doesn't appear to be a way to exclude the notes section from appearing in my work related v-card, and I have a lot of personal information in my notes section.
    I should mention that I do have "export notes in v-cards" option enabled, which I would like to keep enabled because I want to retain my notes when syncing with my iphone and backing up to an archive, which I often do.
    Is it possible to exclude the notes section from the work related v-card?
    thanks!

    Greetings,
    The only way to remove a child's name is to remove it from the contact card in Address Book. There is no field for children in Address Book; they should always be put in the Notes section.

  • My Fall 2009 system DVI output to our HDTV doesn't include audio.  Connecting the Macbook headphone output to the TV's RCA plugs works if TV is in AV (PC) mode, but no picture.  DVI to HDMI adapter to TV works fine for picture, but no audio.

    My Fall 2009 model Macbook Pro DVI output apparently doesn't include audion.  Adapting DVI to HDMI works with new LG TV, but doesn't provide sound.  Connecting the Macbook headphone output to the TV's RCA jacks give sound with the TV in AV (PC) mode, but no video.  Is there a fix for this?  Search for a DVI to HDMI adapter that includes a plug for the headphone jack comes up empty, so far.

    DVI has never included audio, sorry.
    There is also no DVI->HDMI adapter including a plug for audio; such thing cannot work without quite a bit of electronic extra effort.
    Instead of much bla-bla, why don't you tell the exact TV model, and we'll try to come up with a solution?
    BTW, no home theater AV receiver present, correct? Sound to come from the TV, correct?

  • Search doesn't include text in calendar notes fields

    I have a calendar created in iCal that includes about 90 entries with text in the notes field of each. Spotlight on the Mac searches that text fine.
    I've synched that calendar to my iPhone - and search there doesn't include text in that field, though it does for the title field.
    Its a great feature - but to keep calendar entries usable the titles need to be short with most details in the notes, but still searchable

    http://www.apple.com/feedback/iphone.html

  • I updated imovie, which is now totally different.  I tried to import videos from iphotos, but the system is now stuck on "import" and it doesn't include iphotos.  Clicking on "close" doesn't work.  How do I get out of "import"?

    I updated imovie, which is now totally different.  I tried to import videos from iphotos, but the system is now stuck on "import" and it doesn't include iphotos.  Clicking on "close" doesn't work.  How do I get out of "import" and then how do I access iphoto?

    I have asked a moderator to provide assistance, they will post an invite on this thread.
    Once you get a reply, if you click on their name, you will see a screen like this. Click on the link as shown below.
    Please do not send them a personal message, as they may not be on duty for a long time, and your message will not be tracked properly.
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • DBMS_METADATA.GET_DDL doesn't include function parameters

    Sometimes, when I call DBMS_METADATA.GET_DDL to get the DDL statement for a function (which we always do to ensure we're starting from the source that's actually in production), the returned text doesn't include the parameters. Other times, it does, and I'm not able to see any pattern.
    I was going to just make a function and show the output, but that did show the parameters. Then I tried calling GET_DDL while logged in as SYS as SYSDBA on my development database, and I still did not get the parameters, so I don't think it's a permissions issue.
    Does anyone have any idea what's going on here?

    It's really difficult to show you exactly what I'm doing when I can't consistently reproduce the problem, as I described.
    But here, I'll try.
    declare
         the_ddl clob;
    begin
         the_ddl := dbms_metadata.get_ddl('FUNCTION', '*****', '*****');
         dbms_output.enable(null);
         dbms_output.put_line(the_ddl);
    end;
    /Sometimes, it produces output like this:
    CREATE OR REPLACE FUNCTION "*****"."*****" (
         ***** in varchar2,
         ***** in number,
    ) return *****
    ...And other times, it produces output like this:
    CREATE OR REPLACE FUNCTION "*****"."*****" return *****
    ...I am not able to determine any consistent reason for this. In our production database, I can log in as myself and get the parameters for a specific function, but another user (that our automated process uses) doesn't see the parameters. In my development database, I log in as myself and I do not see the parameters, but I still don't see them when I log in as SYS AS SYSDBA.
    For what it's worth, if I recreate the function on my development database, then subsequent calls do show the parameters.

  • Error message saying iTunes doesn't include software for iPhone

    I get an error message saying iTunes doesn't include the software for iPhone. It says to uninstall and re-install iTunes. I have done it twice and both times I get the same error.

    There is an entire iPhone forum here
    http://discussions.apple.com/category.jspa?categoryID=201
    I don't have one - perhaps you will be better off there, where most will?
    Best of luck!

  • Top quote doesn't contain message info when quotin...

    v7.2.0.103
    I've noticed this happening in the past few months and it's really annoying.
    When I'm quoting multiple people's messages, the first message I quote doesn't include a timestamp. See my screenshot. These are the messages I'm copying. Below the screenshot, this is what it pastes when I copy those messages:
    which Skype group was this conversation a part of?
    [4/15/2015 8:46:51 AM] Emily: PC/BC Upgrade
    [4/15/2015 8:46:53 AM] Emily: Want an invite?
    As you can see, the first message doesn't have the timestamp or the person's name, but the subsequent ones do. To get around this, I've been having to copy part or all of the line above the line I wish to start with so that the timestamp shows in that one. Then I'll go and delete the partial above message.
    This happens regardless of if the first message is from me or from another person. It's any first message I quote when the whole portion I'm quoting has more than one sender.
    Anyone seeing this functionality as well? Any solutions?

    I have lost all of the downloaded music on my I phone. I tried to sync the phone with my new laptop. I only have my camera roll on the laptop and my phone. All libraries have disappeared. All games have disappeared from my phone too. Can anyone help me?

  • Online Number doesn't include unlimited country mi...

    I used to be a subscriber of online number which includes unlimited minutes of that country. This year, when I tried to renew, it doesn't include the minutes!! I didn't know it until I noticed my credit in my account is dropping!! Now, I had to go back and subscribe the minutes for that country, and found out I have 50% off discount if I get an online number. Is it possible to refund 50% of the online number that I have previously subscribed?? Can someone help me??????
    Solved!
    Go to Solution.

    Hi,
    You can contact Skype Customer Service and explain that you wish to have a discount for the number.
    How it can be done at all? They will issue a refund for your number, then number will of course be removed from your account (but reserved for you for 90days) and then you will have to go thru the payment flow again.
    I cannot promise they will refund your number, but that is the only available option
    If my answer helped to fix your issue, mark it as a Solution to help others.
    Thank You!
    Please send private messages only upon request.

  • Bug: weblogic.jar doesn't include the javax.ejb classes

    In the
    Oracle WebLogic Server 11gR1 (10.3.6) + Coherence -
    Package Installer
    the C:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic.jar doesn't include the javax.ejb package classes. The javax.ejb package is empty.

    This is the correct behavior, stub and skeleton classes are generated at deployment time by WebLogic server and stored in a server internal location.
    In case you are interested, it is something like: ...\samples\domains\medrec\servers\MedRecServer\cache\EJBCompilerCache\ with file named like HelloSession_gjfaqw_Intf.java., etc.
    -danny

  • I upgraded from Photoshop Elements 6 to 12.  But 12 doesn't include Arno Pro or Rockwell fonts. How do I add them to Elements 12 without paying for them again?

    I upgraded from Photoshop Elements 6 to 12.  But 12 doesn't include Arno Pro or Rockwell fonts. How do I add them to Elements 12 without paying for them again?

    https://www.google.com/search?q=Arno+Pro+or+Rockwell+font&oq=Arno+Pro+or+Rockwell+font&aqs =chrome..69i57&sourceid=chrome…
    https://www.google.com/search?q=Arno+Pro+or+Rockwell+font&oq=Arno+Pro+or+Rockwell+font&aqs =chrome..69i57&sourceid=chrome…

  • I just dowload and pay the new LR6. I already have the LR 5.7 on my PC with OS 8.1 64bits - when I try to enter the serial number Adobe informs me that there are no eligible product available - the list doesn't include the LR6 version ?

    I already have the LR 5.7 on my PC with OS 8.1 64bits - when I try to enter the serial number Adobe informs me that there are no eligible product available - the list doesn't include the LR6 version ?

    thank you very much!
    everything's allright
    bye

  • I tried to follow the instruction of buying iphone apps without a credit card, when I selected United States, but when I fill up the credit card info, i could not find the word "None". Anyone know what should I do?

    I tried to follow the instruction of buying iphone apps without a credit card. I follow the steps and I selected United States, but when I fill up the credit card info, i could not find the word "None". Anyone know what should I do?

    When you tried to contact Support with the card's images how were you trying to do it, on your phone or a browser on your computer ? And have you tried a different browser to see if you get the same error message ?
    As well as images of the card they might also want an image of its receipt.
    And to contact Support you were using : http://www.apple.com/support/itunes/contact/ , and clicked on Contact iTunes Store Support on the right-hand side of the page, then iTunes Cards And Codes ?

  • [svn:fx-4.0.0] 13870: Fix mpl so it doesn' t include automation_agent qtp and qtp_air swcs

    Revision: 13870
    Revision: 13870
    Author:   [email protected]
    Date:     2010-01-28 20:07:23 -0800 (Thu, 28 Jan 2010)
    Log Message:
    Fix mpl so it doesn't include automation_agent qtp and qtp_air swcs
    https://bugs.adobe.com/jira/browse/FLEXENT-1223
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FLEXENT-1223
    Modified Paths:
        flex/sdk/branches/4.0.0/build.xml

    I had downloaded it for test, and requested for evaluation license...
    But I haven't got license, and also I am not able to find Flash Builder Plugins from HFCD site....
    I think those plugins are removed from site....
    Please help me, if anyone have those plugins...

Maybe you are looking for