Yao topped all players in votes received for a second straight year with 2,342,738 despite missing six weeks of action after undergoing surgery on his left big toe. Yao has played in 24 games this season and is averaging 19.8 points and 9.2 rebounds per game.
James, with 2,207,697 votes, led all Eastern Conference players.
Los Angeles Lakers guard Kobe Bryant finished second both overall and in the Western Conference with 2,271,631 votes. The 71,107-vote difference between Yao and Bryant is the closest finish between the top two vote-getters since Toronto's Vince Carter and Miami's Alonzo Mourning were separated by just 33,385 votes in 2000.
Houston Rockets centre Yao Ming topped all players in voting for the 2006 NBA All-Star Game. (AP Photo)
Miami Heat centre Shaquille O'Neal was selected to his 13th consecutive all-star team after notching 2,192,542 votes. He trails only Laker legend Jerry West and Utah Jazz star Karl Malone, who both appeared in 14 consecutive contests.
Joining Yao and Bryant as starters for the Western Conference will be Yao's teammate Tracy McGrady, San Antonio Spurs forward Tim Duncan and last season's league MVP, guard Steve Nash of the Phoenix Suns.
McGrady will be appearing in his sixth all-star game, while Duncan has been selected to the contest every year since he entered the league in 1997.
Miami guard Dwyane Wade will join O'Neal as an Eastern Conference starter, while two-time all-star MVP Allen Iverson of the Philadelphia 76ers and Indiana Pacers forward Jermaine O'Neal were also selected.
Detroit Pistons head coach Flip Saunders will be at the helm for the Eastern squad and Avery Johnson of the Dallas Mavericks will be on the bench for the Western team.
The Eastern Conference picked up a 125-115 victory over the Western Conference in last year's all-star game behind Iverson's 15 points, 10 assists and five steals. Iverson was the game's MVP.
The 2006 NBA All-Star Game is scheduled for Feb. 19 at Houston's Toyota Center.