473,416 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

PRIMARY KEY required for WRITING to SQL DATABASE using DATA GRID?

I need an editable datagrid. But for editing a datagrid as shown in the
walkthrough: Using a DataGrid Web Control to Read and Write Data, the table
in the SQL database should have a primary key. But my table doesnt have one.
So what is the best way I can create primary key in SQL database?

Is UNIQUE IDENTIFIER a good option? Is it something like Auro Number of MS
Access which is automatically filled by the database for each row? If not ,
how can i make a primary key for that SQL table?
--
pmud
Nov 19 '05 #1
1 1143
a UniqueIdentifiy in sqlserver is a GUID, not an autonumber. if you want an
autonumber add the identity constraint to an integer column.
UniqueIdentifiy has the advantage thet it can be assigned by sqlserver with
newid() function, or the caller.

-- bgruce (sqlwork.com)

"pmud" <pm**@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
| I need an editable datagrid. But for editing a datagrid as shown in the
| walkthrough: Using a DataGrid Web Control to Read and Write Data, the
table
| in the SQL database should have a primary key. But my table doesnt have
one.
| So what is the best way I can create primary key in SQL database?
|
| Is UNIQUE IDENTIFIER a good option? Is it something like Auro Number of MS
| Access which is automatically filled by the database for each row? If not
,
| how can i make a primary key for that SQL table?
| --
| pmud
Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: James | last post by:
Looking for experienced and resourceful web developer / programmer for following project: Or if anyone knows of a company that specialises in this sort of thing would be grateful if you could let...
9
by: 101 | last post by:
Taking a course on SQL. They are saying you can get better performance by having multiple files for a group. They then graphically show an example of "Primary" with multiple data files. I have...
5
by: Geoff Cayzer | last post by:
At http://www.blueclaw-db.com/tips_tricks.htm I came across a section which is included below and was hoping for some comment on the article. -------------- Almost never use this auto-number...
4
by: Alpha | last post by:
Hi, I've worked with C# for 5 months fixing bugs for appl. done by other programmers. I'm just writing a small C# application by myself for the first time. The database is Access 2000. I've set...
11
by: Geoff Jones | last post by:
Hi Can anybody help me with the following problem? I have a datasource i.e. some data, which I'm accessing via some VB. This I have done; with the help of you guys. However, the original data,...
13
by: Ron | last post by:
Hi All, Okay, I've read previous suggestions about not showing the primary key to the user of forms. If a number is to be shown (let's say, customer number) it should be generated independently...
8
by: Paul Hunter | last post by:
I am new to databases and thus to Access. I have a situation where I am trying to figure out how to key some tables I am working with. Consider that I have a database of my own records which are...
8
by: Challenge | last post by:
Hi, I got error, SQL1768N Unable to start HADR. Reason code = "7", when I tried to start hadr primary database. Here are the hadr configuration of my primary db: HADR database role ...
115
by: LurfysMa | last post by:
Most of the reference books recommend autonum primary keys, but the Access help says that any unique keys will work. What are the tradeoffs? I have several tables that have unique fields. Can...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.