cmd.CommandText = @"select @@identity";int value = Int32.Parse(cmd.ExecuteScalar().ToString());return value;