How to use the myAdapter.Update and OleDbCommandBuilder from dataGridView to update the db2 database

hello,everybody ,it a question makes me crazy .my code is that :
        public string tableName = "";
        public DataSet ds;
        public OleDbDataAdapter myAdapter;
        public string sql = "";
        private   void button12_Click_1(object sender, EventArgs e)
            sql = textBox5.Text.Trim();
            OleDbConnection Conn = new OleDbConnection(st_contractconn);     
            Conn.Open();
            this.comboBox1.Items.Add(this.textBox5.Text);
            try
                System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex(@"(?<=from\s)\w+(?=\s)");
                System.Text.RegularExpressions.Match B = r.Match(sql);
                tableName = B.ToString();
               OleDbCommand cmd = new OleDbCommand("SELECT * FROM PT_PO",Conn);
               Conn.Close();
                myAdapter = new OleDbDataAdapter(cmd);
                ds = new DataSet();
                myAdapter.Fill(ds, "PT_PO");
                dataGridView2.DataSource = ds.Tables["PT_PO"].DefaultView;                   
                this.groupBox2.Text = "共查询到" + ds.Tables[0].Rows.Count.ToString() + "条记录" + tableName;
            catch (Exception ex)
                MessageBox.Show(ex.Message);
        private void button26_Click(object sender, EventArgs e)
            OleDbConnection Conn = new OleDbConnection(st_contractconn);
            Conn.Open();
            OleDbCommandBuilder Builder = new OleDbCommandBuilder(myAdapter);
            Validate() ;            
            myAdapter.Update(ds.Tables["PT_PO"]);
            Conn.Close();
            ds.AcceptChanges() ; 
when it run to the myAdapter.Update(ds.Tables["PT_PO"]);  it comes out a wrong "对于不返回任何基表信息的 SelectCommand 不支持动态 SQL 生成。" who knows  it is why ,my QQ is 501212848,thankyou very much.

Hello,
We were a IBM-DB2 shop for over 20 years, when we moved to .NET we found it was better to use the native DB2 data provider which you can download from IBM for free.
Main objects
IBM.Data.DB2.iSeries.iDB2Connection
IBM.Data.DB2.iSeries.iDB2Command
IBM.Data.DB2.iSeries.iDB2Parameter
So you would not use adapters but write code using the key objects above. Then to get new primary keys we would use
SELECT nextval for SOMETABLE_REF_AUTONUMBER_SEQUENCE from sysibm.sysdummy1
Bottom line is the structure is create a connection, create a command, set the connection and command text along with creating parameters as needed.
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.
what is the meaning about you ? db2 cannt using adapters  to update the datebase?

