OracleDataAdapter Update doesnot work

Hi all,

I am attempting to insert rows into the database. It is executing without error but when I check the database there are no changes.  Here  the dataset is filled with the data from CSV file.

Am i missing any step? Please help me out.

 Here is my code

OracleCommand cmd = new OracleCommand("SELECT * FROM OFX.TEST", connection);

OracleDataAdapter da = new OracleDataAdapter(cmd);

OracleCommandBuilder ocb = new OracleCommandBuilder(da);

DataSet dataset = new DataSet ();

 

da.Fill(dataset, "TestData");

 

OracleTransaction transaction;

try

{

transaction = connection.BeginTransaction();

cmd.Transaction = transaction;

da.InsertCommand = ocb.GetInsertCommand();

count = da.Update(dataset, "TestData");

transaction.Commit();

}

catch(Exception exp)

{

MessageBox.Show(exp.Message);

}

Thanks,

Cute.


Thanks,
Cute
0
cutekids525
4/29/2009 1:18:08 PM
asp.net.oracle 2269 articles. 0 followers. Follow

2 Replies
1303 Views

Similar Articles

[PageSpeed] 28

Don't use a transaction unless you're inserting/deleting/updating multiple tables.  Instead, I would suggest adding the "COMMIT;" to your SQL statement.  What will happen is that if for any reason, a transaction is violated, the transaction will fail and rollback.  It may or may not throw an OracleException, InvalidCastException or InvalidOperationException, which would explain why you are not getting any exceptions being thrown.  The transaction object of the command is designed for use when locking two tables simultaneously until all data has been correctly stored. 

A good example is when moving a shopping cart--list of items--saved in Oracle to a Order table that stores information about an order placed--list of items--with a new order number and payment authorization.

Hope this helps,
JP


If this post helped you, Mark As Answer.
0
jpuckett
4/30/2009 2:54:03 AM

You can refer to this

http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oracletransaction.aspx


Many Thanks & Best Regards,
HuaMin Chen

(Mark it as answer if it does help you!)
0
wmec
5/1/2009 12:11:13 PM
Reply:

Similar Artilces:

update button doesnot work on second page and onwards,it works only on first page
i have gridview in updatepanelnow when i am going to edit the record on first page of gridview it works fine, but when i am trying to update on second page or any other page then one it doesnot work, when i click on edit button,row comes in update mode,but and also edit button replace by update and cancel buttonbut when i click on update button ,nothing happen at all it just as it is like on client side,even not fire onclick event,though i have written autopostback=truei can not find whats the problem?plz help me,thanks VISHAL PAREKH Hi vrparekh, See this post which may include ...

keeps making me download update, but, update doesn't work, makes me download update, update doesn't work..................
Name: donald davis Email: galenachefatyahoodotcom Product: Firefox Summary: keeps making me download update, but, update doesn't work, makes me download update, update doesn't work.................. Comments: That's pretty much the whole deal. An update screen pops up, I update, the update doesn't take and the next time I use firefox mozilla the same thing happens over and over and over. Thanks Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.4 ...

vb.net oracle update
Hello, I'm trying to attempt my first oracle update in code. This is an update off of a gridview. Below is my code. When I run I get this error: ORA-00911: invalid character. I checked the values of strPassW, txtSecurity and txtUserId and they are all valid. Can you tell me what is wrong? Thanks  NewOracleConnection.Open() Dim trans As OracleTransaction = NewOracleConnection.BeginTransaction(IsolationLevel.ReadCommitted) Dim cmd As New OracleCommand("Update ZSIGNON set UserPassWord=?, SecurityLevel=? " & _ "Where UserId=?", New...

urgent: .NET Provider for Oracle or Oracle Data Provider for .NET
If I want to access Oracle DB in ASP.NET application, and I am using .NET Provider for Oracle or Oracle Data Provider for .NET, should I have to install OracleClient on my .NET server? Is there other choice? Thank you very much.Johnson Johnson2007:should I have to install OracleClient on my .NET server?  You have to options1. install the ODP.NET on your web serverOR2. put the oracle assemblies in your BIN directory   Hi jimmy,Thank you for you reply. Because I could not find a server right now, I should test it first before I agree or disagree with you, as most articles I...

PowerBuilde10 Does not Work with Oracle 10G NET...
Please help if you know of a way to connect to Oracle 10G Net installed with PowerBuilder10. I'm not able to connect to it using the 10G Net. It works OK with 9i Oracle Net. Thanks ...

