Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 20th, 2009, 12:21 PM
Authorized User
 
Join Date: Jan 2009
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default Default value for field when inserting

I have a database which requires the field authorized to be set when inserting. How do I set the default value of that to false for all new reviews created?
  #2 (permalink)  
Old March 20th, 2009, 08:27 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Please rephrase your question, right now the answer is:

You either write you SQL query to set the value for you on insert or you set the default value of the column to 0.

hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
  #3 (permalink)  
Old March 25th, 2009, 12:51 PM
Authorized User
 
Join Date: Jan 2009
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The table that I want to insert information to is called Review and here are the fields and where I would like to get the information from:

ID - Primary Key, automatically generated
Name - Get this from the aspnetProfile table based on logged in user
Email Address - Get this from the aspnetMembership table based on logged in user
Review - User entered information
Authorized - Default value set to False
CityId - Value of dropdown list on the page
UserId - Get this from the aspnetMembership table based on logged in user

Is it possible to select this information and then bind it to the fields in the table, I am using a DataView?


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting new field to a table elygp SQL Language 3 March 19th, 2008 12:03 PM
Inserting comma in the field issaq SQL Language 0 February 20th, 2008 08:41 AM
Default Field Values tachtenberg Reporting Services 1 February 19th, 2008 05:52 PM
Programmatically update field default value srcLakeJake Access VBA 6 October 26th, 2007 01:29 PM
Field Default lryckman Access 1 August 13th, 2003 07:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.