Similar Messages

  • How to I delete all contact on my iPhone at once. These are contacts ABOVE the contact folder that says From My Mac. I do not want to erase all of the other settings and content from my iPhone -- just the contacts.

    How to I delete all contact on my iPhone at once? These are contacts ABOVE the contact folder that says, "From My Mac."
    Someone said create a new empty folder on the computer and sync to that -- didn't work .
    Another person said, "Reset information in settings to restore to the default." That would erase ALL of the conetent I have on the phone and I do not want to erase all of the other settings and content from my iPhone -- just the contacts.
    There has to be a better way than gong through and deleting one-by-one.

    Go into Settings...Mail, Calendar and Contacts and siwtch off the Contacts section from the account in question.
    The phone should ask you if you want to keep or erase the contacts stored on you phone.
    However, if they aren't synched to anything and only exist on your iPhone, you'll have to delete them all one by one

  • How to use LTE on iPad 4 (A1460) from US (Verizon) in the UK (EE)

    If you purchase the iPad 4 model A1460 in the US on the Verizon network, it will not connect to 4G LTE on the UK EE network - you will only get 3G.
    To enable LTE you must do a full factory reset (Settings -> General -> Reset -> Erase all Content and Settings).
    Once the iPad restarts it will connect to LTE.  Note you should backup any data first and then you can restore it afterwards and will still have LTE.
    This seems to be a recurring problem from discussions with the EE store and helpline who could not diagnose the problem.  Apple telephone support eventually suggested the above steps which are due to Verizon's LTE network settings being stored on the iPad and there seems to be no other way to switch to the UK ones other than a full erase.
    Hope this helps others!

    Hi Dave,
    Verizon is somewhat different from normal GSM/HSPA/LTE carriers in the respect that it still offers some of it's service over CDMA EVDOx1 A/B. The CDMA protocol is not usually delivered using a sim card only, and there are carrier settings in the iPad which are for this purpose.
    I do not believe the iPad is locked to Telstra as 4th generation iPads are all unlocked by default. You need to give the MEID and IMEI number to Verizon. When they have been added to Verizon's network, then insert the Verizon sim card and completely factory reset the device. You will lose everything. When the device reboots, it should come up onto Verizon. If you restore, you may lose the Verizon carrier settings.
    The 4th generation A1460 iPad seems to be a dual mode device between CDMA and non CDMA carriers. And the mode seems to be set upon the first encounter with a sim card after a complete reset.
    To confirm the device is not locked, pop a T-Mobile or AT&T sim card into it. If it is locked, you will get a message stating that it is carrier locked. If not, you should see 3G service on either of those networks.
    I would strongly recommend finding a small techie independent dealer who can probably help with this more than the staff in Verizon. Verizon is a very controlled network and BYOD is not massively supported at the best of times. They are unlikely to have experience of this and their text book response would be that they do not support it.
    I'm also unsure as to whether or not Verizon offers LTE data on Prepaid plans so if it is a prepaid plan, you would only get 3G (CDMA) which after using Telstra would not impress you much speed-wise.
    What may be an easier solution although not as desirable would be putting a prepaid T-Mobile sim card in. They now support DC-HSPA on 1900Mhz in many markets and it is nearly as fast as Verizon's LTE and quite cheap too. (With this T-Mobile solution, no reset would be required).
    Good luck.
    J.

  • How do I import my passwords and bookmarks from a backup on the desktop after a fresh install of the new Firefox 9

    I had problems with an older version of Firefox so I backed up my passwords and backed up my bookmarks and put the backup files on my desktop and then reinstalled a the new Firefox 9.. I cannot find out how to reinstall the passwords or bookmarks into the program now.. Please advise.. Thx

    Hi,
    All of the links above are very old.
    I have problem with restoring my saved password in Firefox 9.
    The profile is no longer located %APPDATA%\Mozilla\Firefox\Profiles\
    In windows 7 the all of the setting of Firefox 9 are located inside (Drive:\\My Documents\FireFox Settings) folder.
    I have copied all of my old setting including bookmarks and cookies and they word perfectly.
    However I have problem with saved passwords. I copied the files "signons.sqlite" and "key3.db" into (Drive:\\My Documents\FireFox Settings) folder but I don't have my password.
    I tried to set a fresh "save password" and then replaced the files "signons.sqlite" and "key3.db" but no luck.
    Please help.''' I don't like to use any utility to recover my password.''' I can't trust them. It should work with the file within my system.
    Than you

  • When i go to the app store to update the one app that needs to be updated, the screen is blank.  It used to list all the apps that need updating and have a button called update all.  Now nothing.  Just a blank screen.

    when i go to the app store to update the one app that needs to be updated, the screen is blank.  It used to list all the apps that need updating and have a button called update all.  Now nothing.  Just a blank screen.  How can I fix this?

    There's been a problem with this all day.  Seems to be a server problem  -  wait a day and try again, or use itunes on the computer to update, that works.

  • My ipod says it is updated to most current 6.1.6, i use the rdio app and it worked but now with the update it needs 7.0 but i do not get option to update to this what do i do?

    my ipod says it is updated to most current 6.1.6, i use the rdio app and it worked but now with the update it needs 7.0 but i do not get option to update to this what do i do?

    See the chart below to determine whether you can upgrade your device and what you can upgrade to. If you do not have a Software Update option present on your iDevice, then you are trying to upgrade to iOS 5 or higher. You will have to connect your device to your computer and open iTunes in order to upgrade.
    IPhone, iPod Touch, and iPad iOS Compatibility Chart
         Device                                       iOS Verson
    iPhone 1                                      iOS 3.1.3
    iPhone 3G                                   iOS 4.2.1
    iPhone 3GS                                 iOS 6.1.x
    iPhone 4                                      iOS 7.1.x
    iPhone 4S                                    iOS 8.x.x
    iPhone 5                                      iOS 8.x.x
    iPhone 5c                                     iOS 8.x.x
    iPhone 5s                                     iOS 8.x.x
    iPod Touch 1                               iOS 3.1.3
    iPod Touch 2                               iOS 4.2.1
    iPod Touch 3                               iOS 5.1.1
    iPod Touch 4                               iOS 6.1.x
    iPod Touch 5                               iOS 8.x.x
    iPad 1                                          iOS 5.1.1
    iPad 2                                          iOS 8.x.x
    iPad 3                                          iOS 8.x.x
    iPad 4                                          iOS 8.x.x
    iPad Mini & Mini Retina                iOS 8.x.x
    iPad Air                                        iOS 8.x.x
    =====================================
    Select the method most appropriate for your situation.
    Upgrading iOS
       1. How to update your iPhone, iPad, or iPod Touch
       2. iPhone Support
       3. iPod Touch Support
       4. iPad Support
         a. Updating Your iOS from iOS 5
              Tap Settings > General > Software Update
         If an update is available there will be an active Update button. If you are current,
         then you will see a gray screen with a message saying your are up to date.
         b. If you are still using iOS 4 — Updating your device to iOS 5 or later.
         c. Resolving update problems
            1. iOS - Unable to update or restore
            2. iOS- Resolving update and restore alert messages

  • My mac has been updated and when i go to install the newest itunes this pops up. 'Couldn't open "Install iTunes.pkg". This package type requires Mac OS X 10.5.' how can i fix this so i can get the new itunes?

    my mac has been updated and when i go to install the newest itunes this pops up. 'Couldn't open "Install iTunes.pkg". This package type requires Mac OS X 10.5.' how can i fix this so i can get the new itunes?

    Hi
    Try to use "software update" option
    to to apple menu -> software update  or system preference -> Software update
    ( you may try to use an old package  on new system )
    HTH

  • Downloads used to open after download. NOw they just end up in the download folder and I have to go to the folder to find it and open it. I did not change seettings, maybe an update changed it? I cannot find a way to change this in settings.

    Downloads used to open after download. NOw they just end up in the download folder and I have to go to the folder to find it and open it. I did not change seettings, maybe an update changed it? I cannot find a way to change this in settings.
    == This happened ==
    Every time Firefox opened
    == A week or two ago. Not sure if result of most recent update.

    Downloads used to open after download. NOw they just end up in the download folder and I have to go to the folder to find it and open it. I did not change seettings, maybe an update changed it? I cannot find a way to change this in settings.
    == This happened ==
    Every time Firefox opened
    == A week or two ago. Not sure if result of most recent update.

  • HT1695 I know nothing about how to use my new ipod and when reading the little bit of information in the folder that came with it, all I can do is turn it on, but it just powers down after a few seconds.  How do I work this thing?

    I know nothing about how to use my new ipod and when reading the little information that came with it, all I can do is turn it on.  Then in a few seconds it goes black, never having brought up a screen to do anything!  Help!  What do I do to get this thing going?

    You might consider connecting it to the charger and charging up the battery overnight.
    Please Get the iPod Touch User Manual for iOS 5

  • My ipod touch was interrupted during an update and now my itunes cant recognise the device, and ive tried to restore it but it just keeps coming up with the usb and itunes picture. how do i fix this? Please help

    my ipod touch was interrupted during an update and now my itunes cant recognise the device, and ive tried to restore it but it just keeps coming up with the usb and itunes picture. how do i fix this? Please help

    http://support.apple.com/kb/HT1808

  • I bought a new 5c and transferred from an old update from my iPhone 4.  The only issue I have is the name of my new phone.  How can I change it from Amyiphone4 to something else?

    I bought a new 5c and transferred from an old update from my iPhone 4.  The only issue I have is the name of my new phone.  How can I change it from Amyiphone4 to something else?

    settings - general - about - name - make the changes

  • How do I transfer all photos and music from my old iphone 3gs to new iphone 4s? I have a new laptop because the old one broke and so do not have non camera roll photos or music stored anywhere apart from the iphone 3gs and cannot update io5 on the iphone

    How do I transfer all photos and music from my old iphone 3gs to new iphone 4s? I have a new laptop because the old one broke and so do not have non camera roll photos or music stored anywhere apart from the iphone 3gs and cannot update io5 on the iphone 3gs without erasibng everything. i need help!!!

    Syncing to a new iTunes library or computer will erase your phone. Only if you back up manually before syncing, you can restore your device from that backup again. A manual backup does not include the sync process.
    Do this:
    Disable autosync in iTunes, connect your phone to your new computer and right click on it in the device list and choose backup. iTunes will backup your device without syncing.
    Transfer your purchases the same way, choosing "transfer purchases" this time.
    When you connect your phone for the first time, all media content will be erased. But you can restore your settings and app data from your manual backup afterwards.
    Don't forget to set up at least one contact and event on your new computer to be able to merge calendars and contacts when you sync the iPhone for the first time.
    Music is one way only, from the computer to your device, unless you bought the songs in itunes and transferred your purchases.
    There is 3rd party software out there, but not supported by Apple, see this thread: http://discussions.apple.com/thread.jspa?threadID=2013615&tstart=0
    About backups and what's saved:iTunes: About iOS backups
    How to back up and restore:http://support.apple.com/kb/HT1414
    How to download apps for free again:http://support.apple.com/kb/HT2519
    Saving other data is also described here. How to back up your data and set up as a new device

  • What does it mean when my ipad is in Recovery mode? It's connected to my imac for software update and it says I must "restore" the ipad before itunes can be used. Will I lose everything on my ipad?

    What does it mean when my ipad is in Recovery mode? It's connected to my imac for software update and it says I must "restore" the ipad before itunes can be used. Will I lose everything on my ipad?

    Unless you have a backup from which you can restore, yes you will lose all of your data and settings.
    You should be able to sync your content back to the iPad if you have been syncing with iTunes all along. If you don't sync with iTunes, you can download much of your paid content again for free as long as you use the same Apple ID. This explains downloading past purchases.
    http://support.apple.com/kb/ht2519
    Unfortunately, at this point, you must restore the device before you can move on. There is nothing you can do to avoid it now.

  • App Store keep using an old email and so I can't update

    App Store keep using an old email and so I can't update how can I update my Apps?

    Hi I have tried your suggestion thank you but I had no luck . So I logged a case with Apple and they said the following:
    I have gone through your issue and I would like to inform you that you cannot update or transfer you purchased items from one account to another account. I have good news for you can access your purchases from your old email address by contacting our Account Security Team.
    for a faster resolution you need to contact our Account Security Team (AST) via Phone to schedule a call at your preferred time and they will verify the identity of your account and help you right away. To contact an Account Security Advisor, follow the on screen steps provide in the below articles:
    Contact Apple ID Account Security
    http://support.apple.com/kb/HT204169
    you also have an option to call them directly by calling the below phone number:1-800-275-2273
    Note: Please ask you need to speak to an account security advisor and provide the case number

  • [svn:osmf:] 11996: Updates and changes from the spec review for FMMLoader.

    Revision: 11996
    Revision: 11996
    Author:   [email protected]
    Date:     2009-11-19 11:12:19 -0800 (Thu, 19 Nov 2009)
    Log Message:
    Updates and changes from the spec review for FMMLoader.
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/proxies/LoadableProxyElement.as
    Added Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/net/FMMLoader.as
    Removed Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/net/ManifestLoader.as

    Hi
    I've Updated App Builder, gone back to the DPS App Builder portal, regenerated new zip and ipa files and downloaded them.
    I clicked the Application Loader 3.0 link, downloaded the latest Appication Version, clicked on the "Deliver your App" button, and submitted the newly built App that was built using 32.4.2 version. (All the app icons were listed as "stored on server" so I presume they are all ok). The .zip file appeared to 'deliver' to Apple successfully. I've tried to resubmit it but get ta "Redundant Binary Upload. There already exists a binary upload with build version..." error message, so presume the orginal binary upload was successful. I have no idea how I can get this app from the "prepare for submission", to "in review". The last time I thought I'd submitted this app I got as far as the "waiting for review" status, and no further.
    At the moment I don't have a"+" button in the Build section - as mentioned on page 66 of Adobe's Step_by_step_guide_to_dps_se.pdf.
    So I can't add the new .zip file to the iTunes Connect > My Apps portal in the Build section of the Versions tab.
    I have put a support email into Apple, but don't expect a reply any day soon.
    The problem with starting all the way back through the App wizard is that I really want to use all the same App Name, Bundle ID, and details etc.
    Do you mean, going back to the Folio Producer Panel, and building a whole new App?
    This process certainly isn't for the faint-hearted!
    HELP!

