campagnolo1
Technical User
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:
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:
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.
Thanks in advance,
Chris
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:
UPDATE kokfstut
SET qty =kokfstutDataGridView.Columns[newqty.Cells[7]
Code:
UPDATE kokfstut
SET qty = kokfstutDataGridView.Columns[qty].Cells[6]
So obviously I'm missing something here. Anybody got any suggestions? And no, I can not alter the table.
Thanks in advance,
Chris