INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Windows Form to update VFP table with datagrid

Windows Form to update VFP table with datagrid

(OP)
Greetings everyone,

I'm stuck on a project that has me turning in circles and I need some help.
I have created a small windows form project in VS2010 using C#. The form has a datagrid which is tied to a VFP table. The table has no primary key and I can't add one (the table was given to me and I was told I can't alter it). I have populated the grid with several columns and bound the columns to the table fields. I added one unbound column (newqty) in the grid which I want to use to enter the new value for the qty column.
So far it's pretty simple. I was about to add my INSERT, UPDATE, DELETE methods when I noticed that I couldn't automatically create those methods. After some research I found that because the VFP table has no primary key, I can't create an UPDATE method. So I tried to use an UPDATE query and came up with this:

CODE --> C#

UPDATE    kokfstut
SET              qty =kokfstutDataGridView.Columns[newqty.Cells[7] 
But this doesn't work and is giving me a "Column 'newqty' is not found" error. Looking at it, it seems right but when I look at the columns, the newqty column has no DataPropertyName since it's not bound to anything. So I went and changed the code to:

CODE --> C#

UPDATE    kokfstut
SET              qty = kokfstutDataGridView.Columns[qty].Cells[6] 
I thought I'd just use the existing qty column to edit the data, but the above code also gives me an error, saying "Function is not implemented".
So obviously I'm missing something here. Anybody got any suggestions? And no, I can not alter the table. wink

Thanks in advance,

Chris

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close