Hello, I hope someone could help me out here,
I have the following stored procedure in an SQL server database:
CREATE PROCEDURE sp_deleteEvent (
@eventID SmallInt,
@lastUpdatedOn SmallDateTime,
@lastUpdatedBy nVarChar(15)
)
AS
begin
update event
set
lastUpdateOn=@lastUpdatedOn,
lastUpdateBy= @lastUpdatedBy,
rowStatus= 0
where eventID = @eventID
end
GO
I want to pass the three parameters @eventID, @lastUpdatedOn and @lastUpdatedBy to it from a
vb.net script that is attached as âcode behindâ from an ASP.net page.
Just now my
VB script simply shows the required data on screen for testing:
Imports System.Data
Imports System.Data.SqlClient
Partial Class deleteEvent
Inherits spc_masterclass
Private Sub deleteEvent(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Selectid.Click
Dim intEventID As String
Dim dteUpdatedOn As String = Date.Now
Dim txtUpdatedBy As String = "testusr"
intEventID = ddl_Event.SelectedValue
dteUpdatedOn = dteUpdatedOn.Substring(0, 10)
If Page.IsValid = True Then
EventID.Text = intEventID
UpdatedOn.Text = dteUpdatedOn
UpdatedBy.Text = txtUpdatedBy
'display temporary test text
EventID.Visible = True
UpdatedOn.Visible = True
UpdatedBy.Visible = True
End If
End Sub
End Class
The ASP simply asked the user to select an item from a list:
The
VB then finds the values that are required to be sent to the stored procedure.
Unfortunately I have no idea how to do this!
Is this a simple thing?
I would appreciate it if somebody could help out or point me at some tutorials explaining how to do thisâ¦
Thanks.