uniqueidentifier in visual c# 2008

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • atif7865
    New Member
    • Jul 2008
    • 1

    uniqueidentifier in visual c# 2008

    Hi,

    I am new to programming. so please help.

    i have added a service database to my program in vs 2008 c#. i have added some tables and in some of those tables i have set a column of type "uniqueidentifi er".
    My understanding is that this column should get its value automatically when a new record is inserted into database. nothing happens when i click on save button from my program and instead i get an error that this column doest allow nulls.
    is there anything else that i should do from from code to get this value in the row?

    please help
  • Celeritask
    New Member
    • Jul 2008
    • 3

    #2
    You need to set the default value or binding to NEWID().

    You can do that by going to the Table Designer, selecting your uniqueidentifie r column, and in column properties, change Default Value or Binding to "NEWID()".

    Comment

    Working...