.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

not allow null value in table

Posted By: Catherine     Posted Date: October 11, 2011    Points:5   Category :ASP.Net
i create table with column not null.but when i insert it allows null value. but I have written javascript and vb validation.

Responses
Author: Syed Shakeer Hussain             
Posted Date: October 11, 2011     Points: 20   

Hi,

Check your Created Table 'Not Null' condition is there are not.

To create a Not Null column in a Table use the below syntax

eg:
CREATE TABLE Customer
(
SID integer NOT NULL,
Last_Name varchar (30) NOT NULL,
First_Name varchar(30)
);


Author: Deco             
Posted Date: October 12, 2011     Points: 20   

Get the "Create To" script for that Table and check if the Column has "NOT NULL" in it.
if the datatype of that column is varchar you will have
COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
if it's an interger
you will have just "Not NULL"

Regards,
Deco


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend