Click here to Skip to main content
15,918,178 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Advice for tracking a recordset change - Hash Value? Pin
Brad6ft414-Apr-06 8:47
Brad6ft414-Apr-06 8:47 
GeneralRe: Advice for tracking a recordset change - Hash Value? Pin
Dave Kreskowiak14-Apr-06 9:28
mveDave Kreskowiak14-Apr-06 9:28 
GeneralRe: Advice for tracking a recordset change - Hash Value? Pin
Brad6ft417-Apr-06 4:42
Brad6ft417-Apr-06 4:42 
GeneralRe: Advice for tracking a recordset change - Hash Value? Pin
Dave Kreskowiak17-Apr-06 12:29
mveDave Kreskowiak17-Apr-06 12:29 
GeneralRe: Advice for tracking a recordset change - Hash Value? Pin
Brad6ft422-Apr-06 6:33
Brad6ft422-Apr-06 6:33 
Questionobjectdatasource has no values to insert Pin
dr S.A.f.14-Apr-06 2:43
dr S.A.f.14-Apr-06 2:43 
AnswerRe: objectdatasource has no values to insert Pin
Steve Pullan14-Apr-06 3:50
Steve Pullan14-Apr-06 3:50 
GeneralRe: objectdatasource has no values to insert Pin
dr S.A.f.14-Apr-06 8:20
dr S.A.f.14-Apr-06 8:20 
Imports System.data
Partial Class VergaderingWijzigen
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack() Then
            fillDropDownList()
            Dim key() As String = {"agendaPuntId"}
            gvAgendaPunten.DataKeyNames = key
            gvAgendaPunten.Visible = False
        Else
            gvLeden.DataBind()
        End If
    End Sub
    Private Property loadDataEmpty()
        Get
            Return CType(ViewState("loadDataEmpty"), Boolean)
        End Get
        Set(ByVal value)
            ViewState("loadDataEmpty") = value
        End Set
    End Property
    Protected Sub fillDropDownList()
        Dim collectionVergaderingen As IDataReader = DatabaseAgent.selectUsersVergaderingen("ST")
        ddlVergaderingen.DataSource = collectionVergaderingen
        ddlVergaderingen.DataTextField = "titel"
        ddlVergaderingen.DataValueField = "vergaderingid"
        ddlVergaderingen.DataBind()
        collectionVergaderingen.Close()
        If ddlVergaderingen.Items.Count = 0 Then
            ddlVergaderingen.Visible = False
            lblError.Visible = True
            lblError.Text = "Er zijn geen vergaderingen gepland die u kunt wijzigen"
        Else
            lblError.Visible = True
            ddlVergaderingen.Visible = True
            ddlVergaderingen.Items.Add(New ListItem("Selecteer vergadering", -1))
            ddlVergaderingen.SelectedValue = -1
        End If


    End Sub

    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlVergaderingen.SelectedIndexChanged
        gvAgendaPunten.Visible = True
    End Sub

    Protected Sub odsAgendaPunten_Inserting(ByVal sender As Object, ByVal e As ObjectDataSourceMethodEventArgs) Handles odsAgendaPunten.Inserting
        e.InputParameters("agendaPunt") = CType(gvAgendaPunten.FooterRow.FindControl("txtAgendaPunt"), TextBox).Text
        e.InputParameters("vergaderingId") = ddlVergaderingen.SelectedValue
    End Sub

    Protected Sub odsAgendaPunten_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs) Handles odsAgendaPunten.Selected
        If Not e.Exception Is Nothing Then
            Throw e.Exception
        End If
        Dim d As DataTable = CType(e.ReturnValue, DataSet).Tables.Item(0)
        If d.Rows.Count = 0 Then
            d.Rows.Add(d.NewRow())
            loadDataEmpty = True
        Else
            loadDataEmpty = False
        End If
    End Sub

    Protected Sub odsAgendaPunten_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles odsAgendaPunten.Selecting
        Console.Write("hallo")
    End Sub

    Protected Sub gvAgendaPunten_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvAgendaPunten.RowCommand
        If e.CommandName = "Save" Then
            odsAgendaPunten.Insert()
        End If
    End Sub

    Protected Sub gvAgendaPunten_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvAgendaPunten.RowCreated
        If (loadDataEmpty) And e.Row.RowType = DataControlRowType.DataRow Then
            e.Row.Visible = False
            e.Row.Controls.Clear()
        End If
    End Sub

    Protected Sub gvAgendaPunten_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvAgendaPunten.SelectedIndexChanged

    End Sub
  
    Protected Sub btnAddAgendaPunt_Click1(ByVal sender As Object, ByVal e As System.EventArgs)
        DatabaseAgent.insertAgendaPunt(New DAgendaPunt(ddlVergaderingen.SelectedValue, CType(gvAgendaPunten.FindControl("txtAgendaPunt"), TextBox).Text))
    End Sub
