C#-Mysql Insert-在命令执行期间遇到致命错误

时间:2015-12-21 20:54:36

标签: c# mysql

我试图在C#中的mySQL DB上执行INSERT语句:

我读了我的其他文章但找不到合适的解决方案!!!! 这失败并出现错误:命令执行期间遇到致命错误。  关于为什么会失败的任何想法?

def start_joe(name)
    "Great #{name} you are old enough to Play Joe's Trippy Adventure Game."
end

def start_jade(name)
    "#{name} Chose to play Jade's Safari Adventure Game."
end

def too_young(name)
    "#{name} You are too young to play Joe's Trippy game how about a nice Lepoard adventure game?"
end

def too_old(name)
    "Hey #{name} Aren't You a little old to play this type of game?"
end

1 个答案:

答案 0 :(得分:0)

这很可能是一个糟糕的约会时间。

试试这个:

DateTime date;
bool goodDate = DateTime.TryParse(row["butikEndTime"].ToString(), out date);
if (goodDate)
    cmd.Parameters.AddWithValue("@ENDTIME", date);
else
    cmd.Parameters.AddWithValue("@ENDTIME", DateTime.MinValue);