Hello @hwilliams.
I have been following this post carefully and after debugging, I was able to get a “Connection Open” response from your earlier example.
However, using the code below, I introduced a WebDAV command which is meant to create a folder called “testbosa” based on what was mentioned in Virtuoso Documentation here: DAV add & update functions (openlinksw.com). This usage is found in the first line at Example 24.76.
string finalStatus = "Idle";
string connectionString = "Driver={Virtuoso (Open Source)};Host=127.0.0.1:1111;Database=DB;Uid=dba;Pwd=dba;";
using (OdbcConnection cnn =
new OdbcConnection(connectionString))
{
string odbcQuery = "select DB.DBA.DAV_COL_CREATE ('/DAV/testbosa/','110100000R', 'dav','dav','dav','dav');";
try
{
cnn.Open();
finalStatus = "Connection Open !";
using (OdbcCommand command = new OdbcCommand(odbcQuery, cnn)) //pass SQL query created above and connection
{
command.ExecuteNonQuery(); //execute the Query
finalStatus = "Query Executed.";
}
cnn.Close();
}
catch (Exception ex)
{
finalStatus = "Cannot open connection: " + ex;
}
Console.WriteLine(finalStatus);
}
After implementing this code, my variable, finalStatus reads the following error:
Cannot open connection: System.Data.Odbc.OdbcException (0x80131937): ERROR [37000] [OpenLink][Virtuoso ODBC Driver][Virtuoso Server]SQ074: Line 1: syntax error
at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)
at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader)
at System.Data.Odbc.OdbcCommand.ExecuteNonQuery()
at Program.<>c.<<<Main>$>b__0_0>d.MoveNext() in C:\Users\*****\Program.cs:line 34
(The path to my Program.cs file was intentionally hidden from the public)
Please can you let me know what I am doing wrong here to get this syntax error and how I can fix this? Thank you.
Regards.