Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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
 
Old March 4th, 2006, 02:31 AM
Registered User
 
Join Date: Mar 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can i use text type field in Access as primery key

Hi,

This is geeta. I have taken access as a dataBase with Asp.net Application. I have taken two text type fields in employeeDetails table These are

Field Name DateType

 EmployeeId Text (Primery Key)

  password Text

Then When i am inserting unique & notNull values in Login form. Then a error occur With detail

The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
What should i do. Suggest me please

geeta




 
Old March 4th, 2006, 09:31 AM
Wrox Technical Editor
 
Join Date: Dec 2005
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm sure you are a aware of this; but your primary key can not have duplicate values.
Since your employeeID is your primary key you won't be able to have two duplicate employeeId values.

Definition: The primary key of a relational table uniquely identifies each record in the table. It can either be a normal attribute that is guaranteed to be unique (such as Social Security Number in a table with no more than one record per person) or it can be generated by the DBMS (such as a globally unique identifier, or GUID, in Microsoft SQL Server). - http://databases.about.com/cs/admini...primarykey.htm

If you have any additional relationships or indexes please post them.

- A.Kahtava





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Add Primery Key value Automatically kamran Yousaf Bk C# 1 October 6th, 2007 04:39 PM
Access 2000 Write Conflict on Text Field seananderson Access 4 December 19th, 2006 08:45 AM
Field/Key Concatenation latinoloco Access 1 May 15th, 2006 08:30 AM
When more than one field in a primery key - DGrid ManoYaka ASP.NET 1.0 and 1.1 Basics 3 January 21st, 2004 09:27 AM
Retrive text from input type field of html file?? bikash Javascript 10 July 30th, 2003 04:50 AM





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