Updates, updates and more updates
Name: pirhan Email: pirhan_chanathotmaildotcom Product: Firefox Summary: Updates, updates and more updates Comments: Hello, Normally I use Safari, but my iBook is out of commission for a while. So, I am forced to use a PC to which I would much rather use Firefox than Internet Exploder. However, as much I enjoy not using a Microsoft product, and use a product that works decently, I am severely annoyed about the constant updates I am put through. In the last two days, I had to wait for Firefox to install updates before I could browse and now, I'm alerted that there'...

updates, updates, updates
Holy Crap, Batman! You'd think I was running Windows XP and it's patch Tuesday. So far this week - new kernel (2.6.27.10), 2 new browsers (Opera 9.63 and Firefox 3.05) and a new plugin (Flash 10.0.156.3). I'm about ready to try one od the BSD's! vince wrote: > Holy Crap, Batman! You'd think I was running Windows XP and it's patch > Tuesday. > > So far this week - new kernel (2.6.27.10), 2 new browsers (Opera 9.63 > and Firefox 3.05) and a new plugin (Flash 10.0.156.3). I'm about ready > to try one od the BSD's! I take ...

Update Oracle Data (.Net 2.0)
Hi... I don't know if I missed something but I just can't figure out how to update an Oracle data set. I inserted a gridView and connected it via sqlDataSource to an Oracle table (Provider: OLE DB). I built a SELECT query using the query builder. All went fine and the columns were bound to the grid (let's say [USER_ID] [USERNAME] [PASSWORD]). I now want to create an upadteCommand, but I always fail. I just want to update the row which is in the edit mode. How do I build the query? Using query builder? Or Command and Parameter editor? How do I bind my paramters to the single edited grid ent...

updates, updates, updates
Name: hans jensen Email: hansjensen44_athotmaildotcom Product: Firefox Summary: updates, updates, updates Comments: why is it everytime i go online firefox has new updates, 3 -4 times every day, its never ending..........whats all the problems??? please email me and let me know, ty,.........Hans Jensen Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2 ...

updates, updates, updates, NO MORE!
Name: Andreas Email: unbekanntatjokerdotms Product: Firefox Summary: updates, updates, updates, NO MORE! Comments: Hi ! if you want to develop a fine webbrowser, maybe you nee a new management. To release a new buggy version every two weeks is not very professional. Test your software before the release and let the user download a stable browser. this update-orgy since 2.0.0 used me to use Opera instead of FF. We haved use FF in our Company, but we can't deploy a new version every week to +200 Windows-clients, so in our company we've decided to return to IE, ...

Coalesce is not working and Update is no updating
My code worked a few weeks ago and has since stop working, reasons are totally not clear to me as to what happended. However, I need to get this thing up and running.  It will not longer Coalesce data entry. Iran the debugger and the correct values are in the specified objects as if it is the first time I run the page for a person it will input data, but not of subsequent data entry attempts. My code: ( I trully appreciate your help) Ayo 'Using "With/End With" pass content to columns from text objects and datatime variables (see above)With cmdCommentUpdate .Parameter...

Return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle
Hello, I am wondering if anyone in this community knows the shorter way to return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle, something likereturn (IDataReader) SqlHelper.ExecuteReader(ConnectionString, "GET_ACCOUNT", Id); instead of using the way below (look at the C# code) Stored Procedure create or replace PROCEDURE "GET_ACCOUNT" ( p_ID IN ACCOUNT.ID%type, retCursor OUT SA.MYGEN.sqlcur ) IS BEGIN OPEN retCursor FOR SELECT ID, NAME FROM ACCOUNT WHERE ID = p_ID ; ...

Updates Updates Updates
I was a big fan of Firefox.. Now, I don't even like to use it. Seems like every time I start it up I have to update some addin OR the browser itself. And unfortunately the update nag messages are always presented when I start a browsing session. I find this annoying because, typically, when I open a web browser all I want to do is go to a web page. Not update the browser. I can agree that staying current with the latest version could give the best, fastest, safest web experience. But that point becomes mute when I start off every other browsing session with a new update. And mos...

Type.GetType does not work in VB.NET but works in C#. VB.NET gurus Please help
Friends,   I am an experienced C# programmer who is working on a VB.NET project now. I am writing different methods covering the following functionalities 1) Take a datareader as input and return an arraylist of class object2) Take an xmlnode (received from a webservice) as input and return an arraylist of class object. The methods are generic methods which take datareader/xmlnode as first parameter and classname (string) as the second parameter. This way it will work trivially. The schema of class object matches with the input (datareader or xmlnode)In C# I used to do th...

Web resources about - OracleDataAdapter Update doesnot work - asp.net.oracle

Resources last updated: 12/24/2015 7:55:04 AM