var db = new Online_GameEntities(); TimeSpan ts = new TimeSpan(0, 0, 0); DateTime dtnow = DateTime.Now; int h = dtnow.Hour; int m = dtnow.Minute; int s = dtnow.Second; int day = dtnow.Day; TimeSpan tsnow = new TimeSpan(day, h, m, s); TimeSpan tscreate = new TimeSpan(0, 12, 25); TimeSpan tscreated = tsnow.Add(tscreate); tbl_building insertbuild = new tbl_building(); insertbuild.createdtime = (TimeSpan)tscreated; insertbuild.createtime = (TimeSpan)tscreate; insertbuild.levels = 1; insertbuild.c_id = "ttyuyt"; insertbuild.firststate = true; insertbuild.name = ""; insertbuild.x =5; insertbuild.y = 5; insertbuild.image = "b1.jpg" + "_" + 5; db.tbl_building.Add(insertbuild); db.SaveChanges();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)