Forums: Default values for DB - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Default values for DB How can I set the default values when adding/editing to a database Rate Topic: -----

#1 User is offline   rizzy 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 27-May 10

Posted 27 May 2010 - 05:13 PM

Just having a senior moment here...

For ASPrunner.Net, I want to set the default on a date field to the current date and set the ID adding the record to the userid field of the logged in user.

I know how to do it in ASP, can't get it working in .Net

Suggestions???

Thanks
0

#2 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 8534
  • Joined: 03-February 03

Posted 01 June 2010 - 02:50 AM

Current datetime: DateTime.Now
Current user: Page.Session["User"].UserName
Best regards,
Sergey Kornilov
0

#3 User is offline   rizzy 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 27-May 10

Posted 16 June 2010 - 01:44 PM

View Postadmin, on 31 May 2010 - 09:50 PM, said:

Current datetime: DateTime.Now
Current user: Page.Session["User"].UserName


Yes this does work however it adds in the .cs file quotes before and after the sequence when building

defvalues["InDate"] = "DateTime.Now";

Any way to fix this on the build side so I don't need to manually edit every scrip[t.

Also, when adding additional fields to the database in "Modify Table" option, the field never shows up in any subsequent pages. I read the Drop and add the table response but is there any other way to do this so I don't lose all of my form changes?

Thank You.
0

#4 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 8534
  • Joined: 03-February 03

Posted 17 June 2010 - 04:05 PM

Try the following as a default value: (DateTime.Now)

Unfortunately ASPRunner.NET doesn't have synchronization capabilities. The only choice is to remove table and add it back.
Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users