What does MissingSchemaAction.AddWithKey really do?
问题 The default value of SqlDataAdapter.MissingSchemaAction is MissingSchemaAction.Add , but when I specify the AddWithKey I can't understand what it really do ? System.Data.SqlClient.SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter(); da.MissingSchemaAction = MissingSchemaAction.AddWithKey; DataSet ds = new DataSet(); da.Fill(ds, "mytable"); When the use of AddWithKey can be useful ? 回答1: Documentation here says, it "adds the necessary columns and primary key information to complete