sqlmetal problem in primarykey ! RRS feed

  • Question

  • Hi

    If you make a table with 1 decimal field and make it primarykey then make 1 stored procedure with on simple select , then map this sp to linqtosql class then generate linqtosql class with sqlmetal you can see sqlmetal can not recognise that field is primarykey . is it a bug ? or its normal ?

    when i see datatable that make with getchematable iskey or isdbnull are false but how vs2010 can find that field is primarykey ?



    ali kolahdoozan


    Sunday, January 9, 2011 3:03 PM

All replies

  • Hello ali kolahdoozan,

    Nice to see you again.

    I have little experience about sqlmetal, during I doing some search, I found that related your thread.

    And refer Matt Warren's reply from here:

    The meta-data readers that SQLMetal and the designer are using are not seeing the direct primary key declaration that shows the columns in the same order as the foreign key declaration.  They only end up seeing the main set of column declarations with extra data identifying individual columns as being part of the primary key.  Because of this, LINQ to SQL understands the natural order of the primary key to be the order as specified in the list of column declarations. 

    Hope it can help you,


    Best Regards,

    Jackie Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, January 12, 2011 6:23 AM
  • Hi Again And Tnx For reply


    I Only Want To Know When I Have To Switch Updatecheck to never or when must set autosync to oninsert , my request about all column attributes that used in linqtosql class  :





    Wednesday, January 12, 2011 12:48 PM