"System.AccessViolationException: Attempted to read or write protected memory" While Filling a DataTable

Viewed 18965

Using ASP.NET 4.51 and VS 2013 I am getting the following error when attempting to Fill a datatable using a stored procedure.

System.AccessViolationException: Attempted to read or write protected memory

I have have traced the error to the following:

Using myDT As New DAL.mbr_MediaComments.usrsp_mbr_MediaComments_CommentorsDataTable
    Using myTA As New DAL.mbr_MediaCommentsTableAdapters.usrsp_mbr_MediaComments_CommentorsTableAdapter

        myTA.Fill(myDT, toMbrID, mediaID) <------System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Here is my stored procedure definition:

CREATE PROCEDURE [dbo].[usrsp_mbr_MediaComments_Commentors] 
-- Add the parameters for the stored procedure here
@mbrID int = 0,
@mediaID bigint = 0

AS
BEGIN

    //my query code

END
1 Answers
Related