none
Joining DBF, Join expression not supported RRS feed

  • Question

  • Hi,

    I am trying below code to query from DBFs. The same code I am using to query from SQL Server but I guess joining have soecial requirments when it comes to DBF.

    I am getting Join expression not supported.

    Can anyone help please..

    sql = "SELECT CONVERT(date, DOB) AS DOB, CR_GNDLINE.STR_ID AS STR_NO, STR_NAME, 'Promotion' AS Amount_Description, SUM(AMT) AS TOTAL_AMOUNT ";
    sql += "FROM CR_GNDLINE ";
    sql += "LEFT JOIN CR_PROMO ON BRAND=PRO_BRAND AND COMPANY=PRO_COMPANY AND TYPEID=PRO_ID ";
    sql += "LEFT JOIN CR_STORE ON BRAND=CR_STORE.STR_BRAND AND COMPANY=CR_STORE.STR_COMPANY AND CR_GNDLINE.STR_ID=CR_STORE.STR_NO ";
    sql += "WHERE DOB = '2016-12-01' AND STR_NO = 1543 AND CR_GNDLINE.TYPE=2 ";
    sql += "GROUP BY CR_GNDLINE.STR_ID, STR_NAME, DOB";
    
    data_table = new DataTable();
    
    sql_connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Temp\ReemData\20160926;Extended Properties=dBASE IV;");
    sql_connection.Open();
    sql_command = new OleDbCommand(sql, sql_connection);
    sql_command.CommandType = CommandType.Text;
    sql_adapter = new OleDbDataAdapter(sql_command);
    sql_adapter.Fill(data_table);
    dataPayroll.DataSource = null;
    dataPayroll.ResetBindings();
    dataPayroll.DataSource = data_table;

    Thanks,

    Jassim



    Tuesday, December 27, 2016 11:17 PM

All replies