fbpx

Web Application with X#

More
10 months 3 weeks ago #1 by Danilo Giuliani
Web Application with X# was created by Danilo Giuliani
Hello everyone, this message of mine is intended to stimulate programmers in X # to try to write web applications with our language.
Attached a PDF with which I show how it is possible to realize applications retrieving code written years ago in VO for desktop applications.
I used ASP.NET pages to realize the interface, DLLs in X # for logic and functionality, JavaScripts for interaction with the user, Mysql as a database.
Interesting the possibility to debug the application with Visual Studio and inject JavaScript code into the X # code.
I remain available to help anyone in need.
good job
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #2 by Dick
Replied by Dick on topic Web Application with X#
Hello Danilo,

This is very interesting and also it looks very good what you created. We have a couple of CGI web programs (= a VO exe 'constructing' HTML output). They work fine but moving it to ASP gives us more flexibility; not every ISP allows .exe files to run on a server.

We would also need to use MySQL instead of DBF. We do have some mixed environments: DBF + MySQL. Problem is that from time to time MySQL servers tend to fail for a while. Currently it means that all transactions done are stored in a DBF and they are simply retried so don't get lost. Even if we move all DBF actions to MySQL, which is far less work for our webapps than it is for our Pc/server programs, I would like to have a DBF access option for backup purposes.

But I assume that won't work on Windows (ASP) web servers, right?

Dick

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #3 by Danilo Giuliani
Replied by Danilo Giuliani on topic Web Application with X#
Excuse me, I do not understand your question well, I work with asp.net pages that inherit it from the class whose methods are contained in DLLs written in X #

Danilo

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #4 by Dick
Replied by Dick on topic Web Application with X#
Hello Danilo,

I work with asp.net pages that inherit it from the class whose methods are contained in DLLs written in X #

Yes, I understood that. I've written 2 .Net ASP apps in C#, but using X# for it means we can transport VO code which saves a lot of time.

What I also wonder is: could you use dbf files on a web server, using X#? I remember that was a problem because web servers will be 64 bit while the VO/Vulcan DBFCDX drivers are 32 bit. Correct?

Dick

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #5 by Danilo Giuliani
Replied by Danilo Giuliani on topic Web Application with X#
You could use this technique:

LOCAL oRemoteDS_DBF AS System.Data.OleDb.OleDbConnection
LOCAL oFile AS System.IO.FileInfo
LOCAL oServer AS System.Data.DataTable
LOCAL cFile AS STRING

cFile := "C:\MYAPP\MYDBF.DBF"

oFile := System.IO.FileInfo{cFile}
oRemoteDS_DBF := System.Data.OleDb.OleDbConnection{"Provider=Microsoft.Jet.OLEDB.4.0;"+;
"Data Source="+oFile:DirectoryName+";Extended Properties = DBASE III"}
oRemoteDS_DBF:Open()

oServer := ExecuteSelect_Dbf(cQuery,oRemoteDS_DBF)

oRemoteDS_DBF:Close()
oRemoteDS_DBF := NULL_OBJECT

RETURN oServer

FUNCTION ExecuteSelect_Dbf(cQuery AS STRING,oRemoteDS_DBF AS System.Data.OleDb.OleDbConnection) AS System.Data.DataTable
LOCAL oDataTable AS System.Data.DataTable
LOCAL oDataAdapter AS System.Data.OleDB.OleDbDataAdapter
LOCAL oDataSet AS System.Data.dataset
LOCAL oCommand AS System.Data.OleDb.OleDbCommand

TRY
oCommand := oRemoteDS_DBF:CreateCommand()
oCommand:CommandText := cQuery
IF Left(Upper(cQuery),6) == "SELECT"
oDataSet := System.Data.dataset{}
oDataAdapter := System.Data.OleDB.OleDbDataAdapter{oCommand}
oDataAdapter:MissingSchemaAction := System.Data.MissingSchemaAction.AddWithKey
oDataAdapter:Fill(oDataSet,"MyTable")
oDataTable := oDataSet:Tables:Item[0]

oDataAdapter:Dispose()
oDataAdapter := NULL
oDataSet:Dispose()
oDataSet := NULL
ELSE
oCommand:ExecuteNonQuery() //Execute e query //
ENDIF
CATCH Errore AS System.Exception
MessageBox.Show("Error: "+Errore:Message,,"Error")
FINALLY

oCommand:Dispose()
oCommand := NULL_OBJECT
END TRY

RETURN oDataTable

Please Log in or Create an account to join the conversation.