Question : Get return value from ObjectDataSource

Given the following code how would I get the return value from InsertData():

        TypeName = "MyNamespace.MyObject"
        InsertMethod = "InsertData">
   
       
   



I would like to be able to say something like the following in my code-behind:

Sub SomeGridView_DataBound(s As Object, e As EventArgs)
  Dim intId As Integer
  intId = ObjectDataSource1.SelectParameters(0).ReturnValue
End Sub

This obviously doesn't work, but hopefully you see what I'm trying to do here.

Thank you!

Answer : Get return value from ObjectDataSource

Try this:

Sub ObjectDataSource1_Inserted(s As Object, e As ObjectDataSourceStatusEventArgs)
  Dim intId As Integer
  intId = e.OutputParameters("Return")
End Sub
Random Solutions  
  •  Dropdowns in grid view 'edit item template' not working
  •  How do you import outlook express 6 messages into Windows Live Mail and have them in the proper folders?
  •  Cannot use remote executables after I upgraded to R2
  •  Mixed tooltips using AddTool (GetDlgItem (IDC_THIS), IDC_THIS) and AddTool (this, LPSTR_TEXTCALLBACK) how to.
  •  VPN client (Check point Secure client) not able to browse to any website on the machine once connected to the VPN.
  •  How do I remove special characters in a query?
  •  Reading XML in to an ADO Recordset
  •  msaccess 2003 and turning on a new menu toolbar from module code and turning off the main menu from the same place
  •  Problem with Joomla email cloaking
  •  can i use right([ClientName] to get the last part of a string in a Microsoft Access query if i don't know how long the last part is?
  •  
    programming4us programming4us