Hi,
I am getting following error while executing a procedure in Asp.net
System.Data.Dataset cannot be converted to Integer
Here is my code:
Protected Sub img_button_update_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles img_button_update.Click
If Page.IsValid And hid_profile.Value <> "" Then
lbl_msg.Text = ""
Dim obj As New Master
Dim scope_ident As Integer = obj.update_tbl_profiles(hid_profile.Value, txt_profile.Text.Trim(), IIf(chk_active.Checked, 1, 0))
If scope_ident = 1 Then
fillBasicTab(hid_profile.Value)
visibleBasicData(True)
lbl_msg.Text = "Profile details Successfully Updated."
End If
obj = Nothing
End If
End Sub
In the class File:
Public Function update_tbl_profiles(ByVal profile_id As Integer, ByVal name As String, ByVal is_active As Int16) As DataSet
Dim dsDataset As DataSet
Dim SqlParameter() As SqlParameter = New SqlParameter(2) {}
SqlParameter(0) = New SqlParameter("@profile_id", SqlDbType.int)
SqlParameter(0).Direction = ParameterDirection.Input
SqlParameter(0).Value = profile_id
SqlParameter(1) = New SqlParameter("@name", SqlDbType.varchar)
SqlParameter(1).Size = 50
SqlParameter(1).Direction = ParameterDirection.Input
SqlParameter(1).Value = name
SqlParameter(2) = New SqlParameter("@is_active", SqlDbType.bit)
SqlParameter(2).Direction = ParameterDirection.Input
SqlParameter(2).Value = is_active
dsDataSet = SqlHelper.ExecuteDataset(SqlHelper.of_getConnectString(), CommandType.StoredProcedure, "update_tbl_profiles", SqlParameter)
Return SqlParameter(2).Value
dsDataSet.Dispose()
dsDataSet = Nothing
SqlParameter = Nothing
End Function
Please tell me how to get rid of this error.