alti
New member
- Joined
- Jun 8, 2020
- Messages
- 1
- Programming Experience
- Beginner
hello ,
im having a problem converting from datetime c# to datetime sql server using odbc and time c# to time(7) sql server this is my code:
this is the error i am getting now : 'ERROR [HYC00] [Microsoft][ODBC SQL Server Driver]Fonctionnalité optionnelle non implémentée'
but befor this i had other errors about conversions and i dedn't manage to fix so i think the problem is still here ?
can i have some help please i have to deliver soon?
im having a problem converting from datetime c# to datetime sql server using odbc and time c# to time(7) sql server this is my code:
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);
}
this is the error i am getting now : 'ERROR [HYC00] [Microsoft][ODBC SQL Server Driver]Fonctionnalité optionnelle non implémentée'
but befor this i had other errors about conversions and i dedn't manage to fix so i think the problem is still here ?
can i have some help please i have to deliver soon?
Last edited by a moderator: