Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join Expressions Not Working #1

Open
harlankoehn opened this issue Jan 5, 2016 · 3 comments
Open

Join Expressions Not Working #1

harlankoehn opened this issue Jan 5, 2016 · 3 comments

Comments

@harlankoehn
Copy link

Does this .NET VFP Client support Join Expressions? I tried JOIN, INNER JOIN, LEFT JOIN, etc., and couldn't get any of them to work. I get a fairly generic error message about the provider not supporting or recognizing something in my SQL.

My tables are not free tables, they are part of a database, but they do not have primary keys. It's not a database I can modify. I'm integrating with another companies software.

I can do pseudo joins using:

SELECT field1, field2
FROM table1, table2
WHERE table1.ID = table2.ForeignKey

But I'd rather be able to use joins if I can.

@harlankoehn harlankoehn changed the title Join Expressions Join Expressions Not Working Jan 5, 2016
@tombrothers
Copy link
Owner

VfpClient works with join statements. I used the following code to verify using the northwind.dbc.

 using (var connection = new VfpConnection(@"e:\NorthwindData\Northwind.dbc")) {
    using (var command = connection.CreateCommand()) {
        command.CommandText = "select c.CustomerId, o.OrderId from customers, orders o where c.CustomerId = o.CustomerId";

        var adapter = new VfpDataAdapter(command);
        var table = new DataTable();

        adapter.Fill(table);
    }
}

Is it possible that your query includes a VFP function call that isn't supported by the OLE DB Provider?

@harlankoehn
Copy link
Author

That works but I'm still not sure how I'd do a left Join if I wanted to. Appears that probably wouldn't be possible.

@tombrothers
Copy link
Owner

Example 7 shows the syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants