Sreejith K
Sreejith K

Reputation: 53

Feature is not available exception thrown on inserting records to Visual Fox Pro db from c#(.NET)

The below code for insert to Fox pro db from c# works if I disable the insert trigger on fox pro table.

try
{
    string query = @"insert into TERMS (VENDOR,TERMINAL,TERM) values(?,?,?)";
    OleDbConnection sourceConn = new OleDbConnection(@"Provider=VFPOLEDB.1;Data Source=E:\repos\Database\log");
    using (OleDbCommand cmd = new OleDbCommand(query, sourceConn))
    {
        cmd.CommandType = CommandType.Text;
        cmd.CommandTimeout = 1000;
        OleDbDataAdapter sqlDataAdapter = new OleDbDataAdapter();
        sourceConn.Open();
        cmd.Parameters.AddWithValue("?", "sws1");
        cmd.Parameters.AddWithValue("?", "sa1");
        cmd.Parameters.AddWithValue("?", "ds1");
        cmd.ExecuteNonQuery();
        sourceConn.Close();
    }
}
catch (Exception ex)
{

}

If I enable the trigger in Fox pro table then I receive error as "Feature not available" The insert trigger applied on fox pro table is as below

insertlog("terms",RECNO(),"I")

I am able to insert record to the fox pro table from Visual Fox pro and the trigger works adding a log record to other table.

Thank you for any hints regarding this.

Upvotes: 1

Views: 392

Answers (1)

Alan B
Alan B

Reputation: 4288

Is there any code in the Insertlog() function that isn't supported in the OLEDB driver? If you have Visual FoxPro then look for 'Unsupported Visual FoxPro Commands and Functions in OLE DB Provider' in the help file and check against your trigger code.

Upvotes: 2

Related Questions