 鲜花( 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:
# L) l( `8 y, z* ~6 t1 .sql statement is:
: `4 n9 ~8 P/ Q' j' ~: |3 N& iselect AA.empid, AA.XX, BB.XX from AA inner join BB on AA.empid=BB.empid1 f5 \6 Q B: G d' f/ y+ @; P, ^$ Z
2. show data in grid view
" l2 h( Z* P7 |" I7 ~8 }then used DataTable get the result, for example Datatable name is dtResult:
# t. P0 M0 }9 {( Scode is :* ?# F& w0 f3 K/ H/ ^ w
gdv.datasource=dtResult;
/ x! c! V6 L& W* `+ N' @# R, xgdv.DataBind();' F) D# |( _9 x& ]
k+ I6 X. H6 V5 y" P8 ]. K0 e 3 Y" Q l& X- U1 g& q) D4 ^- r
+ ]: O" L* C: O
7 s! m4 }9 R8 v3 a6 A% q) ~ q6 S
# Y, ?9 R$ m. Z6 [8 p; g
|
|