各位大蝦,小弟我用兩個組合控件組成窗體,一個組合控件用來選擇查詢條件,一個datagird組合控件用來顯示數據
我寫的SQL語句是這樣的
Public Overrides Sub Retrieve()
Dim ldst_result As New UFC.Data.UDataSet
Dim ldtb_result As UFC.Data.UDataTable
Dim lstg_sql As New System.Text.StringBuilder(1000)
Try
lstg_sql.Append(" select division_code , customer_code , contact_man ,contact_tel , customer_cname ,")
lstg_sql.Append(" customer_ename , contact_address ")
lstg_sql.Append(" from gis.tbgis_customer ")
lstg_sql.Append(" where division_code = " & Me.Getdivisioncode & "")
If Not Me.Getcustomercode Is Nothing Then
lstg_sql.Append(" and customer_code = " & Me.Getcustomercode & "")
End If
If Not Me.Getcustomercname Is Nothing Then
lstg_sql.Append(" and customer_cname= " & Me.Getcustomercname & "")
End If
ldtb_result = Me.GetSession.GetDatabaseConnection.ExecuteSQLStatementQuery(lstg_sql.ToString)
ldtb_result.TableName = "customer"
ldst_result.Tables.Add(ldtb_result)
Me.Setcustomer(ldst_result)
Catch lexp_sql As UFC.Data.Exceptions.UDataException
Throw lexp_sql
End Try
End Sub
當我選擇Getdivisioncode 條件時可以顯示數據,在選擇Getcustomercode 時候也可以,可是必須和Getdivisioncode組合用才可以,Getcustomercname和Getcustomercode 一樣,當我選擇了後面兩個條件以後,我在去掉後面兩個條件在選擇第一個條件的時候,第一個條件都不能顯示全部數據了
是什麼問題阿,謝謝各位大蝦阿 ,我急用阿!!!!!!!!!
大哥,我看你的字看得好累
能说说你的窗体上有什么控件吗?
着急,还不说清楚!!
把字体换了先!
楼主是台湾的吧