1

Is there a way to read a Geography data from sql server DB and convert it to SqlGeography type in c# ?

For example, when reading an int type column, the conversion is:

int price = Convert.ToInt32(row["Price"]);

The question is, how can i read geography type column?

Edit: Why did you mark it as a duplication? im asking how can i read Geography sql data type from a db to c#. I looked at th other questions and didn't find my desired answer.

user1413824
  • 659
  • 1
  • 8
  • 15
  • This question should not have been marked duplicate. The question is asking how to read the SqlGeography type directly from the database. The duplicate reference merely shows how to create SqlGeography within code, not read it from the database. This answer does get at one issue with reading SqlGeography directly: https://stackoverflow.com/questions/25323301/sqlgeography-type-mismatch – Bryan B Aug 19 '19 at 18:20

0 Answers0