我在工作台中创建了一个数据库,但我无法找到它所在的位置.我搜索了xampp/mysql文件夹,发现了一个db.opt文件夹,但没有别的.我还检查了programdata/mysql和programsX86/mysqlworkbench,一无所获.
我正在使用农场模型的遥控器进行数据验证并检查省代码我一直收到一个不接受两个字符的错误.我需要省代码长2个字母并检查它们是否实际上是字母.下面是RemoteController的代码:
public JsonResult provinceCodeCheck(string provinceCode)
{
Regex justLetters = new Regex("^[A-Z]$");
provinceCode.ToUpper();
var provinceCodes = db.provinces.Find(provinceCode);
if (provinceCode.Length != 2)
{
return Json("The Province must be 2 letters long",
JsonRequestBehavior.AllowGet);
}
else if (!justLetters.Equals(provinceCode))
{
return Json("The Province is not letters",
JsonRequestBehavior.AllowGet);
}
else if (provinceCodes == null)
{
return Json("The Province is not supported, sorry for the inconvenience",
JsonRequestBehavior.AllowGet);
}
else
{
return Json(true, JsonRequestBehavior.AllowGet);
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试获取联赛比赛列表并且正在获取
EntityFramework.SqlServer.dll 中发生了“System.NotSupportedException”类型的异常,但未在用户代码中处理
我的视图代码如下:
public ActionResult viewSchedule(int? id)
{
int leagueId = (int)id;
int seasonYear = getSeasonYear();
League league = db.Leagues.Find(leagueId);
var leagueGames = db.Games.Where(l => l.League == league).Where(g => g.SeasonDate == seasonYear);
return View(leagueGames.ToList());
}
Run Code Online (Sandbox Code Playgroud)
视图模型是:
@model IEnumerable