default value for a timestamp field
default value for a timestamp field
default value for a timestamp field
default value for a timestamp field
default value for a timestamp field
default value for a timestamp field default value for a timestamp field default value for a timestamp field default value for a timestamp field default value for a timestamp field default value for a timestamp field default value for a timestamp field default value for a timestamp field
default value for a timestamp field default value for a timestamp field
default value for a timestamp field
Go Back  Xtreme Visual Basic Talk > > > default value for a timestamp field


Reply
 
Thread Tools Display Modes
  #1  
Old 07-24-2015, 05:55 PM
pschulz pschulz is offline
Newcomer
 
Join Date: Jul 2015
Posts: 6
Question default value for a timestamp field


Hi there,

is there no way to have a timestampColumn within an Insert statement?
I could keep it out of course but sometimes, its needed.

This are 2 examples I've tried, but have still an error
Code:
Dim strTimestamp As String = String.Empty

mySQLCommand.Parameters.AddWithValue("@TimestampClm", SqlDbType.Timestamp)
mySQLCommand.Parameters("@TimestampClm").Value = strTimestamp


And even this one hasnt work
Code:
Dim myNull As SqlDateTime
myNull = SqlDateTime.Null

mySQLCommand.Parameters.AddWithValue("@TimestampClm", SqlDbType.Timestamp)
mySQLCommand.Parameters("@TimestampClm").Value = myNull
greetings and thanks
Reply With Quote
  #2  
Old 07-25-2015, 06:43 AM
PlausiblyDamp's Avatar
PlausiblyDampdefault value for a timestamp field PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,056
Default

A column of type timestamp isn't meant to be inserted into, it exists as an autogenerated column type (https://technet.microsoft.com/en-us/...v=sql.80).aspx has more details).

Is there a reason why you need to insert a null / empty timestamp into a row?
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #3  
Old 07-25-2015, 01:58 PM
pschulz pschulz is offline
Newcomer
 
Join Date: Jul 2015
Posts: 6
Default

Hi PlausiblyDamp's, thanks for now.

Well, if nothing is inserted, than this column doesnt have any value, is empty. Or is there something I dont see?

I'm pleasure if this is normaly filled by autogenerated, but never saw it so.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
default value for a timestamp field
default value for a timestamp field
default value for a timestamp field default value for a timestamp field
default value for a timestamp field
default value for a timestamp field
default value for a timestamp field default value for a timestamp field default value for a timestamp field default value for a timestamp field default value for a timestamp field default value for a timestamp field default value for a timestamp field
default value for a timestamp field
default value for a timestamp field
 
default value for a timestamp field
default value for a timestamp field
 
-->