If your table has a column that is auto assigned a value when a record is created, e.g. an autoincrement ID value, you can get it using scope_iendity() as follows:
int RecordId;
SqlCommand1->CommandType = CommandType::Text;
SqlCommand1->CommandText = "INSERT INTO MyTable (SomeRow1, SomeRow2) VALUES (@MyValue1, @MyValue2); SELECT CAST(scope_identity() AS int)";
SqlCommand1->Parameters->AddWithValue("@MyValue1", MyValue1);
SqlCommand1->Parameters->AddWithValue("@MyValue2", Convert::ToString(MyValue2));
RecordId = (Int32)SqlCommand1->ExecuteScalar(); //ExecuteScalar returns the auto assigned value for an auto incrment column from the scope_identity() select query