End Class

This is the complete codebehind. (the way it looked before I started to try out several things to get it to work.)
I do have code for the inserting event, offcourse I forgot to mention that in my first post Smile | :)
Or do I have to raise that event somewhere manually?
QuestionVb 6 and access 2000 in LAN Pin
arunendra14-Apr-06 2:11
arunendra14-Apr-06 2:11 
AnswerRe: Vb 6 and access 2000 in LAN Pin
Dave Kreskowiak14-Apr-06 3:34
mveDave Kreskowiak14-Apr-06 3:34 
GeneralRe: Vb 6 and access 2000 in LAN Pin
arunendra14-Apr-06 5:15
arunendra14-Apr-06 5:15 
GeneralRe: Vb 6 and access 2000 in LAN Pin
Dave Kreskowiak14-Apr-06 6:43
mveDave Kreskowiak14-Apr-06 6:43 
GeneralRe: Vb 6 and access 2000 in LAN Pin
arunendra14-Apr-06 7:10
arunendra14-Apr-06 7:10 
GeneralRe: Vb 6 and access 2000 in LAN Pin
Dave Kreskowiak14-Apr-06 7:14
mveDave Kreskowiak14-Apr-06 7:14 
GeneralRe: Vb 6 and access 2000 in LAN Pin
arunendra14-Apr-06 23:35
arunendra14-Apr-06 23:35 
GeneralRe: Vb 6 and access 2000 in LAN Pin
Dave Kreskowiak15-Apr-06 3:37
mveDave Kreskowiak15-Apr-06 3:37 
GeneralRe: Vb 6 and access 2000 in LAN Pin
arunendra15-Apr-06 5:18
arunendra15-Apr-06 5:18 
GeneralRe: Vb 6 and access 2000 in LAN Pin
Dave Kreskowiak15-Apr-06 6:47
mveDave Kreskowiak15-Apr-06 6:47 
GeneralRe: Vb 6 and access 2000 in LAN Pin
arunendra16-Apr-06 2:26
arunendra16-Apr-06 2:26 
GeneralRe: Vb 6 and access 2000 in LAN Pin
Dave Kreskowiak16-Apr-06 10:24
mveDave Kreskowiak16-Apr-06 10:24 
GeneralRe: Vb 6 and access 2000 in LAN Pin
arunendra17-Apr-06 0:02
arunendra17-Apr-06 0:02 
GeneralRe: Vb 6 and access 2000 in LAN Pin
Dave Kreskowiak17-Apr-06 2:56
mveDave Kreskowiak17-Apr-06 2:56 
Questionhotmail account Pin
TAREQ F ABUZUHRI14-Apr-06 2:06
TAREQ F ABUZUHRI14-Apr-06 2:06 
GeneralRe: hotmail account Pin
Guffa14-Apr-06 2:42
Guffa14-Apr-06 2:42 
AnswerRe: hotmail account Pin
Dave Kreskowiak14-Apr-06 4:32
mveDave Kreskowiak14-Apr-06 4:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.