LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: Paul Date: Wed Oct 10 11:39:36 2007 Subject: Re: Cannot update null values into ase using AseCommand
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()
| Navigate in group sybase.public.connectivity.adonet at sever forums.sybase.com | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by Zareef Ahmed
Powered By PHP Consultants |