• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

datagrid question

i was using datagrid which its recordsource is from stored procedure...the allow update was functiong well... but error apeared... . "INSUFFICIENT KEY COLUMN INFORMATION FOR UPDATING OR REFRESHING"...
how can i overcome this error...nid it urgent..
thanks in advanced experts...
0
JackOfPH
Asked:
JackOfPH
1 Solution
 
fridomCommented:
Great message, my chrystal ball says you have a bug in your program, fix it and the stuff will work

Friedrich
0
 
Nish_since1981Commented:
Type mismatch of column in datagrid, check it and your code will work
0
 
JackOfPHAuthor Commented:
when i was using MS Access as my database... my code was working properly... but then when i convert it to SQL Server this error occured...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
JackOfPHAuthor Commented:
i already converted my access query to sql server stored procedure...
0
 
lostcarparkCommented:
Do you have a primary key declared on your SQL Server table? If so, make sure it's selected in the datagrid. You can make it a hidden column if you don't want the user to see it.
0
 
hiteshgupta1Commented:
check the noof fields in datagrid and those fetched from the table
0
 
JackOfPHAuthor Commented:
does the INNER JOIN of my tables has something to do with it?...
0
 
lostcarparkCommented:
I think it might. If a main table can't be identified, it doesn't know which table to use for updtes and deletes. Can you post your query here?
0
 
JackOfPHAuthor Commented:
SELECT PartIssue.autonumber, PartIssue.BarcodeNumber, PartIssue.ControlNumber, PartIssue.PartNumber,   PartInv.Location, PartInv.PartName, PartIssue.IssuedCnum, PartIssue.Date1,
PartIssue.Requestedqty, PartIssue.sameqty, PartIssue.Issuedqty,
PartIssue.Checkedby, PartIssue.Requestedby, PartIssue.Recievedby,
PartIssue.Issuedby, PartIssue.Issuedate, PartIssue.UpdateInCharge,PartIssue.Approvedby
FROM PartIssue INNER JOIN PartInv ON PartIssue.PartNumber = PartInv.PartNumber

... this query is working properly at MS Access database... but on my SQL Server 2000 the error (insufficient information...) occured... i was bothered by this problem for 2 days... i really needed your help experts...

... thanks in advanced...
0
 
lostcarparkCommented:
A couple of thoughts...

Which fields do you need to be updatable? I reckon the database is getting confused about which table is driving the query.

The first think I'd try is making the Inner join a Left join:

FROM PartIssue LEFT OUTER JOIN PartInv ON PartIssue.PartNumber = PartInv.PartNumber

This will mean the PartInv columns won't be updatable, but I suspect that isn't a problem.

The other thing I'm wondering is could the stored procedure be causing the problem? Have you tried binding the query directly?

Personally, I try to steer away from data binding because it always seems to cause more trouble than it's worth when you try to so something complicated.
0
 
JackOfPHAuthor Commented:
what do  you mean by "FROM PartIssue LEFT OUTER JOIN PartInv ON PartIssue.PartNumber = PartInv.PartNumber"..

is this mean that i nid to changed my "FROM Clause" by this one.

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now