OracleDataAdapter, OracleCommandBuilder and DBConcurrencyException.

Hello,
I am having some issues with the OracleDataAdapter.Update method. If I use OracleCommandBuilder to dynamically create the update command, I have no problems and it works as expected.
But if I explicitly create the Update command and set the OracleDataAdapter.UpdateCommand property the code always throws a DBConcurrencyException.
I am testing this with an extremely simple 2 column test table (id, name) so Im sure the sql itself is ok!
Any advice?
Thanks,
Adam

..this method works:
     public void BuilderUpdate(DataSet set)
string constr = "xxx";
string cmdstr = "select id, name from test";
OracleDataAdapter adapter = new OracleDataAdapter(cmdstr, constr);
OracleCommandBuilder builder = new OracleCommandBuilder(adapter);
adapter.Update(set, "Test");
..and this method always throws exception:
     public void CommandUpdate(DataSet set)
string constr = "xxx";
OracleConnection conn = new OracleConnection(constr);
OracleCommand updateCommand = new OracleCommand("update test set name=:i_name where id =:i_id", conn);
OracleParameter updateIdParam = new OracleParameter("i_id", OracleDbType.Int32);
updateIdParam.SourceVersion = DataRowVersion.Current;
OracleParameter updateNameParam = new OracleParameter("i_name", OracleDbType.Varchar2);
updateNameParam.SourceVersion = DataRowVersion.Current;
updateCommand.Parameters.Add(updateNameParam);
updateCommand.Parameters.Add(updateIdParam);
OracleDataAdapter adapter = new OracleDataAdapter();
adapter.UpdateCommand = updateCommand;
adapter.Update(set, "Test");
Edited by: user10422769 on Dec 7, 2008 6:00 PM

