error:
Object graph for type 'Uye.UyeMacAdresi' contains cycles and cannot be serialized if reference tracking is disabled.
solution:
in dbml file change the 'Serialization Mode' to 'Unidirectional'
linq clone error
Etiketler: clone , linq , serialization mode
method overload with single method
Etiketler: overload method
t-sql - Retrieving Error Information
-- Create procedure to retrieve error information.
CREATE PROCEDURE usp_GetErrorInfo
AS
SELECT
ERROR_NUMBER() AS ErrorNumber
,ERROR_SEVERITY() AS ErrorSeverity
,ERROR_STATE() AS ErrorState
,ERROR_PROCEDURE() AS ErrorProcedure
,ERROR_LINE() AS ErrorLine
,ERROR_MESSAGE() AS ErrorMessage;
GO
-- Sample:
BEGIN TRY
-- Generate divide-by-zero error.
SELECT 1/0;
END TRY
BEGIN CATCH
-- Execute error retrieval routine.
EXECUTE usp_GetErrorInfo;
END CATCH;
http://msdn.microsoft.com/en-us/library/ms175976.aspx
linq - Row not found or changed
trouble:
var daskTeklif = _context.tblDaskTeklifs.SingleOrDefault(dt => dt.teklif_id == TeklifTkID);
daskTeklif.SirketPoliceNo = policeNo;
_context.SubmitChanges();
throws an exception: System.Data.Linq.ChangeConflictException: Row not found or changed.
solution:
creating a new datacontext:
var context = new DataClassesDataContext();
daskTeklif = context.tblDaskTeklifs.SingleOrDefault(dt => dt.teklif_id == TeklifTkID);
daskTeklif.sirketPoliceNo = policeNo;
context.SubmitChanges();