Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This error occurred in asp.net & C# program?
HTML
System.Data.SqlClient.SqlConnection' in Assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable


what is the reason for this type of error occurred?
Posted
Updated 28-Aug-14 21:17pm
v2
Comments
Gihan Liyanage 29-Aug-14 3:28am    
Better if you can post the SQL Connection class.

1 solution

Mark your connection class as serializable
C#
[Serializable()]
public class YourClass
{
}
 
Share this answer
 
Comments
Gihan Liyanage 15-Sep-14 6:21am    
Did you got a solution from my support, I can see you have not accepted any answer.If you are ok with this answer plz accept it. Then any user having same problem can identified it has solved the problem..
HNDandekar 28-Jun-21 13:19pm    
No. Error still continue.
HNDandekar 28-Jun-21 13:20pm    
Type 'System.Data.SqlClient.SqlConnection' in Assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.

Getting this error, I have defined this in a separate class file

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900