Similar Messages

  • OracleDataAdapter.Update and ReturnProviderSpecificTypes

    Hello,
    I selected data to dataTable due to OracleDataAdaper with ReturnProviderSpecificTypes setted to true. I change some rows in this DataTable, so theirs RowState is Modified.
    Then I create new OracleCommandBuilder with this adapter a then I want to execute update. But Oracle trow this DBConcurrency exception
    "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.
    If I use ReturnProviderSpecificTypes setted to false, it's OK.
    Help please, thanks .... ondra
    OracleDataAdapter oraAdapter= new OracleDataAdapter("select * from ADRVIP", this.conn);
    oraAdapter.ReturnProviderSpecificTypes = true;
    DataTable table = new DataTable();
    this.conn.Open();
    oraAdapter.Fill(table );
    // change some rows in table
    OracleCommandBuilder cmdB = new OracleCommandBuilder(oraAdapter);
    oraAdapter.Update(table);
    this.conn.Close();

    Does your table consist of Primary Key or Unique Kry?
    Ming Man

  • OracleDataAdapter.Fill and arithmetic overflow exception

    Hi to all!
    In my ASP.NET 2.0 web-application I use ODP.NET to working with Oracle DB. When I execute a pipelined stored procedure an "Arithmetic pverflow exception" occures. Here is exception stack trace:
    в Oracle.DataAccess.Types.DecimalConv.GetDecimal(IntPtr numCtx)
    в Oracle.DataAccess.Client.OracleDataReader.GetDecimal(Int32 i)
    в Oracle.DataAccess.Client.OracleDataReader.GetValue(Int32 i)
    в Oracle.DataAccess.Client.OracleDataReader.GetValues(Object[] values)
    в System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetValues(Object[] values)
    в System.Data.ProviderBase.SchemaMapping.LoadDataRow()
    в System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
    в System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
    в System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
    в System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
    в System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
    в System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
    If I call this stored procedure from SqlNavigator it works properly. Hovewer I see that the data of one column of result cursor looks like 55,58554033940333204184424641611784101. If I round data of this column, the Fill method of OracleDataAdapter works without any exceptions. How can i solve this problem?
    Edited by: yoyoseek on Sep 3, 2008 2:09 AM

    Hi
    The reason you are seeing this, is because Oracle Number has a greater precision than .NET Decimal.
    There are a couple of ways out:
    * Convert manually to_char instead of number out.
    * Using OracleDataAdapter.SafeMapping, described here http://stanford.edu/dept/itss/docs/oracle/10g/win.101/b10117/features009.htm
    * Round down to the precision of .NET decimal before returning.
    Morten
    Edited by: gulhaugen on Sep 3, 2008 1:43 PM

  • DataadapObject reference not set to an instance of an object in VB,NET 2003

    Huge problem, please help!
    Just installed ODT 10.1.4 and must have done something wrong. Don't know enough to be able to correct on my own.
    In VB, after install, new OracleDataAdapter, OracleConnection, OracleCommandBuilder and OracleCommand items appeared in toolbox. Tried dropping an OracleDataAdapter on the form. Immediate error in Microsoft Development Environment dialog box: Object reference not set to an instance of an object. I've tried the following:
    Updated References to include Oracle.DataAccess
    Updated Imports list to include Oracle.DataAccess and Oracle.DataAccess.Client

    Sorry, pressed wrong button. To continue:
    I've tried to drop on an existing form with an MS OracleDataAdapter already on it and a fresh form with nothing on it. The form designer will handle the other three objects (connection, commandbuilder and command) without complaint.
    Though I haven't tried to execute, adding an oracledataadapter in code seems to work -- at least no errors, and code completion does what is expected.
    What am I missing? I need that data adapter (unless someone can tell me how to get past the bug in the MS provider that produces data overflow when trying to handle Oracle type NUMBER) and am on a very very very tight deadline.
    HELP!!!!
    Thanks for anything that might work.
    Eric

  • Oracle Lite & CF 2

    Hi
    Does Oracle Lite work with an C# CF2 PocketPC Application ?
    And what about licensing? Is it free or will it cost something ?
    Thanks for helpand informations!

    Hi, the licensing was previosly done on per-client basis, but afaik the conditions have changed in the late summer and some kind of processor-license is required now, which makes Oracle Lite uneconomic in some small settings... so it's not free at all.
    to the CF2 - unfortunatelly Oracle does not provide CF2 class library yet, but only CF1 library, which can be of course used from CF2 application. There's one catch in using Oracle ADO.Net CF1 assembly from CF2 code - it's not possible to work with some classes (OracleDataAdapter mainly) in the ADO-generic way = using the generic IDataAdapter interface etc, because there are some casting problems between Oracle CF1 assembly and CF2 System.Data assembly - it's not fully compatible. So, if you plan to use directly the final Oracle classes (OracleCommand, OracleDataAdapter, etc) and not the generic ones (IDataCommand, IDataAdapter, etc.), there're no problems. If you'd like to go the generic way and write your application independently on concrete database engine, it's a little trickier. I managed to make it with writing some intermediate classes, which wrap the Oracle classes so as it's possible to cast them to their ancestor base classes. I can post the code here, if you're interested...

  • Oracle.DataAccess.Client.OracleDataAdapter exists in both v2 and v4

    Hi there,
    I am developing ASP Net application with ODP.NET 11.2.0.2.1 and VS 2010. The target framework is .Net framework 3.5 and I've explicitly Oracle.DataAccess reference to v.2, with
    <add assembly="Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89B483F429C47342"/>
    , but when it compiled, it throw error
    The type 'Oracle.DataAccess.Client.OracleDataAdapter' exists in both
    'c:\WINDOWS\assembly\GAC_32\Oracle.DataAccess\2.112.2.0__89b483f429c47342\oracle.dataaccess.dll'
    and 'c:\WINDOWS\Microsoft.NET\assembly\GAC_32\Oracle.DataAccess\v4.0_4.112.2.0__89b483f429c47342\oracle.dataaccess.dll'     
    c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\esptweb\df172a69\e974c60e\App_Code.eoge0t0f.4.cs
    How can I fixed it?
    Thanks for the help.

    Did you try adding that reference using the Add Reference command in Visual Studio instead? I've never seen it behave like this before.
    There are two versions of the assembly, but it shouldn't be trying to load the .net 4 version if you have a reference to the .net 2 version and you're in a 2 (or 3.5) app.

  • OracleDataAdapter and multiple datasets

    Hello
    I'd like to ask, does each dataset need its own data adapter? I'm implementing application which has a lot of datagridviews, and I wonder how to use adapter. Is it possible to have two datasets and use following scenario: fill first dataset, bind it to datagridview, then using the same adapter fill second dataset and bind it to datagridview, and after then call adapter.update for first dataset and then for second dataset - all using only one adapter. Is it possible or not?
    Thanks for advice.

    does each dataset need its own data adapter?no
    Is it possible to have two datasets and use following scenario:
    fill first dataset, bind it to datagridview, then using the same adapter
    fill second dataset and bind it to datagridview, and after then call
    adapter.update for first dataset and then for second dataset -
    all using only one adapter. Is it possible or not?yes
    Cheers,
    NH

  • OracleDataAdapter and DataSet

    I'm beginner with ODT for VS .NET.
    I can't add Oracle data adapter to dataset generated previously. As s result I have dataset that contains only one datatable. Oracle Connection is inaccessible from dataset designer or from dataset configuration vizard. How can I add in the dataset more than one datatable as it can be done with Oracle data provider for OLE DB?
    Sincerely
    Eugene V. Buzin.
    October 4.2006.

    Dear all,
    I also followed now that discussion. I did it like explained above. Now I have a dataset with all the relations, but with no connection to the database. If I run this testform, both dataGridViews where displayed in a Master/Detail way, showing all columns but without data on it.
    When debugging I found out, that there are no more commands in the auto-generated code which connect to DB. Also in the dataset-View I cannot configure these tables anymore ( I can add columns, but not configure )
    So is this realy the best way to combine the OracleDataProvidor with MS-Visual Studio 2005 ??
    If it is, I guess most of the programmers will decide for the MS-Driver for Oracle, because it is much easier to handle.
    I am looking now for more then 3 weeks for a solution, also read Mark A. Williams "Pro .NET Oracle Programming" which was useful, but could not answer questions concerning the "read doing" in Visual-Studio 2005.
    Please, does anybody have more detaild info how to work best with OracleDataProvidor inside VS2005.
    thank you sooo much.

  • Oracle.DataAccess.Client.OracleDataAdapter.Update not working

    Hi
    I am using the Oracle.DataAccess.Client.OracleDataAdapter from Oracle.DataAccess runtime version v4.0.30319. I set the SelectCommand and retrieve data from Oracle without any problems using the adapter to fill a datatable. I then use the DataTable.Clear method to remove all rows and fill it again from a different source using a different adapter. I use the Oracle.DataAccess.Client.OracleCommandBuilder to create the Insert and Update commands and finally I call the update command of the using the original adapter in order to update the Oracle database but nothing is updated.
    I examine the table row count at each stage and also display the table using a DataGridView on a form and all appears to be fine. No exception is thrown so I am stumped.
    I would be grateful for any suggestions as to what I am doing wrong.
    My environment is VS2010 Express
    Edited by: user1947494 on 04-Feb-2011 05:46

    Hi,
    Pretty tough without seeing any code. I really do not believe it has anything to do with the DataAdapter. What changed the specific row/rows after the second fill?
    But, as a guess, take a look at the DataTable - Rows - RowState. Run the below(or some variant) method just prior to your update.
    r,
    dennis
           public static DataTable GetDataTableChanges_Modified(DataSet dataSet, string dataTableName)
                if (dataSet.Tables[dataTableName].Rows.Count > 0)
                    DataTable dt = dataSet.Tables[dataTableName].Clone(); ;
                    int c = 0;
                    foreach (DataRow r in dataSet.Tables[dataTableName].Rows)
                        DataRowState state = r.RowState;
                        switch (state)
                            case DataRowState.Modified:
                                DataRow anewrow_dr = dt.NewRow();
                                anewrow_dr.ItemArray = r.ItemArray;
                                dt.Rows.Add(anewrow_dr);
                                c = c + 1;
                                break;
                            default:
                                break;
                    if (c > 0)
                        return dt;
                    else
                        return null;
                else
                    return null;
            }

  • ODP OracleCommandBuilder. Updating a table including DATE columns.

    Hi
    I have a problem with the OracleCommandBuilder not creating the correct update commands when I have DATE type columns in the table.
    I have created a test table (called DATETEST) with three columns:
    STRINGCOLUMN     VARCHAR2 10
    DATECOLUMN DATE
    NUMBERCOLUMN     NUMBER
    The STRINGCOLUMN is the primary key.
    Then I created a typed dataset that looks like this:
    STRINGCOLUMN     string
    DATECOLUMN string
    NUMBERCOLUMN     long
    This is the XML schema for the typed dataset:
    <?xml version="1.0" encoding="utf-8" ?>
    <xs:schema id="DateDS" targetNamespace="http://tempuri.org/DateDS.xsd" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns="http://tempuri.org/DateDS.xsd" xmlns:mstns="http://tempuri.org/DateDS.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
         <xs:element name="DateDS" msdata:IsDataSet="true">
              <xs:complexType>
                   <xs:choice maxOccurs="unbounded">
                        <xs:element name="DATETEST">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="DATECOLUMN" type="xs:string" minOccurs="0" />
                                       <xs:element name="STRINGCOLUMN" type="xs:string" minOccurs="0" />
                                       <xs:element name="NUMBERCOLUMN" type="xs:long" minOccurs="0" />
                                  </xs:sequence>
                             </xs:complexType>
                        </xs:element>
                   </xs:choice>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    And this is the test code:
    Dim connection As Oracle.DataAccess.Client.OracleConnection
    Dim adapter As New Oracle.DataAccess.Client.OracleDataAdapter()
    Dim dbCommand As New Oracle.DataAccess.Client.OracleCommand()
    Dim sqlstring As String
    Dim data As New DateDS() 'Typed dataset
    Const ConnectionString As String = "User Id=............."
    Try
    'Connect to database
    connection = New OracleConnection(ConnectionString)
    connection.Open()
    'Get data from table DATETEST
    dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN) AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
    dbCommand.Connection = connection
    adapter.SelectCommand = dbCommand
    adapter.Fill(data, "DATETEST")
    'Make changes to dataset
    data.DATETEST(0).DATECOLUMN = Now()
    data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
    'Update database
    sqlstring = "SELECT * FROM DATETEST"
    adapter.SelectCommand = New OracleCommand(sqlstring, connection)
    Dim custCB As New Oracle.DataAccess.Client.OracleCommandBuilder()
    custCB.DataAdapter = adapter
    adapter.Update(data, "DATETEST")
    'Disconnect
    connection.Close()
    connection.Dispose()
    Catch exc As Exception
    MessageBox.Show(exc.Message)
    End Try
    Getting the data from the database is not a problem.
    The dataset contains the correct information.
    But updating the database is impossible.
    I get errors like:
    ORA-01861: literal does not match format string
    And if I don't specify a DATE format in the TO_CHAR statement I get this error:
    Concurrency violation: the UpdateCommand affected 0 records.
    I think I've tried everything.
    I've used the OracleGlobalization class, with the SetSessionInfo method.
    I've tried all different types of date conversions to make sure that
    the date format on the database is the same as in the dataset.
    I've tried to change the NLS parameters on the DB server and in the registry on the client.
    I've tried to change the DATECOLUMN type in the typed dataset from string to Oracle.DataAccess.Types.OracleDate
    But it still doesn't work.
    The default date format on the DB 9i server is AMERICAN,(DD-MON-RR).
    A strange thing is that when I instead of using the ODP classes use
    the System.Data.OracleClient and its OracleCommandBuilder
    the code works perfectly without any errors.
    This is the test code that works:
    Dim connection As System.Data.OracleClient.OracleConnection
    Dim adapter As New System.Data.OracleClient.OracleDataAdapter()
    Dim dbCommand As New System.Data.OracleClient.OracleCommand()
    Dim data As New DateDS()
    Dim sqlstring As String
    Const ConnectionString As String = "User Id=......."
    Try
    'Connect to database
    connection = New System.Data.OracleClient.OracleConnection(ConnectionString)
    connection.Open()
    'Get data from table DATETEST
    dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN,'YYYY-MM-DD HH24:MI:SS') AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
    dbCommand.Connection = connection
    adapter.SelectCommand = dbCommand
    adapter.Fill(data, "DATETEST")
    'Make changes to dataset
    data.DATETEST(0).DATECOLUMN = Now()
    data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
    'Update database
    sqlstring = "SELECT * FROM DATETEST"
    adapter.SelectCommand = New System.Data.OracleClient.OracleCommand(sqlstring, connection)
    Dim custCB As New System.Data.OracleClient.OracleCommandBuilder()
    custCB.DataAdapter = adapter
    adapter.Update(data, "DATETEST")
    'Disconnect
    connection.Close()
    connection.Dispose()
    Catch exc As Exception
    MessageBox.Show(exc.Message)
    End Try
    My experience until this came up is that the ODP provider is better on everything
    than the microsoft Oracle provider so I don't want to switch unless I have to.
    Could someone that have used the ODP OracleCommandBuilder for updating a table including DATE columns with a typed dataset please give me some tips on how to make this work?
    I would be the happiest man on earth if someone had a solution :-)
    Erik

    Don't convert the dates to strings. Ever.
    The command builder uses the metadata returned from the select command to build the insert/update commands. Using to_char in the query tells ODP that that is a varchar2 column. If you omit the to_char the commandBuilder will know to bind a date parameter in that spot.
    Also in your typed dataset you should change the type from a string to a date.
    David

  • Changes commited to the database only after I update OracledataAdapter twice

    Hi. I am using oracledataadapter to manage the data which is eventually displayed in winform datagridview (Visual Studio 2012)
    everything works fine , but I have to click "Save" buttin twice to see the changes in the database (Oracle express 11g)
    Can you please advice....
    Here is my code
    it is very simple
    1. Obtain connection
    2. Create dataadapter
    3. Create commands
    4. Fill the datatable and dataset
    public partial class Concordance : Form
            OracleDataAdapter setupAdapter;
            DataSet projDataset;
            OracleConnection conn;
            //binding sources
            BindingSource setupBindingSource = new BindingSource();
            DataTable setupTable;
            public Concordance()
                InitializeComponent();
                //load tables
                loadSetup();
            //setup table
            private void loadSetup()
                string oradb = ConfigurationManager.ConnectionStrings["OpenU"].ConnectionString;
                conn = new OracleConnection(oradb);
                try
                   // using (conn = new OracleConnection(oradb))
                    setupAdapter = new OracleDataAdapter("select * from ou_setup", conn);
                        OracleCommandBuilder builder = new OracleCommandBuilder(setupAdapter);
                        projDataset = new DataSet("Concordia");
                        setupTable = new DataTable("Setup");
                        projDataset.Tables.Add(setupTable);
                        setupAdapter.Fill(projDataset,"Setup");
                        //bind the gataGridView
                        this.setupGrid.DataSource = projDataset.Tables["Setup"];
                        this.setupBindingSource.DataSource = projDataset.Tables["Setup"];
                        this.setupNavigator.BindingSource = this.setupBindingSource;
                catch (Exception ex)
                    string error = ex.Message;
                    MessageBox.Show(error);
            private void saveSetupBtn_Click(object sender, EventArgs e)
               // only after sabe button clicked for the second time the changes are commited into the database
                this.setupAdapter.Update(projDataset.Tables["Setup"]);
                MessageBox.Show("saved");

    How are you reading in the object initially? The problem is likely that you are modifying an object from the session cache. When you then read in the object from the uow, it uses the object in the session cache as the back up. So there will not appear to be any changes to persist to the database.
    You will need to make a copy of the object for modification, or use the copy from the unitofwork to make the changes instead of working directly on the object in the session. Disabling the cache means there is no copy in the session cache to use as a back up, so the uow read has to build an object from the database.
    Best Regards,
    Chris

  • OracleCommandBuilder bug

    Hello,
    When you uses a OracleCommandBuilder using a DbCommandBuilder variable,
    the Parameters and CommandText for the Insert, Update and Delete commands
    are not created properly, all parameters are created as :p1, :p2, ... and all of them have a string DbType. this code can be usefull to test it:
    if (conn.State == ConnectionState.Closed)
    conn.Open();
    if (conn.State == ConnectionState.Open)
    OracleCommand selectCommand =
    new OracleCommand(selectCommandText, conn);
    DbDataAdapter da = new OracleDataAdapter();
    da.SelectCommand = selectCommand;
    DbCommandBuilder builder = new OracleCommandBuilder();
    builder.DataAdapter = da;
    da.UpdateCommand = builder.GetUpdateCommand();
    da.InsertCommand = builder.GetInsertCommand();
    da.DeleteCommand = builder.GetDeleteCommand();
    }

    IMHO, when it comes to sql statements, it's hard to make it generic. for example, when you want to do pagination, you can simply use LIMIT clause int MySQL but you have to user ROWNUM instead if you're using Oracle.
    Regards.

  • Local MS Access file and SET COUNT

    I have a small app that relies on a local MS Access database file for retrieving and storing information.
    I've used the "Add new data source" wizard in Visual Studio and then I've bound a couple of richtextboxes to the one (1) table in the database file.
    I use this code to let the user save updated text to the file, however it sometimes keeps throwing an error. The code is:
    MyDataBindingSource.EndEdit()
    CustomersTableAdapter.Update(CustomerdatabaseDataSet)
    The error thrown, seemingly at random, but probably occuring when the users edit multiple values, is this: "An unhandled exception of type 'System.Data.DBConcurrencyException' occurred in System.Data.dll". According to http://support2.microsoft.com/kb/310375/en-us
    I should set "NOCOUNT" to OFF instead of ON, but no amount of googling is able to tell me how to do that. I've been all over my code and the queries/code generated by the VS wizard, but I cant find any NOCOUNT setting anywhere.
    Help, please?

    Hello again
    Does this output help? I've also pasted the code I'm using below. Many thanks, really out in the deep end here
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', Skipped loading symbols. Module is optimized
    and the debugger option 'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code'
    is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', Skipped loading symbols. Module is
    optimized and the debugger option 'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll', Skipped loading symbols. Module is optimized and the debugger
    option 'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\rbl\Documents\Visual Studio 2012\Projects\RuBe Ktj\RuBe Ktj\bin\Debug\RuBe Ktj.vshost.exe', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Deployment\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is
    enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll', Skipped loading symbols. Module is optimized and the debugger option
    'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualBasic\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My
    Code' is enabled.
    The thread 'vshost.NotifyLoad' (0x1674) has exited with code 0 (0x0).
    The thread 'vshost.LoadReference' (0x1e80) has exited with code 0 (0x0).
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\rbl\Documents\Visual Studio 2012\Projects\RuBe Ktj\RuBe Ktj\bin\Debug\RuBe Ktj.exe', Symbols loaded.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Remoting\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll'
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms.resources\v4.0_4.0.0.0_sv_b77a5c561934e089\System.Windows.Forms.resources.dll'
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_sv_b77a5c561934e089\mscorlib.resources.dll'
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll'
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_32\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is
    enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just
    My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.Wrapper.dll', Skipped loading symbols. Module is optimized and the debugger option
    'Just My Code' is enabled.
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code'
    is enabled.
    StackTrace: '   vid System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
       vid System.Environment.get_StackTrace()
       vid RuBe_Ktj.Form1.Form1_Load(Object sender, EventArgs e) i C:\Users\rbl\Documents\Visual Studio 2012\Projects\RuBe Ktj\RuBe Ktj\Form1.vb:rad 20
       vid System.EventHandler.Invoke(Object sender, EventArgs e)
       vid System.Windows.Forms.Form.OnLoad(EventArgs e)
       vid System.Windows.Forms.Form.OnCreateControl()
       vid System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       vid System.Windows.Forms.Control.CreateControl()
       vid System.Windows.Forms.Control.WmShowWindow(Message& m)
       vid System.Windows.Forms.Control.WndProc(Message& m)
       vid System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       vid System.Windows.Forms.ContainerControl.WndProc(Message& m)
       vid System.Windows.Forms.Form.WmShowWindow(Message& m)
       vid System.Windows.Forms.Form.WndProc(Message& m)
       vid System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       vid System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       vid System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       vid System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
       vid System.Windows.Forms.Control.SetVisibleCore(Boolean value)
       vid System.Windows.Forms.Form.SetVisibleCore(Boolean value)
       vid System.Windows.Forms.Control.set_Visible(Boolean value)
       vid System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       vid System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       vid System.Windows.Forms.Application.Run(ApplicationContext context)
       vid Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       vid Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       vid Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       vid RuBe_Ktj.My.MyApplication.Main(String[] Args) i 17d14f5c-a337-4978-8281-53493378c1071.vb:rad 81
       vid System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       vid System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       vid Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       vid System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       vid System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       vid System.Threading.ThreadHelper.ThreadStart()'
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualBasic.resources\v4.0_10.0.0.0_sv_b03f5f7f11d50a3a\Microsoft.VisualBasic.resources.dll'
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.resources\v4.0_4.0.0.0_sv_b77a5c561934e089\System.Data.resources.dll'
    A first chance exception of type 'System.Data.DBConcurrencyException' occurred in System.Data.dll
    'RuBe Ktj.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Transactions.resources\v4.0_4.0.0.0_sv_b77a5c561934e089\System.Transactions.resources.dll'
    System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Ohanterat
    undantag</Description><AppDomain>RuBe Ktj.vshost.exe</AppDomain><Exception><ExceptionType>System.Data.DBConcurrencyException, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Simultankörningsfel:
    UpdateCommand inverkade på 0 i stället för 1 poster.</Message><StackTrace>   vid System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
       vid System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
       vid System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
       vid System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
       vid System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable)
       vid RuBe_Ktj.KunddatabasDataSetTableAdapters.KunderTableAdapter.Update(KunddatabasDataSet dataSet) i C:\Users\rbl\Documents\Visual Studio 2012\Projects\RuBe Ktj\RuBe Ktj\KunddatabasDataSet.Designer.vb:rad 1409
       vid RuBe_Ktj.Form1.Button6_Click(Object sender, EventArgs e) i C:\Users\rbl\Documents\Visual Studio 2012\Projects\RuBe Ktj\RuBe Ktj\Form1.vb:rad 152
       vid System.Windows.Forms.Control.OnClick(EventArgs e)
       vid System.Windows.Forms.Button.OnClick(EventArgs e)
       vid System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       vid System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
       vid System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
       vid System.Windows.Forms.ButtonBase.WndProc(Message&amp;amp; m)
       vid System.Windows.Forms.Button.WndProc(Message&amp;amp; m)
       vid System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
       vid System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
       vid System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       vid System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
       vid System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       vid System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       vid System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       vid System.Windows.Forms.Application.Run(ApplicationContext context)
       vid Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       vid Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       vid Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       vid RuBe_Ktj.My.MyApplication.Main(String[] Args) i 17d14f5c-a337-4978-8281-53493378c1071.vb:rad 81
       vid System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       vid System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       vid Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       vid System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       vid System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       vid System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>System.Data.DBConcurrencyException: Simultankörningsfel: UpdateCommand inverkade på 0 i stället för 1 poster.
       vid System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
       vid System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
       vid System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
       vid System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
       vid System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable)
       vid RuBe_Ktj.KunddatabasDataSetTableAdapters.KunderTableAdapter.Update(KunddatabasDataSet dataSet) i C:\Users\rbl\Documents\Visual Studio 2012\Projects\RuBe Ktj\RuBe Ktj\KunddatabasDataSet.Designer.vb:rad 1409
       vid RuBe_Ktj.Form1.Button6_Click(Object sender, EventArgs e) i C:\Users\rbl\Documents\Visual Studio 2012\Projects\RuBe Ktj\RuBe Ktj\Form1.vb:rad 152
       vid System.Windows.Forms.Control.OnClick(EventArgs e)
       vid System.Windows.Forms.Button.OnClick(EventArgs e)
       vid System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       vid System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
       vid System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
       vid System.Windows.Forms.ButtonBase.WndProc(Message&amp;amp; m)
       vid System.Windows.Forms.Button.WndProc(Message&amp;amp; m)
       vid System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
       vid System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
       vid System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       vid System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
       vid System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       vid System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       vid System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       vid System.Windows.Forms.Application.Run(ApplicationContext context)
       vid Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       vid Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       vid Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       vid RuBe_Ktj.My.MyApplication.Main(String[] Args) i 17d14f5c-a337-4978-8281-53493378c1071.vb:rad 81
       vid System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       vid System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       vid Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       vid System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       vid System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       vid System.Threading.ThreadHelper.ThreadStart()</ExceptionString></Exception></TraceRecord>
    An unhandled exception of type 'System.Data.DBConcurrencyException' occurred in System.Data.dll
    Additional information: Simultankörningsfel: UpdateCommand inverkade på 0 i stället för 1 poster.
    The program '[7824] RuBe Ktj.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).
    Adding a new row:
    Private Sub Button6_Click_1(sender As Object, e As EventArgs) Handles SkapanyrutinBtn.Click
    Dim newrow As DataRow = KunddatabasDataSet.Tables("Kunder").NewRow()
            Dim newrowname As Object = InputBox("Skriv in (kund)namn på den nya rutinen")
            newrow("Kundnamn") = newrowname
            If newrowname = "" Then
                Exit Sub
            End If
            KunddatabasDataSet.Tables("Kunder").Rows.Add(newrow)
    KunderBindingSource.EndEdit()
            KunderTableAdapter.Update(KunddatabasDataSet)
    End Sub
    Attempting to save:
    Private Sub Button6_Click(sender As Object, e As EventArgs) Handles SavechangedBtn.Click
    KunderBindingSource.EndEdit()
            KunderTableAdapter.Update(KunddatabasDataSet) ' <--- This is where the error is thrown!
    End Sub

  • Performance problems with combobox and datasource

    We have a perfomance problem, when we are connecting a datatable object or something like this to a datasource property of a combobox. Below you find the source code. The SQL-Statement reads about 40000 rows and the result (all 40000) should be listed in the combobox. There is duration about 30 second before this process has finished. Any suggestions?
    Dim ds As New DataSet
    strSQL = "Select * from am.city"
    conn = New Oracle.DataAccess.Client.OracleConnection(Configuration.ConfigurationSettings.AppSettings("conORA"))
    comm = New Oracle.DataAccess.Client.OracleCommand(strSQL)
    da = New Oracle.DataAccess.Client.OracleDataAdapter(strSQL, conn)
    conn.Open()
    da.Fill(ds)
    conn.Close()
    Dim dt As New DataTable
    dt = ds.Tables(0)
    ComboBox1.DataSource = dt
    ComboBox1.ValueMember = dv.Table.Columns("id").ColumnName
    ComboBox1.DisplayMember = dv.Table.Columns("city").ColumnName

    But how long does it take to fill the DataTable?
    I can fill a 40000 row datatable in under 4 seconds.
    DataBinding a combo box to that many rows is pretty expensive, and not normally recommended.
    David
    Dim strConnection As String = "Data Source=oracle;User ID=scott;Password=tiger;"
    Dim conn As OracleConnection = New OracleConnection(strConnection)
    conn.Open()
    Dim cmd As New OracleCommand("select * from (select * from all_objects union all select * from all_objects) where rownum <= 40000", conn)
    Dim ds As New DataSet()
    Dim da As New OracleDataAdapter(cmd)
    Dim begin As Date = Now
    da.Fill(ds)
    Console.WriteLine(ds.Tables(0).Rows.Count & " rows loaded in " & Now.Subtract(begin).TotalSeconds & " seconds")
    outputs
    40000 rows loaded in 3.734375 seconds

  • Oracle Instant Client and OUT Parameter of custom type in Stored Procedures

    Hi @ all!
    I try to set up a simple client application, that calls a stored procedure via Instant Client from C#.
    The stored procedure and assiciated types looks like this:
    TYPE MYVALUE AS OBJECT
          Id      INTEGER,
          value     FLOAT
    TYPE MYVALUELIST AS TABLE OF MYVALUE;
    PROCEDURE ReadValues( ID IN INTEGER,
                                        RESULTSET OUT MYVALUELIST)
                                           IS
    ...I created an Oracle Command executing this SP and added OracleParameters for ID and (where I got stuck) the RESULTSET.
    Is it possible to pass a parameter with a custom type from C# in some way?
    I already tried it as a function with SELECT * FROM TABLE(ReadValues(1));
    With my parameter RESULTSET as the RETURN type. But since I use DML within the procedure, this does not work inside of a query...
    Any suggestions?
    Thanks in advance!

    Hi Greg!
    Sorry, I misunderstood the forum topic then. =(
    Anyway, in the example you provided in the link, this is nearly exactly my situation. But there the Oracle.DataAccess.Client is used, where the OracleDBType can be called to initialize an object of type person. I use the instant client libraries called by using System.Data.OracleClient. There is only the OracleType enum, that does not contain an object or something similar.
    So I do it right now after trying a bit with a ref cursor parameter and an OracleDataAdapter - the ref cursor is passed back from Oracle as a DataReader, so die DataAdapter is able to use it for a .Fill():
    OracleCommand cmd = new OracleCommand();
    cmd.Parameters.Add("RESULTSET", OracleType.Cursor).Direction = ParameterDirection.Output;
    OracleDataAdapter odr = new OracleDataAdapter(cmd);
    DataTable result = new DataTable();
    odr.Fill(result);Within my stored procedure I just added the following OUT parameter:
    PROCEDURE ReadValues( ID IN INTEGER,
                                        RESULTSET OUT sys_refcursor)
                                           IS
    currentlist MYVALUELIST;
    ... [Adding elements to that list] ...
    OPEN resultset for select * from TABLE(currentlist);It works now, but I don't like that solution that much since I'm always afraid that there are lots of opened cursors idyling around. Do I have to close this one explicitly after filling my table by the DataAdapter?
    Regards

Maybe you are looking for

  • Oracle EBS 12.1.3 and SOA 10g hardware sizing

    Hi All, To give you the background, we have integration requirements where in one of the interface about 20000 sales orders come in the system everyday and they have about 3-5 lines per sales order. Most of these orders come between 3-6 PM. We have 5

  • How to find and delete files

    hi,   I am facing a strange issue. I am having sp 2013, sql , vs 2012,sp d 2013,  caml designer  etc. for the first few weeks , the SP and VS debuggingetc etc everything worked fine. now suddenly i am seeing that my C drive is consumed some 235 GB+ s

  • Hyperion Planning Cube keeps crashing

    Hi experts out there, Our planning Essbase cube keeps having exception when refreshing outline changes from Planning web site to Essbase, we are working with Oracle tech support, but not find the root cause yet, is there any one experienced this befo

  • Data Translation

    Hi, I'm implementing a check printing solution in Hebrew language, and need to print the amounts in Hebrew. In R12, function IBY_AMOUNT_IN_WORDS.Get_Amount_In_Words() converts amount to words, i.e. 1000.23 to "One Thousand Kronas And Twenty-Three Ore

  • Music playback volume

    Hi I have a question when i tranfer my music on to my ipod from itunes dose it adjust the volume on the ipod as well cause i've already adjusted the volume in itunes or do i have to adjust the volume on both of them also im using a free trail of movi