473,411 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

How to set the default foe DateTime column in DataSet view

Hi

I have in my DataSet a column of type DateTime. And, I want to change it's default to current date in DataSet view. I tried to use:
- DateTime.Today
- DateTime.Now
- DateTime.Now.ToString("dd/MM/yyyy")

All of them did not work and I got error message:
"Property value is not valid" and the detail is:
The string was not recognized as a valid DateTime. There is a unknown word starting at index 0

How to set the default inside the DataSet?

I am working witn Visual Studio 2008 - C#

Thanks
Dec 16 '08 #1
5 8957
balabaster
797 Expert 512MB
What's the date string itself?
Dec 16 '08 #2
I did not get ur question.

What I have is an autocreated dataset build on a MS SQL table which has a Date field. And, I want to set the default value in dataset directly as it works for other fields in dataset. I don't want to set default value in database itself.
Dec 17 '08 #3
Still waiting for an answer.
Jan 9 '09 #4
The short answer is that there is still no way to set a default value to anything except a constant.

In other words, you cannot use an expression for the default value in any datatable column, which rarely has any impact on non-datetime columns.
Mar 30 '09 #5
if you want to set a fixed default value for a datetime column in the vs designer, try to use a string like:
2009-01-01T00:00:00

bye
ghillo
Jun 25 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Phil Powell | last post by:
I am unable to determine which version of mySQL is running on a remote server (and the client doesn't know either, and I can't reach the host.. oh what I'll do for $80)... create table if not...
1
by: scj | last post by:
Hi all, I need to determine the exact type of DateTime column(*) in an Access 97 database. I'm able to do this with an Access 2 database. With ADO.Net and VB.Net (**), I do something like...
0
by: Darren Clark | last post by:
I am trying to set the default value (not mistaken for NULL value) for a datetime element of a typed dataset. <xs:element name="create_date" type="xs:dateTime"...
5
by: GG | last post by:
I am trying to add a nullable datetime column to a datatable fails. I am getting exception DataSet does not support System.Nullable<>. None of these works dtSearchFromData.Columns.Add( new...
2
by: nephish | last post by:
Hey there, i tried this question in the mysql group, but have not heard anything. i have a database with about 20 tables. The some of these tables have datetime type columns in them. What i am...
4
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which -...
4
by: Manikandan | last post by:
Hi, I'm inserting a datetime values into sql server 2000 from c# SQL server table details Table name:date_test columnname datatype No int date_t DateTime ...
0
by: squrel | last post by:
Hello All... I m getting this error in my project " Unable to locate record. verify that first column of view gird is unique" .. i have checked my gird and nothing wrong.. checked my database and ...
0
by: premtolani | last post by:
Hello, Can you tell me how to sort a datetime column in any datetime format in a swt table ? the datetime format can be any. regards, Prem
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.