Month Calendar linked to a database [modified]
-
Hi Please can you help me. I've got an application that's a diary and contains 4 text boxes, and a Month Calendar. I've worked it so that I add an entry and save the details to the table. No probs. I've got a DIARYID, FKOWNERID and FKPONYID. The problem I've got is where the Owner has 2 ponies. When they select the 2nd pony then the Diary loads the 1st ponies details. It is not going through the binding source at all. The code I'm using is below: Imports System.Data.SqlClient Public Class SOCIALDIARY Dim AddNewEntry As Boolean = False Dim DeleteNewEntry As Boolean = False Public Sub PonysDiaryLoad() Dim i As Integer = 0 Hallofrm.MYOWNERBindingNavigator.BindingSource = Me.MYPONYSDIARYBindingSource Me.MYPONYSDIARYTableAdapter.FillByPony(Me.Database1DataSet.MYPONYSDIARY, CurrentPonysId) Hallofrm.btnClosePony.Visible = False If Me.Database1DataSet.MYPONYSDIARY.Rows.Count > 0 Then CurrentDiaryID = Me.Database1DataSet.MYPONYSDIARY.Rows(Me.MYPONYSDIARYBindingSource.Position).Item("DIARYID") Dim DiaryDates(Me.Database1DataSet.MYPONYSDIARY.Count - 1) As DateTime For Each dr As DataRow In Me.Database1DataSet.MYPONYSDIARY.Rows DiaryDates(i) = dr("DiaryDate") i += 1 Next MonthCalendar1.BoldedDates = DiaryDates End If lblDiaryId.Text = CurrentDiaryID lblPonyID.Text = CurrentPonysId End Sub Any advise would be greatly appreciated. Thanks: :confused: :( Kris MCP modified on Thursday, February 21, 2008 9:44 AM