Start 9.00 a.m.
_________________________________________________________
OK, its tea time, finally some time to blogg!!
I spent 5 hours today trying to figure out the error i got yesterday (read bottom of yesterdays post), and in the end after way too much research and asking for help from Alliyahh my sister to no avial, i tried doing this:
public void getClientList()
{Array lcArray = myService.getClientList();
Dictionary
{
serviceMain.clsClient serviceClient = item;
string clientID = serviceClient.propertyClientID;
string clientName = serviceClient.propertyName;
clsClient lcClient = new clsClient(clientID, clientName);
lcClientList.Add(clientID, lcClient);
}
}
By using the serviceClient.Property and accesing this field it worked. I am going to be honest i have no idea how this really works, i stepped through and going over where the property is being assigned it didnt step into the service, so i'm assuming that its pulling this field from the array that has been passed in. But hey at least i got some where and now have data to use.
The funny thing is i spent so much time researching if anyone else had my problem, and only found a couple of posts that were similar but didnt have a solution. Well either way, what i was doing wrong was basically summed up in this post, "you are casting an object of type X to an object of type Y, and the twotypes are not compatible." What i'm thinking is that they are sort of the same type, but yea not really haha. Either way, whether this is bad practise or not? i have NO IDEA, but yea, at the moment all i am concerned about is getting the data to the client side and fill in the dictionarys so i can use them for the filling in of lists.
After i finaly fixed that issue i moved onto the code for filling in the rest of the lists. I have also wrote the code for inserting a record for management and client addresses, the reason this is more special is because the ID is generated by SQL server when a record is created, so i dont pass in the identifier (clientAddressID, managementAddressID) in but have to insert the rest of the columns into the database and then grab the ID and pass it back to the list server side, the the interface. I dont no the way most people go about the issue so i just did it like that, how i thought it would work logically.
For the rest of the night i will start filling data into the grid views, and figure out how to edit & delete etc. I also will update the UML diagram at some stage tonight or tomorow to reflect what ive changed so far.
_________________________________________________________
Finish 9.30 p.m. 11 hours
_________________________________________________________
Links:
http://www.themssforum.com/Csharp/property-array/
http://www.java2s.com/Code/CSharp/Language-Basics/Indexerallowarraylikeindex.htm
http://www.dotnet247.com/247reference/msgs/58/290679.aspx
http://www.dotnet247.com/247reference/msgs/39/196536.aspx
http://ryanfarley.com/blog/archive/2004/05/26/737.aspx
http://www.programmersheaven.com/2/XML-Webservice-FAQ-Pass-Array-Of-Custom-Objects http://www.developer.com/net/asp/article.php/3657826
http://blogs.msdn.com/markjo/archive/2006/09/05/740893.aspx
http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.aspnet.webservices/2005-06/msg00068.html
http://yassers.com/content/book/chapters/chapter9.htm
http://www.dotnet247.com/247reference/msgs/58/291597.aspx
No comments:
Post a Comment