Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Inserting data using a Wizard Control ASP.net

Posted on 2013-06-26
7
Medium Priority
?
439 Views
Last Modified: 2013-06-27
Hi there, I am using this code for inserting data from a wizard control. I need to insert data on 2 tables, however I am be able to insert only on first index 0, but when the second part of the wizard is done, the second index is not saving on my other table.
Any help would be appreciated. Thanks.

Partial Class SignUpPhysian
    Inherits System.Web.UI.Page

    

    Protected Sub Wizard1_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.NextButtonClick
        'Dim val(1) As Byte
        If e.CurrentStepIndex = 0 Then
            Dim objEhr As New TarmarikDataContext
            objEhr.Modify_Doctors(1, 1, DoctorName.Text, DoctorLastName.Text, DoctorSurName.Text, DoctorEmail.Text, DoctorOfficeNumber.Text, DoctorMobileNumber.Text,
                                 DoctorFaxNumber.Text, ddDoctorGender.SelectedValue, DoctorAddress.Text, ddDoctorCountry.SelectedValue, ddDoctorCity.SelectedValue, ddCityZone.SelectedValue,
                                 DoctorZipCode.Text, ddDoctorSpeciality.SelectedValue, DoctorLicenseNumber.Text, ddDoctorRUC.Text, DoctorDOB.Text, "BIO")

        ElseIf e.CurrentStepIndex = 1 Then
            Dim objEhr As New TarmarikDataContext
            objEhr.Modify_Users(1, 1, UserId.Text, UserFirstName.Text, UserLastName.Text, DoctorPassword.Text, ddDoctorSecurityQuestion.SelectedValue, DoctorSecurityAnwer.Text, 1, Today, Today, Today, UserId.Text, True, "A")
        End If
    End Sub

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        UserId.Text = DoctorEmail.Text
        UserFirstName.Text = DoctorName.Text
        UserLastName.Text = DoctorLastName.Text

    End Sub
End Class

Open in new window

0
Comment
Question by:gfranco
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 

Author Comment

by:gfranco
ID: 39280245
hi guys, any help on this?
0
 
LVL 13

Expert Comment

by:Jitendra Patil
ID: 39280428
i think the step indexing starts with 1

try changing like
 If e.CurrentStepIndex = 1 Then
            Dim objEhr As New TarmarikDataContext
            objEhr.Modify_Doctors(1, 1, DoctorName.Text, DoctorLastName.Text, DoctorSurName.Text, DoctorEmail.Text, DoctorOfficeNumber.Text, DoctorMobileNumber.Text,
                                 DoctorFaxNumber.Text, ddDoctorGender.SelectedValue, DoctorAddress.Text, ddDoctorCountry.SelectedValue, ddDoctorCity.SelectedValue, ddCityZone.SelectedValue,
                                 DoctorZipCode.Text, ddDoctorSpeciality.SelectedValue, DoctorLicenseNumber.Text, ddDoctorRUC.Text, DoctorDOB.Text, "BIO")

        ElseIf e.CurrentStepIndex = 2 Then
            Dim objEhr As New TarmarikDataContext
            objEhr.Modify_Users(1, 1, UserId.Text, UserFirstName.Text, UserLastName.Text, DoctorPassword.Text, ddDoctorSecurityQuestion.SelectedValue, DoctorSecurityAnwer.Text, 1, Today, Today, Today, UserId.Text, True, "A")
        End If

Open in new window

hope this helps.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39280754
On 2nd step of your wizard, do you have Next button or Finish button?
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

Author Comment

by:gfranco
ID: 39281747
Finish button.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 39281847
That's your problem then because you have

Protected Sub Wizard1_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.NextButtonClick


Either add a separate handler for Finish or change existing to

Protected Sub Wizard1_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.NextButtonClick, Wizard1.FinishButtonClick
0
 

Author Comment

by:gfranco
ID: 39281851
Using the same index (0 and 1)? Let me try, thanks.
0
 

Author Closing Comment

by:gfranco
ID: 39281948
Thanks.
0

Featured Post

Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question