3月 26, 2009

接Return參數


Protected Sub btn_Check_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_Check.Click
        Me.SqlDataSource1.SelectParameters("學號").DefaultValue = Me.txt_Stu1_ID.Text
        Me.SqlDataSource1.Select(DataSourceSelectArguments.Empty)
       
    End Sub


    Protected Sub SqlDataSource1_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SqlDataSource1.Selected
        Dim cmd As IDbCommand = e.Command
        Dim Return_Param As SqlParameter
        Return_Param = CType(cmd.Parameters("@RETURN"), SqlParameter)


        If Return_Param.Value > 0 Then
            Me.Label1.Text = "重複申請!!"
        Else


            sds_SingleApplyDetailsWithCommit.Insert()
            Response.Redirect("申請成功.aspx")
        End If
    End Sub


沒有留言: