这是我得到的错误:
Additional information: <target>.Credit et <source>.Credit ont des propriétés en conflit : incompatibilité de propriété DataType.
这是我的代码
Public Sub Reg_GetRsData()
Dim sRs, sRs1 As String
'sRs = "Select GR.Codeclt,GR.Client,GR.Modereg,GR.Echeance,GR.Datereg,SUM(FC.MontantTTC) As Debit,SUM(GR.Montant) As Credit,SUM(FC.MontantTTC)-SUM(GR.Montant) As Solde,Gr.Libelle " _
' & "from GestionReg GR,LV_Fact_Client FC "
'sRs = sRs & "where 1=1 and Gr.Codeclt = FC.Codeclt " & fGetRsCondition()
'' RsData = New DataView
'sRs = sRs & " group by GR.Codeclt,GR.Client,GR.Modereg,GR.Echeance,GR.Datereg,Gr.Libelle "
sRs = "select (GR.Codeclt),GR.Client,GR.ModeReg,GR.Echeance,GR.Datereg,Gr.Libelle,'' As Credit " _
& "from GestionReg GR "
sRs = sRs & "where 1=1 " & fGetRsCondition()
RsData1 = New DataView
RsData1 = c_DataSql.fGet_Data_ViewAccess(sRs)
sRs1 = " select '' As Codeclt,'' As Client,'' As ModeReg,'' As Echence,'' As Datereg,'' As Libelle, MontantTTC As Credit" _
& " From LV_Fact_Client "
sRs1 = sRs1 & "where 1=1 and Codeclt = '" & fDuplicateCote(Codecl) & "'"
RsData2 = New DataView
RsData2 = c_DataSql.fGet_Data_ViewAccess(sRs1)
Dim iRow As Integer
iRow = 0
' SELECT LV_Fact_CLient.Codeclt, LV_Fact_CLient.DateFact, LV_Fact_CLient.NFact, LV_Fact_CLient.client, LV_Fact_CLient.MontantTTC, [modereg] AS Expr1, [Libelle] AS Expr2, [Echeance] AS Expr3
'FROM LV_Fact_CLient;
'union
'SELECT Gestionreg.Codeclt, Gestionreg.Date_imp, Gestionreg.Nreg, Gestionreg.client, Gestionreg.Montant, Gestionreg.ModeReg, Gestionreg.Libelle, Gestionreg.Echeance
'FROM Gestionreg
'WHERE (((Gestionreg.Date_imp)<>""));
RsData1.Table.Merge(RsData2.Table, MissingSchemaAction.Ignore)
With frmConsultsoldeclt.FlexGrid
.DataSource = RsData2
End With