 鲜花( 2)  鸡蛋( 0)
|
There are two tables such as AA and BB, assume there is empid field in AA, and there is empid field in BB, and your grid view's name is gdv, so:
1 B9 c8 g k( A7 P( E1 .sql statement is:
& I3 K/ d6 _* W, F1 c; bselect AA.empid, AA.XX, BB.XX from AA inner join BB on AA.empid=BB.empid
+ T+ S8 d: V3 i9 V6 F# m2. show data in grid view
: p q# }& j7 C' e+ athen used DataTable get the result, for example Datatable name is dtResult:
9 Z+ c3 t0 j& q( {! ~1 S5 Q* Kcode is :
, n% U/ J H* r( _ s9 z0 Tgdv.datasource=dtResult;
B" A1 P, h& Z: J5 @6 {1 wgdv.DataBind();4 G& b9 V2 g2 j! c# H) W8 W3 C
. `/ o; N# L C% b* M! L
9 X1 k3 z4 ?* B$ V2 u
3 b% Y& `* b/ ~( U! T
f* _& O' o4 W2 u, Z- P
5 ?6 P5 c# K) m6 c u
|
|