Vraag & Antwoord

Webprogrammeren & scripting

[ASP.NET] update/wijzig item (van datagrid) uit calendar

Hoi, Hetgeen wat ik wil is de mogelijkheid om een item uit de calendar te wijzigen/updaten. Ik heb al van alles geprobeerd, maar het lukt maar niet. Onderstaand gedeelte staat vast. [code:1:82f7d4a8e3] Dim myconnection As OleDbConnection Dim myda As OleDbDataAdapter Dim ds As New DataSet Dim dsSelDate As DataSet Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load myconnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("~/App_Data/database.mdb")) myda = New OleDbDataAdapter("Select * from tblAgenda_introductiegesprekken", myconnection) myda.Fill(ds, "AllTables") End Sub Protected Sub CalendarDRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) 'If the month is CurrentMonth If Not e.Day.IsOtherMonth Then Dim dr As DataRow For Each dr In ds.Tables(0).Rows 'If EventDate is not Null If Not dr("datum") Is DBNull.Value Then Dim dtEvent As DateTime = dr("datum").ToString 'If EventDate =CalendarDate If dtEvent.Equals(e.Day.Date) Then e.Cell.BackColor = Drawing.Color.DarkBlue End If End If Next 'If the month is not CurrentMonth then hide the Dates Else e.Cell.Text = "" End If End Sub Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged Dim cmd As New OleDbCommand("Select Id, Tijdstip, Geslacht, Naam, Geboortejaar, Gastvrouw from tblAgenda_introductiegesprekken where Datum=@datum order by Tijdstip desc", myconnection) cmd.Parameters.AddWithValue("@datum", Calendar1.SelectedDate) myda = New OleDbDataAdapter(cmd) dsSelDate = New DataSet myda.Fill(dsSelDate, "AllTables") If dsSelDate.Tables(0).Rows.Count = 0 Then DataGrid1.Visible = False Else DataGrid1.Visible = True DataGrid1.DataSource = dsSelDate DataGrid1.DataBind() End If [/code:1:82f7d4a8e3] Kan iemand mij helpen? M.vr.gr., Dalertje