Click here to Skip to main content
15,890,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
i have an Entity and i want save a 2D array like below:

C#


class Location
{
public int Id { get; set; }
public string Name { get; set; }
public int[,] Locations { get; set; }
}
i don't know what should i do!!

What I have tried:

i want to store 2D array in sql by Code-First!!
Posted
Updated 17-Jul-16 0:24am
Comments
nilesh sawardekar 17-Jul-16 2:27am    
You want to store values of array by comma separated format in single column or you want to save each value in different column?
Majlesi110 17-Jul-16 4:37am    
save each value in different column
Afzaal Ahmad Zeeshan 17-Jul-16 7:20am    
Besides, instead of this, why don't you save it to BLOB?
Majlesi110 17-Jul-16 10:30am    
how?? what is BLOB??
BLOB use for file. i want save matrix like this =>
int[,] Location = new Location[2,2]{{10,25},{2,8}};
Daniel Jones 18-Jul-16 0:48am    
have you seen this: http://stackoverflow.com/questions/15220921/how-to-store-double-array-to-database-with-entity-framework-code-first-approac

1 solution

 
Share this answer
 

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



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