Home  |  Linux  | Mysql  | PHP  | XML
From:Paul Date:Wed Oct 10 15: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


Your recent visits
ExecuteReader hangs and goes 100%CPU when the network cable is unplugged
PRINT statements in SQL and SQLDataReader
Re: How to use connection.GetSchema()?
Re: Are MO5.7 working on Windows Mobile6.5
Re: migration from pb10.5 to pb11.1 winform - webservice errors



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants