Tuesday, 9 November 2010

Week10

14/Nov/2010

I thought ADO.Net can retrieve SELECT results and RETURN@parameter as the same time but it seems not possible. I may need to research more but the thing is no time. I changed the cording and now it's fine. My team mate has been working on invoice and payment sections and these are the functions of unclear to us. We tried to think the business logic behind and I suggested him what I thought it was the best. However, today I got it much more clear than ever. Sorry, my friend. I should have gotten it much earlier. This is because of the lack of experience. I always appreciate  your effort and I like your challenge but I always put you into not correct direction. Hope you understand me.


13/Nov/2010


New problem. DATETIME! To calculate working hours, I need to subtract EndTime from StartTime. User type these 2 times in textboxes and I thought I was going to code in C#. After researched a lot, I gave up. No error but no result.
        DateTime StartTime = DateTime.Parse(txtStartTime.Text);
        DateTime EndTime = DateTime.Parse(txtEndTime.Text);
        TimeSpan difference = EndTime.Subtract(StartTime);
        string TotalHours = new DateTime(difference.Ticks).ToString("hh:mm");
        lblTotalHours.Text = TotalHours;

This should work but not. So I changed to do this with SQL and succeeded!
        DATEDIFF(MINUTE,@StartTime,@EndTime)
Took to much time for this. I gotta go.



12/Nov/2010


I tried to solve the NULL value problem by creating the method but I couldn't. The difficulty is because of the data reader. So instead of that, I used like
                if (!rdr.IsDBNull(6)) { lblRemarks.Text = rdr.GetString(6); }
for each control. It works. I also couldn't solve the problem of something easy. Again SQL statement. Or I can say ADO.Net. I struggled with that through the last night. SQL itself is simple INSERT and UPDATE stuff. But I couldn't find the reason. This morning, with clear mind, I got it. Post back stuff. Post back ADO.Net wasn't in the if(!isPostBack) scope. OK.



11/Nov/2010

I have been feeling uncomfortable with Address table. In the current structure, whenever the user change any little thing, the data is deactivated and new one is inserted. The reason is to keep track of the address history. One address record consists of 3 addresses. There is no one correct answer there and it is too late to change but it is uncomfortable for me. I am still struggling with dealing with NULL value. I may be too lazy to code long but it may be the time to do it.


10/Nov/2010


I am struggling with sql statement. Suppose if there is a form to fill in and information will be stored in 3 different tables like Client, Address and Contact. And if all textbox are filled with something, it's fine but if some of them are left as blank, NULL values are trouble to deal with. I researched and what I found is several kinds of JOIN keywords.
  • (INNER)JOIN: Return rows when there is at least one match in both tables
  • LEFT (OUTER) JOIN: Return all rows from the left table, even if there are no matches in the right table
  • RIGHT (OUTER) JOIN: Return all rows from the right table, even if there are no matches in the left table
  • FULL (OUTER) JOIN: Return rows when there is a match in one of the tables
It's done but another problem is about IF statement in sql. I want to make it like
IF(@parameter !=NULL)
BEGIN
INSERT INTO....
END
This doesn't work well. I need to solve it ASAP!!



9/Nov/2010


Today was the first time we didn't present anything in a meeting. Nothing to show honestly. Some teams will finish their project in time so will not. My team will or will not? I prioritized functions. What we must finish? Mostly, we need to do anyway it seems. I keep working on my part. My part is all related to client table. Which means the core. And the core table structure has changed from the prototype. No stored procedure works as it was. it will take time.


8/Nov/2010

Implementation phase started. Still many things to be solved we have but anyway it's started. And we got one request (or order?) from our supervisor. "Finish the project by the next week presentation". One week to go? Gee. Never thought like that. Anyway we will try.  Also we discussed what we should do with the different types of the user's authorization. And the answer was to use ASP.Net membership function. Gotta research quick and well.

No comments:

Post a Comment