Save Tiles data to sql database, SecondaryCache

Topics: General
Mar 17, 2013 at 9:13 AM
Hello Master..

I am new in C# and Gmapnet, i need save tiles data to sql,
i saw sources in gmapnet,, gmapnet default using sqlite and save data into data.gmdb.

when open the data.gmdb i see binary data on each tile. can we save the tiles data to mysql database??

if its possible can you give me tutorials or links??

thanks for help
Coordinator
Mar 17, 2013 at 9:21 AM
use mysql/etc cache provider as SecondaryCache, check the code.. its even in documentation, even small, nobody cares to read it...
Mar 18, 2013 at 5:11 AM
its mean Secondary cache MySQLPureImageCache.cs ... i was enalble and compile,,

i found this error "The type or namespace name 'MapType' could not be found (are you missing a using directive or an assembly reference?) "


on fuction public PureImage GetImageFromCache(MapType type, GPoint pos, int zoom) ..

how to fix this??

thanks
Mar 18, 2013 at 8:47 AM
okay ,, i can compiled this file,,,

what need to be change if i want to save into sql..
let me know (just what files)
Coordinator
Mar 18, 2013 at 10:25 AM
..i've forget that it uses old interface, i'll need to fix that
Coordinator
Mar 18, 2013 at 10:46 AM
fixed
Mar 18, 2013 at 10:46 AM
ok thanks radioman,,

for mysql connection

its just enable and make connection on MySQLPureImageCache.cs??? or need some code in other files??
Coordinator
Mar 18, 2013 at 2:40 PM
var sc = new MySQLPureImageCache();
sc.ConnectionString = @"server=sql2008;User Id=trolis;Persist Security Info=True;database=gmapnetcache;password=trolis;";
map.Manager.SecondaryCache = sc;
Coordinator
Mar 18, 2013 at 2:43 PM
p.s. you need read/write and for the first time table creation permisions
Mar 19, 2013 at 5:21 AM
OK... thanks for help radioman,,


fixed :)