Considering the case you've described, I don't see any need to return the identity from the database. You can simply issue both statements in one command:
using (var cnx = new SqlConnection(pubvar.x))
using (var cmd = new SqlCommand
{
Connection = cnx,
CommandText = @"
insert into A (Name) values (@name)
insert into B (A_ID, Rate) values (scope_identity(), @rate)
",
Parameters =
{
new SqlParameter("@name", name),
new SqlParameter("@rate", .5m) //sample rate
}
})
{
cnx.Open();
cmd.ExecuteNonQuery();
}