J
Jim H
I am attempting to update a Database Table thru a DataAdapter using a DataSet.
I get this error:
"Cannot insert a non-null value into a timestamp column. Use INSERT with a column list or with
a default of NULL for the timestamp column."
This is my table definition:
CREATE TABLE [dbo].[FieldNameXRef] (
[FNXApplication] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[FNXOriginalName] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[FNXSource] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[FNXNewName] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[FNXComment] [varchar] (48) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[FNXTimeStamp] [timestamp] NOT NULL ,
[FNXSequential] [int] IDENTITY (1, 1) NOT NULL
) ON [PRIMARY]
GO
And, in the program I have:
if ( myDataRow == null ) // If the row was not found, add it to the DataTable
{
dr = dtFieldNameXRef.NewRow(); // Create new Row in dtFieldNameXRef
dr[ "FNXApplication" ] = selectedApp; // Set Comment Field Value
dr[ "FNXOriginalName" ] = label; // Set Label Field Value
dr[ "FNXSource" ] = name; // Set Source Field Value (filename)
dr[ "FNXComment" ] = comment; // Set Comment Field Value
dtFieldNameXRef.Rows.Add( dr ); // Add the new Row to the DataTable
}
Note that in the code shown, I have not initialized the FNXTimeStamp field. I have also tried
initializing the FNXTimeStamp field to null, NULL, DB.NULL, new DBNull(), DBNull.Value -- and
all produce one error or another.
TIA, Jim Holloman
I get this error:
"Cannot insert a non-null value into a timestamp column. Use INSERT with a column list or with
a default of NULL for the timestamp column."
This is my table definition:
CREATE TABLE [dbo].[FieldNameXRef] (
[FNXApplication] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[FNXOriginalName] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[FNXSource] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[FNXNewName] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[FNXComment] [varchar] (48) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[FNXTimeStamp] [timestamp] NOT NULL ,
[FNXSequential] [int] IDENTITY (1, 1) NOT NULL
) ON [PRIMARY]
GO
And, in the program I have:
if ( myDataRow == null ) // If the row was not found, add it to the DataTable
{
dr = dtFieldNameXRef.NewRow(); // Create new Row in dtFieldNameXRef
dr[ "FNXApplication" ] = selectedApp; // Set Comment Field Value
dr[ "FNXOriginalName" ] = label; // Set Label Field Value
dr[ "FNXSource" ] = name; // Set Source Field Value (filename)
dr[ "FNXComment" ] = comment; // Set Comment Field Value
dtFieldNameXRef.Rows.Add( dr ); // Add the new Row to the DataTable
}
Note that in the code shown, I have not initialized the FNXTimeStamp field. I have also tried
initializing the FNXTimeStamp field to null, NULL, DB.NULL, new DBNull(), DBNull.Value -- and
all produce one error or another.
TIA, Jim Holloman