 鲜花( 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:
# p7 S) N/ V- W2 S/ n7 a" C1 .sql statement is:
6 x6 F! n8 S3 W- o0 n1 R- nselect AA.empid, AA.XX, BB.XX from AA inner join BB on AA.empid=BB.empid
+ W! `5 E* d d: Z; |9 {2. show data in grid view6 O6 M% }7 O8 w- N6 r1 v, N$ c
then used DataTable get the result, for example Datatable name is dtResult:
/ M$ P: B8 H9 Ycode is :! a8 K4 d4 t: k0 Z' R$ @7 j
gdv.datasource=dtResult;# J' q- t9 `9 X# M m
gdv.DataBind();
+ y. \6 |8 U' x# i' M+ n
2 L G$ p b; g 9 G$ Y8 V i$ H, o( ?& J; F
5 R9 h4 m0 K* I) l2 D# \
* B8 I' n, V2 C0 Y
' @1 t5 u @# K# g" a5 ` |
|