Can someone please take a look at the following code and advise me as to what might be preventing the update.
There is no error(the good news), but there is no update either(the bad). And it follows that with every bit of good news comes........
Your help would be greatly appreciated.
Thanks in advance
Paul G
Dim ds As New DataSet
ds = CType(Session("CachedDatas
et"), DataSet)
Dim dsChanges As New DataSet
dsChanges = ds.GetChanges(DataRowState
.Modified Or DataRowState.Added)
dgDisplayChanges.DataSourc
e = dsChanges
dgDisplayChanges.DataBind(
)
Dim da As New SqlDataAdapter
Dim cnn As New SqlConnection(Constants.el
earningCon
nectionStr
ing)
Dim cmdUpdate As New SqlCommand("UpdateVideoDet
ailTable")
da.SelectCommand.CommandTy
pe = CommandType.StoredProcedur
e
cmdUpdate.Connection = cnn
With cmdUpdate.Parameters
.Add("@RETURN_VALUE", SqlDbType.Int, 4)
.Item(2).Direction = ParameterDirection.ReturnV
alue
.Add("@VideoDetailID", SqlDbType.Int, 4, "VideoDetailID")
.Add("@VideoTitle ", SqlDbType.VarChar, 500, "VideoTitle")
.Add("@VideoDuration", SqlDbType.Decimal, "VideoDuration")
.Add("@VideoURL", SqlDbType.VarChar, 1000, "VideoURL")
.Add("@GlobalAccessID", SqlDbType.Int, 4, "GlobalAccessID")
End With
da.UpdateCommand = cmdUpdate
da.Update(dsChanges, "VideoDetail")
Catch ex As Exception
lblError.Text = ex.Message
End Try
Here is the sp that is being run in the background.
CREATE PROC procUpdate
@VideoDetailID Int,
@VideoTitle varchar(500),
@VideoDuration Decimal,
@VideoURL Varchar(1000),
@GlobalAccessID Int
AS
Update dbo.tblVideoDetail
Set VideoTitle=@VideoTitle,
VideoDuration=@VideoDurati
on,
VideoURL=@VideoURL,
GlobalAccessID=@GlobalAcce
ssID
WHERE VideoDetailID=@VideoDetail
ID
Start Free Trial