|
|
 |
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.
|

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
|
|
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
|

April 24th, 2006, 10:28 AM
|
|
Registered User
|
|
Join Date: Apr 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |