Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Could not determine which columns uniquely identify the rows for ...

Status
Not open for further replies.

CuteLiLGeek

Programmer
May 3, 2005
4
0
0
US
I am just trying to figure out vb.net. I've barley gotten my feet wet. I am a experianced programmer, but new to VB. I've written a program in vb6 and I am now trying to recreate the same program in vb.net. I've seem some differences and run into some road blocks that are puzzling me. I have seen a couple posts that are similar to my problem; however they kind of confused me.

Here it goes:
I have a form which contains a DataGrid and a OleDbDataAdapter. I am using access as my database. My access database has several tables. I have a query setup in my access database called TransVender. It links two tables together.

SELECT Transactions.*, Venders.*
FROM Transactions INNER JOIN Venders ON Transactions.VenderID = Venders.VenderID;


When Creating the OldDbDataAdapter I selected to use sql statements -> QueryBuilder-> On Popup of ADD Table I selected VIEW and selected TransVender from the list. -> I Hit Add then I closed the box. -> On the Query Builder I selected *All Columns. -> Then Hit OK -> My Data Adapter Configuration Wizard now shows my query being the following

SELECT
TransVender.*
FROM
TransVender

This appears correct to me. I am now getting the following error message:

Could not determine which columns uniquely identify the rows for "TransVender".

If I right-mouse-click on the Adapter and do Preview Data it displaies the data fine...but why is it kicking back these errors on the configuration of it for UPDATE and DELETE?

I'm so confused...can anyone help?
Thanks!
Jenifer

PS. When I run the datagrid the columns all appear null. No data is being loaded into the datagrid
 
is the query non updateable?

ie open the query in access and try and modify a field, does it let you?
 
When you auto-create the DataAdapter through the wizard it defaults to creating Insert,Update, and Delete commands to access the database also. I would imagine that VB.Net cannot find a primary key or unique row identifier in your database table (does it have an identitiy field or primary key?).

An alternative if you just wish to view the data would be to not auto-generate those commands during the wizard process. I believe that it is under 'Advanced Options' or somesuch.
 
Thanks for the suggestions!!!

a) yes the query is updateable
b) yes both tables involved in the query both have primary keys

Jenifer
 
All fields are selected in the query

SELECT
TransVender.*
FROM
TransVender
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top