p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 2.0 Databases Beta Preview
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 Databases: Beta Preview by John Kauffman, Thiru Thangarathinam; ISBN: 9780764570810

Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 Databases Beta Preview section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 24th, 2006, 09:15 AM
Registered User
 
Join Date: Mar 2006
Location: Dombruch, , Germany.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default gridview update & oracle

I didn't get an oracle db to work with a gridview (asp.net 2.0) and update.
No sqlupdate command worked.
I used the ":" instead of "@" in a lot of variations but get errors over errors.
Neither on msdn nor on google I found a working example of how to configure such an environement.
Does anybody here have a clue how to get this to work?

best
werner
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
  #2 (permalink)  
Old April 24th, 2006, 10:28 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi werner.
I suspect and almost sure, it's a real bug.

I got this workaround (?)
I'm using :
*Visual Studio 2005 Team edition for software developers
*DataBase: Oracle server Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production With the OLAP and Data Mining options.
*Client Oracle client.
*Oracle Data Provider for .NET 10.2.0.2.10 Beta

TABLE STRUCTURE: PRUEBADSS_TEMP

Description Type Size
------------ -------- -------------------
ARTICLE VARCHAR2 (15)
VALUE NUMBER (3)

without primary key, constraints, etc. as simple as a sample.


Connection string IN SqlDataSource:
Data Source=some.url.com;Persist Security Info=True;User ID=MY_USER;Password=MY_PASSWORD;Unicode=True


Controls:
*GridView _ Gridview1
*Sqldatasource : SqlDataSource1
*label : ErrorMessage


In GridView1_RowUpdating EVENT I wrote,
****Doin' updatin' code.
***Key point here: SqlDataSource1.Update()last one instruction it's my workaround
*** whitout this, it won't work.
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating
        Dim strValor As String
        Dim strArtic As String
        strValor = e.NewValues.Item(1).ToString
        strArtic = e.NewValues.Item(0).ToString
        Dim strSQL As String
        strSQL = "update PRUEBADSS_TEMP " _
               + " set VALUE = " + strValor + " " _
               + " where ARTICLE = '" + strArtic + "'"
        SqlDataSource1.UpdateCommand = strSQL
        SqlDataSource1.Update()
End Sub



In GridView1_RowUpdate EVENT I wrote some code in order to catch exception
***This is a key point 'cause anyway error is showed, but table's updated***
Protected Sub GridView1_RowUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdatedEventArgs ) Handles GridView1.RowUpdated
        If e.Exception Is Nothing Then
        Else
            If Len(e.Exception.Message) > 0 Then
                Dim s As String = e.Exception.ToString

                ErrorMessage.Text = String.Format("Exception while Updating: " + e.Exception.Message)

                'e.Exception.Message.ToString()

                e.ExceptionHandled = True

            End If
        End If
End Sub

You still gettin' Exception : ORA-01036, so you must catch it. but row'll be updated.


I hope it can help you in some way.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get GridView to update xr280xr ASP.NET 2.0 Professional 5 February 15th, 2008 12:45 PM
using gridview control, how to update? aaronabdiel ASP.NET 2.0 Basics 2 February 13th, 2008 08:41 AM
Gridview using Update *only* pbranumfl ASP.NET 2.0 Basics 2 December 4th, 2006 03:21 PM
Gridview Update Issue jpgregg ASP.NET 2.0 Professional 0 September 1st, 2006 08:35 PM
FOXPRO gridview update webclown ASP.NET 1.x and 2.0 Application Design 0 May 1st, 2006 01:43 PM



All times are GMT -4. The time now is 07:16 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc