Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have 2 tables: EmployeeInfo and MGRSPV (Manager/Supervisor).

 

On the DataGridView, we modified the EmployeeInfo Table's Fill/GetData to replace the EmployeeInfo.MGR value with the Manager/Supervisor's name from MGRSPV.[MGR/SPVSR] as follows:

SELECT       EmployeeInfo.FIRSTNAME, EmployeeInfo.LASTNAME, MGRSPV.[MGR/SPVSR]
FROM         EmployeeInfo
INNER JOIN  MGRSPV ON EmployeeInfo.MGR = MGRSPV.ID

 

It was working great, but crashed with an unhandled exception whenever I tried to Save data on the 'AutoGenerated' line below. Now, VS refuses to compile:

this.employeeInfoTableAdapter.Update(this.SqlSrvrDataSet.EmployeeInfo);

'EmployeeInfoTableAdapter' does not contain a definition for 'Update'

 

I guess this means I need to write a custom Update query for the EmployeeInfo Table. Right?

 

How would I write the statement?

 

How would I later use the statement in my code? Do I need to manually read in and supply parameters from my form? How would they be inserted? Using SqlParameter with ParameterName/Value pairs seems like it would work, but then I'd need an SqlCommand and have to find a way to update the TableAdapter.

 

The Wizard created everything on this except for the custom Fill/GetData SQL piece, so I am left out in the cold!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...