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

Discussion in 'ASP .Net' started by =?Utf-8?B?cG11ZA==?=, Dec 28, 2004.

  1. 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
     
    =?Utf-8?B?cG11ZA==?=, Dec 28, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?cG11ZA==?=

    bruce barker Guest

    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" <> wrote in message
    news:...
    | 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
     
    bruce barker, Dec 28, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. darrel
    Replies:
    5
    Views:
    1,562
    darrel
    Jan 30, 2007
  2. Anon
    Replies:
    0
    Views:
    1,400
  3. Replies:
    4
    Views:
    391
    Roedy Green
    Jul 14, 2007
  4. Jim in Arizona
    Replies:
    2
    Views:
    4,761
    Jim in Arizona
    Oct 23, 2008
  5. Lionel
    Replies:
    9
    Views:
    3,511
Loading...

Share This Page