阿尔蒂
新成员
- 已加入
- 2020年6月8日
- 留言内容
- 1
- 编程经验
- Beginner
您好 ,
即时通讯在使用odbc将c#转换为datetime SQL服务器 以及将c#转换为time(7)sql server时遇到问题,这是我的代码:
这是我现在得到的错误:'ERROR [HYC00] [Microsoft] [ODBC SQL服务器 驱动程序]Fonctionnalitéoptionnelle nonimplémentée'
但是,在此之前,我在转换方面还有其他错误,并且无法解决,因此我认为问题仍然存在吗?
我可以帮忙吗?
即时通讯在使用odbc将c#转换为datetime SQL服务器 以及将c#转换为time(7)sql server时遇到问题,这是我的代码:
C#:
command.CommandText = "INSERT INTO pointer (Nom_employe, Date_Heure , Matin, Midi, apresmidi, Soir) VALUES ( ? ,? , ? , ?, ?, ?);";
// command.Parameters.AddWithValue("datetime", date_heure);
// command.Parameters.AddWithValue("nom", nom_employe);
command.Parameters.Add("@Nom", OdbcType.VarChar).Value = nom_employe;
command.Parameters.Add("@Date", OdbcType.Date).Value = Convert.ToDateTime( date_heure);
if (matin == null)
{
command.Parameters.Add("@Matin", OdbcType.Time).Value = null;
}
else
{
command.Parameters.Add("@Matin", OdbcType.Time).Value = TimeSpan.Parse(matin);
}
if (midi == null)
{
command.Parameters.Add("@Midi", OdbcType.Time).Value = null;
}
else
{
command.Parameters.Add("@Midi", OdbcType.Time).Value = TimeSpan.Parse(midi);
}
if (Apresmidi == null)
{
command.Parameters.Add("@Apresmidi", OdbcType.Time).Value = null;
}
else
{
command.Parameters.Add("@Apresmidi", OdbcType.Time).Value = TimeSpan.Parse( Apresmidi);
}
if (Soir == null)
{
command.Parameters.Add("@Soir", OdbcType.Time).Value = null;
}
else
{
command.Parameters.Add("@Soir", OdbcType.Time).Value = TimeSpan.Parse(Soir);
}
这是我现在得到的错误:'ERROR [HYC00] [Microsoft] [ODBC SQL服务器 驱动程序]Fonctionnalitéoptionnelle nonimplémentée'
但是,在此之前,我在转换方面还有其他错误,并且无法解决,因此我认为问题仍然存在吗?
我可以帮忙吗?
由主持人最后编辑: