小编Ste*_*e N的帖子

MYSQL工作台的文件位置

我在工作台中创建了一个数据库,但我无法找到它所在的位置.我搜索了xampp/mysql文件夹,发现了一个db.opt文件夹,但没有别的.我还检查了programdata/mysql和programsX86/mysqlworkbench,一无所获.

mysql database file-location mysql-workbench

4
推荐指数
1
解决办法
2万
查看次数

正则表达式检查允许字符输入

我正在使用农场模型的遥控器进行数据验证并检查省代码我一直收到一个不接受两个字符的错误.我需要省代码长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)

c# regex asp.net-mvc

1
推荐指数
1
解决办法
110
查看次数

ASP.Net 程序中抛出“System.NotSupportedException”类型的异常

我正在尝试获取联赛比赛列表并且正在获取

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

c# asp.net asp.net-mvc entity-framework

0
推荐指数
1
解决办法
2万
查看次数