2
Answers

DefaultValue as Today's date (Visual studio column default value)?

Dejan Dejanovic

Dejan Dejanovic

14y
7.9k
1
Hi all,

I'm using visual studio. I would like to change <DBNULL> default value of table date column into Today Date. I have try with lot of strings, but could not get right value. My goal is when I will create new record, column for date will take today's date.

I was looking all over network, and could not found solution. Also many people has asking same question, but didnt get right answer.

Thank you in advance for help...
Answers (2)
0
Yonatan Sion

Yonatan Sion

NA 2 0 13y
if you're willing to consider 3rd party, The following tool will do it for you:

http://nobhillsoft.com/Columbo.aspx
0
Suthish Nair

Suthish Nair

NA 31.7k 4.6m 13y
This not a simple task, so no ready made codes to share. You can also try this with LINQ to EXCEL.
0
gold spoon

gold spoon

NA 3 8.4k 13y
Please post code..
0
Sam Hobbs

Sam Hobbs

NA 28.7k 1.3m 13y
Use the Excel object model (also known as Excel Interop) to read each spreadsheet.

Create a DataSet which is an in-memory copy of data; you do not need to write the data to a database. Create two tables in the DataSet, one for the data for each spreadsheet. Use a SQL query to create a union. Use the result of that to create the new spreadsheet.

Alternatively you can read the data of each of the two spreadsheets into collections and then use LINQ to create the union.