Hi GG,
Could you try something like
cm.Parameters.Add("@last_datetime", DbType.DateTime);
cm.Parameters["@last_datetime"].Value = Null;
The Provider complains there's no datatype
-Paul
<GG> wrote in message news:470bac31.7356.1681692777@sybase.com...
>I am trying to update a datetime column with null but
> getting an error. This is the code I use. Am I missing
> anything?
> using (AseConnection cn = new AseConnection(
> Database.Connection )) {
> cn.Open();
> using (AseCommand cm = cn.CreateCommand()) {
> cm.CommandText = sqlCommandText;
> cm.CommandTimeout = 60 * 5;
> cm.CommandType = CommandType.Text;
> cm.Parameters.Add("@last_datetime", System.DBNull.Value );
> return cm.ExecuteNonQuery();
> }
> }
>
> Error
> Sybase.Data.AseClient.AseException occurred
> Message="Unsupported parameter type"
> Source="Sybase.AdoNet2.AseClient"
> StackTrace:
> at
> Sybase.Data.AseClient1.AseCommand.CheckResult(Int32 res)
> at Sybase.Data.AseClient1.AseCommand.BindParameters()
> at Sybase.Data.AseClient1.AseCommand.Execute()
> at
> Sybase.Data.AseClient1.AseCommand.ExecuteNonQuery()
> at Sybase.Data.AseClient.AseCommand.ExecuteNonQuery()
|