title: Determining a SQL Server Identity Column Name in .NET
body: <p>I'm trying to write some generic code in VB.NET that determines whether or not a SQL server database table contains an identity column and, if so, to return the name of that column.</p>
  
  <p>I'm working in Visual Basic 2008 Express and have created a SQL database, "MyDatabase" with 1 table called "MyTable".  Within that table, I've got 3 columns, "ID", "Column1" and "Column2".  I know, I know... inventive names.  Under column properties in the Database Explorer, I've set the "ID" column "Identity Specification" to "yes" and have set the "Is Identity" value to "yes".</p>
  
  <p>I need for the .NET code to return "ID" as the identity column.  Can this be done through LINQ or some other means?</p>
  
  <p>Thanks very much in advance!</p>
  
  <p>Luck</p>