Save Tiles data to sql database, SecondaryCache

Topics: General
Mar 17, 2013 at 10: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
Mar 17, 2013 at 10: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 6: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??

Mar 18, 2013 at 9: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)
Mar 18, 2013 at 11:25 AM
..i've forget that it uses old interface, i'll need to fix that
Mar 18, 2013 at 11:46 AM
Mar 18, 2013 at 11:46 AM
ok thanks radioman,,

for mysql connection

its just enable and make connection on MySQLPureImageCache.cs??? or need some code in other files??
Mar 18, 2013 at 3: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;
Mar 18, 2013 at 3:43 PM
p.s. you need read/write and for the first time table creation permisions
Mar 19, 2013 at 6:21 AM
OK... thanks for help radioman,,

fixed :)