Error create DataAdapter with Config wizard.


G

Guest

hi
I was trying to use following query to create Data Adapter
SELECT DISTINCT Orders.OrderID, Orders.CustomerID, Orders.EmployeeID, Customers.CompanyName, Customers.Address, Customers.City FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerI

Error always happen with
--------------------------
Primary Key Columns Missin
--------------------------
The wizard can not automatically create queries for updating the database because your query does not include some primary key columns. Do you wish to add the primary key columns to your query

Please suggest how can I fix it
rgds
Fish.
 
Ad

Advertisements

M

Miha Markic [MVP C#]

Hi,

Wizard needs primary key to create update/delete/insert commands.
You might add a primary key to your table (which is always a good thing) or
you might create your commands manually after wizard has finised (or even
without it).

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

A.Fish said:
hi,
I was trying to use following query to create Data Adapter:
SELECT DISTINCT Orders.OrderID, Orders.CustomerID, Orders.EmployeeID,
Customers.CompanyName, Customers.Address, Customers.City FROM Customers
INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID
Error always happen with:
because your query does not include some primary key columns. Do you wish to
add the primary key columns to your query?
 
G

Guest

Hi
I was missing. The table are Primarykey ready, in fact they're Northwind sample DB. Why I was still warn of missing Primary key

Plus, I was able to create the command manually every time but my question was if the Wizard can do it for me( that's the value for the wizard). Am I right

rgds
Fish.
 
Ad

Advertisements

M

Miha Markic [MVP C#]

Hi,

Try without INNER JOIN.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

A.Fish said:
Hi,
I was missing. The table are Primarykey ready, in fact they're Northwind
sample DB. Why I was still warn of missing Primary key?
Plus, I was able to create the command manually every time but my question
was if the Wizard can do it for me( that's the value for the wizard). Am I
right?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top