Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
X# vs VFP
Message
De
29/10/2019 03:40:05
 
 
À
25/10/2019 08:35:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Titre:
Divers
Thread ID:
01671547
Message ID:
01671729
Vues:
173
I was talking about datasession object and base class introduced in VFP6 sp3.
To late in my opinion as most established VFP frameworks were written before that point, so could not take
advantage of these new concepts/possibilities.
But it is right time to be introduced in X# :-)

Buffering and transaction on native dbfs would be nice to have, but less of a problem as most people use
'proper' relational databases nowadays and all of those support transactions anyway.

Keep up good work! :-)


>>Hi Johan
>>Is there any plans to implement datasession objects ? To me, datasession is one of the most important objects ever.
>>Buffering / Transactions would be also great to have.
>
>Hi Srdjan,
>
>If you mean cursors then yes. There are also already a lot in .NET available.
>
>
>// Read a DBF into a .NET datatable
>METHOD DbfToDataTable(oDbf AS VO.DbServer) AS DataTable
>	VAR oDT := DataTable{oDbf:Alias:ToString()}
>	LOCAL oRow AS DataRow
>	FOR VAR i := 1 TO oDbf:FCount
>		oDT:Columns:Add(DataColumn{oDbf:FieldName(i):ToString()})
>	NEXT
>	oDbf:GoTop()
>	WHILE !oDbf:EoF
>		oRow := oDT:NewRow()
>		// Read each column into the row
>		FOR VAR i := 1 TO oDbf:FCount
>			oRow[oDbf:FieldName(i):ToString()] := oDbf:FieldGet(i):ToString()
>		NEXT
>		// Add the row to the datatable
>		oDT:Rows:Add(oRow)
>		oDbf:Skip()
>	ENDDO
>RETURN oDT
>
>
>I also use the DbProviderFactory for Buffering/Transactions a lot in combination with DataSet and DataTable:
>
>
>STATIC METHOD DataRead(sDB AS STRING, sComm AS STRING) AS DataTable
>	LOCAL oConn AS DbConnection
>	LOCAL oComm AS DbCommand
>	LOCAL oTran AS DbTransaction
>	LOCAL oRead AS DbDataReader
>	LOCAL oDT AS DataTable
>
>	oConn := SqlUtils.GetConnection(sDB)
>	oConn:Open()
>	oComm := DbProviderFactories.GetFactory(ConfigurationManager.ConnectionStrings[sDB]:ProviderName):CreateCommand()
>	oComm:Connection := oConn
>	oComm:CommandText := sComm
>	oTran := oConn:BeginTransaction()
>	oComm:Transaction := oTran
>	oRead := oComm:ExecuteReader()
>	oDT := DataTable{}
>	oDT:Load(oRead)
>	oConn:Close()
>	oConn:Dispose()
>RETURN oDT
>
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform