VW2005 and VW2008

rainbow_man

Member
Joined
Nov 9, 2009
Messages
5
Programming Experience
Beginner
Hi,

I recently moved my project to VW2008 from V2005 but is now having problems running it. Basically I have a web form which connects to a SQL server database. I do insert data via the form when the submit button is clicked. I am using StoredProcedure for this. I had to make changes to the button click event because VW2008 was asking for WithEvents declaration.

- My stored procedure statement just goes like this:
INSERT INTO Student (firstname, surname) VALUES (@firstname,@surname)

- The code:
VB.NET:
Protected Sub submitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim studentDetails As New SqlDataSource
        Try


            studentDetails.Insert()


        Catch ex As Exception
            Console.WriteLine(ex.StackTrace)
        End Try
    End Sub

I am using the GUI to drag n drop items to the form and I modified the 'Insert' properties to 'StoredProcedure' for the data source. In the list of parameters I point each variable to a control. I deleted the auto-generated 'RETURN_VALUE' though because I was getting errors. I dont know if that makes any difference.

The error am getting is:
- A first chance exception of type 'System.NotSupportedException' occurred in System.Web.dll

And when I use debugger, in the insert parameters there is under 'Item' :
Item In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user. System.Web.UI.WebControls.Parameter

Any help on this?
 
Back
Top