Hello Everyone:
I've a lot of experience with php, and other languages. But C# is completely new to me.
I'm working in Visual C# 2010 express and doing some experimentation.
My project uses the Northwind database as its Datasource
As I said, I'm doing some experimentation before recommending C# to a client. Specifically I am trying to do the following:
I've figured out how to get the listboxes set up and use the drag/drop functionality. Now I'm running into problems updating the database.
Within the Northwind database I added a new field to the Employees table. The new field name is: StationAssignment
At this point, when the user grabs and employee, I want to execute some SQL to update the Employees!StationAssignment field. The SQL is pretty straight-forward:
Of course - after I figure out how to execute SQL within an event routine (SelectedIndexChanged), I'll want to learn how to use parameters. But right now my biggest question is:
How do I execute sql within an event routine, specifically what is the proper syntax? The project already has a datasource, so do I have to set up a data connection?
Thank you in advance - Pavilion
I've a lot of experience with php, and other languages. But C# is completely new to me.
I'm working in Visual C# 2010 express and doing some experimentation.
My project uses the Northwind database as its Datasource
As I said, I'm doing some experimentation before recommending C# to a client. Specifically I am trying to do the following:
- Create a form with multiple listboxes
- User will be dragging and dropping between the various listboxes
- Main listbox shows "unassigned employees"
- Users will be able to drag an unassigned employee to any of the other listboxes representing different work stations.
I've figured out how to get the listboxes set up and use the drag/drop functionality. Now I'm running into problems updating the database.
Within the Northwind database I added a new field to the Employees table. The new field name is: StationAssignment
At this point, when the user grabs and employee, I want to execute some SQL to update the Employees!StationAssignment field. The SQL is pretty straight-forward:
UPDATE Employees SET StationAssignment = NULL WHERE ([Employee ID] = 6);
Of course - after I figure out how to execute SQL within an event routine (SelectedIndexChanged), I'll want to learn how to use parameters. But right now my biggest question is:
How do I execute sql within an event routine, specifically what is the proper syntax? The project already has a datasource, so do I have to set up a data connection?
Thank you in advance - Pavilion
Last edited: