"set cert delete" command deleting the wrong cert

We have a scenario where we are trying to automate tomcat cert deletions. The issue is that even though in the GUI, the certs have the names spelled differently (one is capitalized, one is not, but spelled the same) the "set cert delete tomcat-trust name" deletes both.
example:
cert names
testcert.pem
TESTCERT.pem
since we are trying to automate this, having TAC use root access to delete in reference to the PKID doesn't help. Any other ideas?

HI,
The Indentation (The space before a statement) is very important in WLST because the control statements like if{} and Loops like for{} and while{} starts and ends based on the Indentation.
Please use the below corrected script:
url=t3://localhost:8001
username=weblogic
password=weblogic
app.1=MyApp1
app.2=MyApp2
app.3=MyApp3And following will be your WLST Script:
from java.io import FileInputStream
propInputStream = FileInputStream("test.properties")
configProps = Properties()
configProps.load(propInputStream)
Url = configProps.get("url")
print 'url=', Url
User = configProps.get("username")
print 'User=', User
Password = configProps.get("password")
print 'Password = ', Password
connect(User,Password,Url)
config()
cd ('Applications')
for i in 1,2,3:
     App = configProps.get("app."+str(i))
     delete (App)
     print 'Application ',App,' has been deleted Successfully..!!!'
     i =i+1
So Now you need to just make changes in the Properties file...No need to touch anything in the WLST Script except the For Loop Count.Which is equal to the Number of applications which you want to delete ;)
Thanks
Ravish Mody