Maybe you are looking for

  • How to Maintain Two Countries for a Single Plant in OX10

    Hi Experts I need the solution for the below settings for OX10 ( Plant Overview ) . For a single Plant i have to maintain two countries . 1) One country in details screen of Plant ( Country Key ) 2) Second country in Address details of the same plant

  • How do I stop the console from reporting errors on an application I have already deleted?

    Hi, I'm somewhat new at using macbook pros.  My macbook pro runs snow leoperd 10.6.8.  I just recently learned that console is a good way to check on what your computer is doing so i went in checked on it.  I noticed that a program i recently deleted

  • Question about Toshiba Bluetooth stack V.4

    Hi We have a Fujitsu Siemens P7120 Laptop which requires the Toshiba Bluetooth stack located at http://aps.toshiba-tro.de/Bluetooth/pages/download.php When we install this in silent mode, the installation takes place however the Bluetooth does not in

  • Create PO from RFQ

    Hello, I need to create PO from RFQ. When I select a RFQ in my report and click 'Create PO' push button, all the values from RFQ should be transferred to ME21N screen, So the users have the ability to <b>change the RFQ values</b> (Qty , Del Date ...e

  • How to acquire 3 phase signals

    Greetings I need to analyze three sinusoidal signals 120 degrees out of phase by nature including my version of LabVIEW 7.1 and the acquisition card I used is the Measurement Computing USB 1208FS. In principle the acquisition and display them individ