That is possible, but you now need to use ExecuteScalar to get hold of the value. If performance matters at all, use an output parameter instead.
Along these lines:
cmd.CommandText = "declare @id int OUTPUT; insert T vaules(1, 'abc', 0); set @id = SCOPE_IDENTITY()";
var idParam = cmd.Parameters.AddWithValue("@id", 0);
idParam.Direction = ParameterDirection.Output;
--
Also consider using stored procs; it is adviseable in many cases.