Similar Messages

  • Delete Command button doesn't take more than one parameter while update command does

    Hi,
    Does anybody have an idea WHY sharepoint does not send the parameter information to a delete command while the exact same parameter is being sent to the Update command?, the data is being pulled from an asp:TextBox bound  to the 'comments' field in
    the data source which happens to be the field I need to update, the code works for Update commands but not for Delete commands. Unfortunately I have to use sharepoint designer because SP is restricted at work, so I can't write code behind the scenes. I would
    appreciate any help, here's my code
    <%@ Page Language="C#" masterpagefile="../_catalogs/masterpage/v4.master" title="Test" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full" %>
    <%@ Register tagprefix="SPSWC" namespace="Microsoft.SharePoint.Portal.WebControls" assembly="Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register tagprefix="cc2" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register tagprefix="WebUI" namespace="Microsoft.Office.InfoPath.Server.Controls.WebUI" assembly="Microsoft.Office.InfoPath.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register tagprefix="WebPartPages" namespace="Microsoft.SharePoint.WebPartPages" assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <asp:Content id="Content1" runat="server" contentplaceholderid="PlaceHolderMain">
    <asp:SqlDataSource runat="server" ProviderName="System.Data.SqlClient" UpdateCommand="sp_updateStartedApprovals" ID="SqlDataSource2" ConnectionString="Data Source=MCARLOSJ2;User ID=sa;Password=****;Initial Catalog=MyDB;" SelectCommand="SELECT * FROM mainView " __designer:customcommand="true" UpdateCommandType="StoredProcedure" DeleteCommand="sp_rejectApprovals" DeleteCommandType="StoredProcedure">
    <UpdateParameters>
    <asp:Parameter Name="comments" Type="String"/>
    <asp:parameter Name="id" Type="Int32" />
    </UpdateParameters>
    <DeleteParameters>
    <asp:Parameter Name="comments" Type="String"/>
    <asp:parameter Name="id" Type="Int32"/>
    </DeleteParameters>
    </asp:SqlDataSource>
    <asp:GridView runat="server" id="GridView1" AutoGenerateColumns="False" DataSourceID="SqlDataSource2" DataKeyNames="id" GridLines="None" ForeColor="#333333" CellPadding="4">
    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
    <Columns>
    <asp:boundfield DataField="description" HeaderText="Status" ReadOnly="True" SortExpression="description">
    </asp:boundfield>
    <asp:boundfield DataField="Employee Last Name" HeaderText="Employee Last Name" ReadOnly="True" SortExpression="Employee Last Name">
    </asp:boundfield>
    <asp:boundfield DataField="Employee First Name" HeaderText="Employee First Name" ReadOnly="True" SortExpression="Employee First Name">
    </asp:boundfield>
    <asp:boundfield DataField="Pending approval" HeaderText="Pending approval" ReadOnly="True" SortExpression="Pending approval">
    </asp:boundfield>
    <asp:boundfield DataField="Atnmt %" HeaderText="Atnmt %" ReadOnly="True" SortExpression="Atnmt %">
    </asp:boundfield>
    <asp:boundfield DataField="Country" HeaderText="Country" ReadOnly="True" SortExpression="Country">
    </asp:boundfield>
    <asp:boundfield DataField="comments" HeaderText="comments" ReadOnly="True" SortExpression="Comments">
    </asp:boundfield>
    <asp:boundfield DataField="processStartedDate" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Date Opened" ReadOnly="True" SortExpression="processStartedDate">
    </asp:boundfield>
    <asp:boundfield DataField="Due Date" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Due Date" ReadOnly="True" SortExpression="Due Date">
    </asp:boundfield>
    <asp:templatefield>
    <ItemTemplate>
    <asp:TextBox runat="server" id="comments" Text='<%# Bind("comments") %>'/>
    <asp:LinkButton runat="server" Text="Approve" id="Button1" CommandName="Update" CausesValidation="False" />
    <asp:LinkButton runat="server" Text="Reject" id="Button2" CommandName="Delete" CausesValidation="false"/>
    </ItemTemplate>
    </asp:templatefield>
    </Columns>
    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <PagerStyle HorizontalAlign="Center" BackColor="#284775" ForeColor="White" />
    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <EditRowStyle BackColor="#999999" />
    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    </asp:GridView>
    </asp:Content>

    Hi,
    you have multiple options here:
    1) upload as a script:
    a) save the statements in a file
    b) go to sql workshop > sql scripts
    c) upload script and run the script
    2) run the script line by line in the sql commands window directly:
    a) go to sql workshop > sql commands
    b) copy all statements there
    c) highlight the first statement with the mouse
    d) click "run" or press <ctrl>+enter
    3) use sql developer
    a) go to http://www.oracle.com/technology/products/database/sql_developer/index.html
    b) download and install
    c) connect to XE
    d) run the statements there
    Regards,
    ~Dietmar.

  • Publish User Cert to AD after the fact

    Hello all!
    I was wondering if its possible to have the CA attempt to re-publish certs to AD after the fact (cert was already issued and an attempt was made to publish but failed) ?
    Background - We didnt have our CA computer account in the "Cert Publishers" Group in our user domain. This led to event 80 being populated in the CA (Unable to publish to AD due to insufficent permissions)
    I added our CA into that group and publishing to AD is working well but ONLY FOR NEW CERTS...
    How do i tell the CA to attempt to publish the cert to AD for the already issued certs (Many...about 1000)
    Thanks!

    I have accomplished my goal with the help of some VBS.
    In a nutshell, this is the process i used
    1) I first needed to create a text file containing serial numbers of the certificates i wanted to get imported into the User's AD Account (userCertificate). In my case there was about 1500 so this needed an automated way. This is the command i used to create
    this text file
    certutil -view -restrict "Disposition=20,CertificateTemplate=1.3.6.1.4.1.311........" -out SerialNumber > c:\Temp\Serials.txt
    Disposition=20 Means Certificates that are Issued
    CertificateTemplate=1.3.6.1.4.1.311........ Means the Custom Certificate Template OID that i am interested in
    -out SerialNumber Means Output just the serial number
    2) My next step was a need to take these serial numbers and somehow generate CER files for every one of them. I wrote a VBS script to parse through the above Serial Number text file and issue a command for every instance found. This is the command i used
    from within the VBS file to generate a CER for the serials
    oShell.Run ("%comspec% /c certutil -view -restrict ""SerialNumber=" & Values(1) & """ -out RawCertificate > c:\Temp\" & Values(1) & ".cer", 0 , True)
    %comspec% /c allows the output of oShell.Run to be piped into a file
    -restrict ""SerialNumber=" & aValues(1) & """ Means i am filtering the view to be limited/restricted to 1 certificate based on the serial number (Values(1)) is the serial number obtained from parsing 1 line of the Serials.txt File
    -out RawCertificate Means spit out a Base64 Encoded blob and then pipe that to c:\Temp\" & Values(1) & ".cer (Once again the Values(1) refers to the parsed serial number. The file would look something like C:\Temp\1a2b3c4d5e6f1a2b.cer
    3) I am now at a point where i have a directory (C:\Temp) full of CER files (my case was about 1500). I now need to import all of those CER files into Active Directory. The UPN is included in the certificate so when the command is issued, the certificate
    is placed into the correct user's store without any additional modifications required. Once again i wrote a simple VBS script to Iterate through a Directory and for each file found run this command
    oShell.Run ("%comspec% /c certutil -dspublish " & objFile.Path & " User", 0 , True)
    certutil -dspublish Means Publish the file into AD
    objFile.Path is the path to the individual CER file in the C:\Temp Directory
    User instructs certutil to Publish the CER file to an Active Directory User (Obtained from the UPN attribute in the cert)
    If anybody has any questions, or would like to request the individual VBS files, PM me anytime.
    Thanks Fredrik for your assistance

  • HT1824 Since I accidentally clicked on the wrong language, I don't know what my IPOD Nano is telling me to do/not to do.  I'm hitting the home button and nothing is happening.

    Hello,
    Bought a Nano today and trying to set it up.  Selected the wrong language.  I am not sure if I'm getting the "eject before disconnecting message" and I'm not sure what to do next!

    Hello sheri85,
    Thank you for using Apple Support Communities.
    For more information, take a look at:
    iPod: Changing the display language
    http://support.apple.com/kb/ht1824
    If you have an iPod nano or Fifth Generation iPod (iPod with video):
    Scroll down to the last menu option but don't select it.
    Scroll up one menu item. This should be Settings.
    Press the Center (Select) button. This takes you to the Settings menu.
    Scroll down to the last menu option but don't select it; in English, this is the "Reset All Settings" option.
    Scroll up to the third menu item from the bottom one. This should be Language.
    Press the Center button to select Language.
    Select your preferred language from the list.
    Have a nice day,
    Mario

  • Why do i have more than one "Sites" cert after updateing and expired cert.Can i delete the expired cert?????

    Hi After getting the below message i updated my cert but now have 3 of the same certs? Can i delete the expired cert?????
    There is no valid SMTP Transport Layer Security (TLS) certificate for the FQDN of SERVER.domainname.local. The existing certificate for that FQDN has expired. The continued use of that FQDN will cause mail flow problems. A new certificate that contains the
    FQDN of SERVER.domainname.local should be installed on this server as soon as possible. You can create a new certificate by using the New-ExchangeCertificate task.
    I used "Get-ExchangeCertificate | Select CertificateDomains,Thumbprint,Status,Services | fl"
    to see which cert was expired
    I used "Get-ExchangeCertificate –Thumbprint 91D4C277BE4DF5FA15FC76D936375B7766ABCC23 | New-ExchangeCertificate" to replace the expired cert
    I re-ran "Get-ExchangeCertificate | Select CertificateDomains,Thumbprint,Status,Services | fl"
    to see if it had worked
    but now i have two certs one expired the other not. Can i delete the expired cert?????

    Hi 
    Yes you can delete the expired certificate which are showing  as it is not functional anymore and they remain as stale entries 
    You can use  below command
    Remove-ExchangeCertificate -Thumbprint "specify the value "
    Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you Check out my latest blog posts on http://exchangequery.com

  • I used the wrong ID for iCloud on my iphone 5. It is linked to an email that no longer exists. Do I have to delete my iCloud completely and set it up all over again?

    I used the wrong ID for iCloud on my iphone 5. It is linked to an email that no longer exists. Do I have to delete my iCloud completely and set it up all over again?

    You can change the linked email/sign in email for your iCloud and Apple ID accounts from 1 site,
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    Go to Manage your Apple ID
    Sign in with your current creditals
    On the left, click Name, ID and Email Addresses
    Under Apple ID and Primary Email Address, click Edit
    Type in your new Email.
    Go to Apple ID, click Edit
    Type in your new Email

  • Got a iphone set the apple id n it was the wrong email address now i can't verifie it how do i delete and start over

    got a iphone set the apple id n it was the wrong email address now i can't verifie it how do i delete and start over

    Welcome to the Apple Community.
    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")
    When you delete your account, all the data that is synced with iCloud will also be deleted from the device (but not from iCloud), but will be synced back to your device when you login again.

  • My iCloud account was set up using the wrong email, and I can't delete the wronge account

    I had a friend help me set up my phone and she set up my iCloud account for me. But she got my email wrong. Instead of [email protected], it's [email protected] I don't have the password, and I can't delete the iCloud account without the password, but I can't get the password because it sends it to the wrong email. Is there a way to delete the iCloud account without the password?

    Your appleid can be any email address you want, its the e-mail BEHIND it that matters. So if you dont have your verizon email address anymore that should still be ok. Goto http://appleid.apple.com/ and click on manage account, login to your OLD WORKING appleid, and change your email to match your new email address

  • Creating new projects from old ones without deleting the wrong audio files!

    We did a piano & vocal recording session recently and recorded about a dozen songs. Voice audio files and midi (pianoteq) for piano. At the moment these are organised into three projects according to genre - classical, showtunes and jazz standards. I now want to get each song into its own separate project but while I need to avoid duplicating too many audio files, I'm also scared to death of deleting anything!
    Can someone please walk me through how I do this? I THOUGHT I knew and then a dialogue box (thankfully!!) flashed up saying something like, "Are you sure you want to delete these files they are shared by other projects?"
    I basically want to "save as" one of the large projects, rename it according to the song title and then delete the other songs from the Arrange. I thought I could then "select unused" in the Audio Bin and it would be cool because the original audio would be in the old (renamed) project . . . but I seem to have that wrong? Or I've missed a step?
    Hopefully someone can shed some light!

    Open the song. Cut the tracks at the appropriate places. Name the newly created regions with the correct song names. Select all the regions and then the command that turns the regions into new individual audio files. After the files are written, go into the audio bin and select unused. Delete unused. Save as (without resources) "Master Song". Then I'd delete all but the first pair of tracks from the arrangement. In the audio bin select unused again then delete. Logic will dump the unused parts out of the audio bin without deleting them from the drive. save as "First song" Re-open the master song and do this again with the second set of tracks.......

  • I registered the wrong information for my iCloud account--I misspelled and now want to change it.  Help is needed to delete the account and start anew.

    I registered the the wrong information for my iCloud account--I misspelled the account name.  I accidentally spelled blackberry instead of blackbird.  How can I change this?

    If you don't want to use an alias you'll have to create a new account as you cannot change the @icloud.com address once created.  You'll have to create a new ID, verify the ID, then use the ID to create the new account, and migrate your iCloud data to the new account.
    If you are currently syncing data with iCloud, begin by saving any photo stream photos to your camera roll as mentioned above.  If you are syncing Notes with iCloud, you'll also need to open each of them and email them to yourself so they can be recreated in the new account.  Finally, if you are syncing any iWork documents with iCloud, turn off iCloud syncing in your iWork app settings.
    Then go to Settings>iCloud, tap Delete Account, and choose Keep on My iPhone when prompted.  Then in Settings>iCloud tap Get a Free Apple ID at the bottom, set up your new ID, verify the email address you use to create it by responding to Apple's verification email, then sign in with the new ID to create your new account.  Turn on your iCloud sync settings and choose Merge when prompted to upload your data to the new account.  When you turn Mail to On you will be prompted to create your new @icloud.com email address.  Be carefull to type it correctly as it cannot later be changed.

  • Skip the DELETE command on logical standby

    Hi All,
    I want to skip the DELETE command on logical standby.
    DB Version - 10.2
    OS - Linux
    Primary DB and logical standby DB .
    In our DB schema some transaction tables. We delete data from those tables by delete commands.
    Delete command, also delete data from logical standby DB. But we want to skip on logical standby DB .
    I use following for that and get error.
    ALTER DATABASE STOP LOGICAL STANDBY APPLY;
    EXECUTE DBMS_LOGSTDBY.SKIP (stmt =>'DELETE TABLE', schema_name =>'TEST',object_name =>'TRANS',proc_name => null);
    ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
    But I got error
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'SKIP'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    When I change stmt =>'DELETE TABLE' to stmt =>'DML', no error happen
    Please help me to solve this issue . This is urgent.
    Thanks in advance.
    Regards

    Dear aditi2,
    Actually it is so simple to understand the problem. Please read the following documentation and try to understand the SKIP procedure.
    http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/d_lsbydb.htm#997290
    *SKIP Procedure*
    Use the SKIP procedure to define filters that prevent the application of SQL statements on the logical standby database.
    By default, all SQL statements executed on a primary database are applied to a logical standby database.
    If only a subset of activity on a primary database is of interest for application to the standby database,
    you can use the SKIP procedure to define filters that prevent the application of SQL statements on the logical standby database.
    While skipping (ignoring) SQL statements is the primary goal of filters,
    it is also possible to associate a stored procedure with a DDL filter so that runtime determinations can be made whether to skip the statement,
    execute this statement, or execute a replacement statement.
    Syntax
    DBMS_LOGSTDBY.SKIP (
         stmt                      IN VARCHAR2,
         schema_name               IN VARCHAR2,
         object_name               IN VARCHAR2,
         proc_name                 IN VARCHAR2,
         use_like                  IN BOOLEAN,
         esc                       IN CHAR1);Hope That Helps.
    Ogan
    Edited by: Ogan Ozdogan on 30.Tem.2010 13:03

  • New Bootmgr for my Thinkpad needed [Old: RnR - Can't find the delete command for older Rescue's]

    EDIT: Read my Reply to see my new much greater problem...
    Hey,
    I recently Updated my Thinkvantage software after a few month and now have gotten the toolbox. There came the Problem up, that i Used RnR the last time like 1 Year ago, which couldn't be.
    I messed around a bit (i only had 50 GB free space and my old recovery file was another 23GB) and startet the rescue giving the new rescue file a maximum of 60 BG, so i have 10 GB free.
    It said, that this might not be enough but i could just give it a try, now i sit at 0GB free, my PC is slow as Hell and so on, i canceled the rescue and deleted some of my files.
    Now I'd like to know how i can delete the Rescue files (the dropdown menu with delete rescue file is gone through the update, so i cannot follow the instruction of the help page), so i have more free space available.
    Also i'd like to know if i then should try another rescue, hoping it fits on the then 70 GB free space (i stopped the rescue this time at about 50%)
    or should i just try my best and get my data on some other volume wich unfortunatelly i don't have with me, as im in another country...
    hope you got all Informations to help me and thanks for your Support
    John
    PS: if it's of importance it's a t500 with 2055A81 with 250 GB storage

    answering to myself with a now much bigger problem:
    1. what happend?
    I just wanted to set back the computer thinking it might run faster again...
    So i started the Thinkpad Recovery(RnR), it rebooted into the thinkvantage RnR Boot mode where it began to recover but stopped after 1 Minute at 0% recovery and didn't get any further in the next 4 Hours (with CPU and HDD idling all the time), as there was no option to stop it and no settings or something i thought it wouldn't do anything at all anymore and switched it off by force...
    ... restart: Bootmgr is missing press Ctrl + Alt + Del to reboot
    2. first analysis:
    i can get into Bios, i can boot from the CD, i cannot enter the Thinkpad OS (via pressing the Thinkvantage Button on startup) and i can't run Windows
    3. Googlin' around
    i found this Artikle from http://www.howtogeek.com/howto/windows-vista/fixin​g-bootmgr-is-missing-error-while-trying-to-boot-wi​..., followed the instruction downloaded the recovery CD, was able to boot from it and tryed to follow the Guide, but on the 4th Picture it didn't show my installed Windows looked around further and further and found:
    http://neosmart.net/wiki/display/EBCD/Recovering+t​he+Vista+Bootloader+from+the+DVD
    trying it out I had success with the Nuclear Holocaust way, so I now atleast can find my Windows in the recovery tool, but still the System-startup-repair was detecting my error but unable to fix it (Error: Botmanager doesn't exist or is damaged; Tried to fix the file with Filerepair; Conclusion Error. Errorcode = 0x2)
    I even found http://forum.notebookreview.com/showthread.php?t=2​12433, where there is a link to the Lenovo/Thinkpad tool with wich I possibly can retrieve something, but my laptop just doesn't have any Floppy drive (i also tried the file uploaded to rapidshare in this thread, which was the diskette but bootable via CD-Rom (didn't work as it seems to be set to drive A: and so i can't repair anything with it))
    4. Conclusion
    - maybe I'm pulling at the wrong end of the rope (http://neosmart.net/blog/2007/bootsectexe-modifies​-the-bootsector-not-the-mbr/)
    - ( http://forums.cnet.com/5208-7587_102-0.html?thread​ID=311230 ) maybe this guy is right and RnR from the thinkpad just wipes your boot files so there is too much damage to fix it
    Should I try to
    a) secure as many Files as possible? (booting with Knoppix(Live Linux Filesystem on Bootable CD)  did not work at all, but maybe i had an too old version)
    b) try to somehow get the RnR from the thinkpad to run again, so it might completely reset the PC to it's former state (No Idea how to do it)
    c) I read somewhere you can launch your installed Vista in safety-mode with a propper CD/DVD, even without the Bootmgr, has anyone Experience with that?
    TIA for any help you can offer me, i don't have the time to send in my laptop, would be great if someone from your developers could write me a little batch file, that i could run via the CMD (i can easily access my USB stick via the CMD provided by the Windows Vista recovery Disk) and which would well give me back the boot entrys that RnR deletes at the beginning or just creates a new one. Something that could remotely start the RnR to just bring back the old state could also work wonders, i used the Option, where you don't have to reinstall all programs, so maybe the RnR which also resets my installed programs would work well and fix the problem...
    I realy hope you guys can help me out as I'm in dire need
    Yours sincerely
    John

  • Client wanted  to delete the document created with the wrong GL with the WB

    Dear All,
    The user had by mistake posted the the document in a wrong GL with with WBS element under the Project.
    We have tried to reverse it through a reversal posting. But it could not be done.
    Client wanted  to delete the document created with the wrong GL with the WBS element.
    How this can be set right?
    Please advice.
    Regards
    Bijudas

    document cannot be deleted in SAP
    reverse the document and then report

  • Client wanted to delete the document created with the wrong GL with the WBS

    Dear All,
    The user had by mistake posted the the document in a wrong GL with with WBS element under the Project.
    We have tried to reverse it through a reversal posting. But it could not be done.
    Client wanted to delete the document created with the wrong GL with the WBS element.
    How this can be set right?
    Please advice.
    Regards

    document cannot be deleted in SAP
    reverse the document and then report

  • Understanding the dataadapter.delete command

    I'm new to ADO and ODP so forgive me if I'm missing the obvious. I want to do a simple delete from the database. The problem is I feel like I have to issue the delete command twice. The code I've posted blow works but I don't understand why. I create two commands one a select command the second a delete command. I apply these commands to a dataadapter and then use dataadapter .fill() to get a dataset.
    Great it works fine up to this point. The problem was when I called dataadapter.update nothing would happen. The delete command was ignored. So I looped through the resulting dataset and deleted the record from there. Then I called dataadapter.update and it worked. I tried not setting the dataadapter.deletecommand but then update failed.
    Now my question is: Is it always necessary to delete from a dataset as well as issue a delete command or is there a way of issuing just one delete command? Is it possible to simplify my code?
    Any suggestions or help greatly appreciated.
    Drew
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Dim oradb As String = "Data Source=vulcan.world;User Id=adowling;Password=aragon;"
    Dim conn As New OracleConnection(oradb)
    Dim cmd As New OracleCommand
    Dim cmd2 As New OracleCommand
    Dim orada As New OracleDataAdapter
    Dim dsLog As New DataSet
    Dim drDelete As DataRow
    Dim myCol As DataColumn
    Dim dcPK(1) As DataColumn
    Dim i As Integer
    Dim rc As DataRowCollection
    Dim pSDEWorkspace As IWorkspaceFactory2
    Try
    conn.Open()
    cmd.Connection = conn
    cmd.CommandText = "select * from t.reconcile_log"
    cmd.CommandType = CommandType.Text
    orada.SelectCommand = cmd
    cmd2.Connection = conn
    cmd2.CommandText = "delete from t.reconcile_log where objectid = " + TextBox1.Text
    cmd2.CommandType = CommandType.Text
    orada.DeleteCommand = cmd2
    orada.Fill(dsLog, "Reconcile_Log")
    orada.MissingSchemaAction = MissingSchemaAction.AddWithKey
    myCol = dsLog.Tables("Reconcile_Log").Columns.Item(dsLog.Tables("Reconcile_Log").Columns.IndexOf("OBJECTID"))
    dcPK(0) = myCol
    dsLog.Tables("Reconcile_Log").PrimaryKey = dcPK
    drDelete = dsLog.Tables("Reconcile_Log").Rows.Find(TextBox1.Text)
    drDelete.Delete()
    orada.Update(dsLog, "Reconcile_Log")
    ListBox1.Items.Clear()
    rc = dsLog.Tables("Reconcile_Log").Rows
    For i = 0 To rc.Count - 1
    ListBox1.Items.Add(Convert.ToString(rc.Item(i).Item(0)) + " " + rc.Item(i).Item(1) + " submitted " + rc.Item(i).Item(2) + " on " + rc.Item(i).Item("submitted"))
    Next i
    Catch ex As OracleException
    Select Case ex.Number
    Case 1
    MessageBox.Show("Error attempting to insert duplicate data.")
    Case 12545
    MessageBox.Show("The database is unavailable.")
    Case 904
    MessageBox.Show("invalid type")
    Case Else
    MessageBox.Show("Database error: " + ex.Message.ToString())
    End Select
    Catch ex As Exception
    MessageBox.Show(ex.ToString)
    Finally
    conn.Close()
    conn.Dispose()
    End Try
    End Sub

    Because the dataset is disconnected from the database. This allows you to load some data (into your dataset), disconnect from the network or whatever, make whatever changes you like and have none of this affect the data in the database until you issue the update.
    If you actually want to have your changes applied immediately then you can (assuming your application is constantly connected of course). Don't bother with a dataset/data adaptor at all. For example set up the sql select statement, assign it to a reader, execute the reader, store the rows returned in some custom objects or whatever. Make some changes and then use executeNonQuery to apply the updates, either one at a time or as a batch using array binding. There is a samples folder where you installed ODP.NET, have a look at some of the others.

Maybe you are looking for

  • How to maintain PDF links when viewed in Apple Mail

    Hi All I've created a single page promo flyer in InDesign which has an email and a web link at the foot of the page. The flyer is to be distributed to clients as a PDF attachment via Apple Mail. The PDF has been created from the InDesign doc and the

  • This Device cannot find enough free resources that it can use (error 12)

    I have been using Hyper-V to test parts of my deployments in sccm 2012 r2 for some time now, and yesterday, they would not complete. Turns out the error in the topic is what is causing it. See below for a screenshot in devmgmt of the error causing th

  • Payment Plan

    My membership renews June 11, 2014.  I pay monthly, presently, but I want to pay annually, if it is cheaper.  How do I proceed?

  • How do i convert to pdf?

    how do i convert to pddf?

  • I want to boot windows 8.1 x64

    i want to boot windows 8.1 x64,using usb,i made usb bootable by using Windows 7 USB DVD Download Tool,but it failed to make it bootable ,giving error of bootsect.i put bootsect.exe in Windows 7 USB DVD Download Tool folder..than usb was bootable but