Adding Fields

As a relative newcomer to the world of .Net I am looking at the TaskVision source. I am keen to understand how to add further fields easily to the project ?

Any ideas or top tips.

Many thanks

[195 byte] By [codefund.com] at [2008-2-15]
# 1
It's not that easy to add fields, but it's not rocket science, it just takes time.

Here's a rough outline for the back-end.

It may be helpful to create a second "development" version of TaskVisionWS to work on, so that you can refer to the original working version if you get confused while modifying your custom version.

If you create a second database, don't forget to add a user to the tables.

For the WS:

Update DataSetTasks.vb
Update DataSetTasks.xsd
Update DataService.asmx
Update DataSetProjectHistory.vb
Update DataSetProjectHistory.xsd

After you compile that, you should be able to test your work by attempting to browse DataService.asmx

You can then take a look at revising Stored Procedures before diving into the front end.

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 2
I mentioned above 'Don't forget to add a user . . ."

I wasn't thinking of the Stored Procedure ResetData.

Adapting that to changes in your database schema is definately a good bet.

I hope I didn't lead anyone down a difficult path.

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 3
After adding a field, I am getting an error on the invoke to "UpdateTasks"
"System.Web.Services.Protocols.SoapException: Server was unable to process request. > System.Data.SqlClient.SqlException: Procedure 'UpdateTask' expects parameter '@Original_TaskRTF', which was not supplied.

Maybe I missed something when adding a field. The error is on the invoke line
Dim results() As Object = Me.Invoke("UpdateTasks", New Object() {ticket, projectID, dsTasks})

Here is what I did.
1.) Added the field to the SQL table Task.TaskRTF
2.) Updated the GetTasks procedures to include TaskRTF
3.) Updated the UpdateTasks procedures to include TaskRTF
4.) Updated the DataSetTasks.xsd
5.) Updated the WebReference in DataWs which added the fireld to DataSetTasks.xsd.
6.) In the DataService.asmx if I preview Data I see the field TaskRTF
7.) Added the field to EditTasks form.
8.) Run / Edit Task / Click OK / Error!

What am I missing.

Thanks...
- jim

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 4
Did you update DataSetTasks.vb?
codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 5
No because it was autogenerated.
How do I regenerate and what is generating it?
codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 6
Perhaps there's an easier way, but I've re-written it by hand when I made database changes.
codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...
# 7
I checked the DatasetTasks.vb anf the field TaskRTF has been added.

Any other suggestions?

thanks

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Sample Applications...