xsharp.eu • Librería C# para usar en VO 28
Page 1 of 1

Librería C# para usar en VO 28

Posted: Thu Apr 06, 2023 8:36 pm
by gjbiagiotti
Hello.
We are designing a C# library, exposed to COM, for handling SQL, to be used in VO 28 SP3.
We made the functions PG_Connect() and PG_Select(). This function returns a DataSet object.
At VO we use it for Automation.

After making the connection, we call the PG_Select() function which returns a dataset:

LOCAL oTable AS OBJECT

IF !oGVar:oSPI_SQL:PG_Select("Select * from customer order by razsoc_cli") //FALSE without error
oTable := oGVar:oSPI_SQL:Data
WILL END IF

SELF:oDCbBrowser1:use(oTable)

When trying to read the dataset returned by the library, with the bBrowser, the following error appears:
Error Code 16 [NO EXPORTED VARIABLE]
SubSystem: BASE
Function: IVAGET
Argument:USED

Is it possible to read, from VO, the data set returned by the library?
What should I take into account in the library so that VO can read a data set?

Thank you so much.
Gerardo.

Librería C# para usar en VO 28

Posted: Thu Apr 06, 2023 11:39 pm
by Sherlock
Geraldo

I provided all source to Fabrice for POSTGRES dataserver system that fully works.
No need for COM ... native support for PG.
What X# does with its PG future I have supplied my code.
But out of the box it works wth ReportPro, Browser.
Been using for years.

In my App I have mySQL native support and PG
I ship .libpq.ddl and pgConnector.dll

no COM or ODBC.. full native support.

Syntax can be very familiar DBF

oPGSQLConn := PgConnection{ "localhost", "WFalls_LiveData", "postgres", "Goodpassword”, "public", "5432", FALSE}
//
IF oPGSQLConn:IsConnected
//
cQuery := [SELECT * FROM sherdata.creditors_full] // ORDER BY "creditorname" ASC;]
oPGCreditor := PgSelect{ cQuery , oPGSQLConn }
//
IF oPGCreditor:Used
DO WHILE ! oPGCreditor:EOF
cCreditorName := AllTrim(oPGCreditor:FIELDGET(1)) // 'creditor_name')
cAddr1 := AllTrim(oPGCreditor:FIELDGET(#addressline1))
oPGCreditor:Skip()
ENDDO
oPGCreditor:close()
ENDIF
oPGSQLConn:Close()
ENDIF

Phil McGuinness

Librería C# para usar en VO 28

Posted: Fri Apr 07, 2023 12:52 am
by gjbiagiotti
hi phil
Thanks for your answer.
Where can I get the Fabrice libraries you mention?

Thanks
Gerard

Librería C# para usar en VO 28

Posted: Mon Apr 10, 2023 2:41 pm
by gjbiagiotti
hi phil
Where can I get the Fabrice libraries you mention?

Thanks
Gerard