Click here to Skip to main content
15,884,791 members
Please Sign up or sign in to vote.
1.67/5 (2 votes)
See more:
hi, currently doing an approval system. my problem is registration code and login code are didn't working. i need you help to solve this problem. im using oracle sql developer database. please someone kindly help me to solve this problem. below is the code for registration form:

VB.NET
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.OleDb
Imports System.Net.Mail
Imports System.Net


Partial Class Register
    Inherits System.Web.UI.Page


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub create_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim dv As Data.DataView
        dv = DataSource1.Select(DataSourceSelectArguments.Empty)

        Dim UserId As Integer = 0
        Dim connectionString As String = oledbConnectionStringBuilder()
        Dim connection As OleDb.OleDbConnection = New OleDb.OleDbConnection
        Dim con As OleDbConnection

        Using cmd As New OleDbCommand("Insert_User")
            Using sda As New OleDbDataAdapter
                cmd.CommandType = CommandType.StoredProcedure
                cmd.Parameters.AddWithValue("@Username", txtUsername)
                cmd.Parameters.AddWithValue("@Password", txtPassword)
                cmd.Parameters.AddWithValue("@Email", txtEmail)

                cmd.Connection = con
                con.Open()
                UserId = Convert.ToInt32(cmd.ExecuteScalar())
                con.Close()


            End Using
        End Using

        Dim message As String = String.Empty
        Select Case UserId

            Case -1
                message = "Username already exists.\nPlease choose a different Username."

                Exit Select

            Case -2
                message = "Supplied email address has already been used."

                Exit Select

            Case Else
                message = "Registration successful.
                Exit Select

        End Select
        ClientScript.RegisterStartupScript([GetType](), "alert", (Convert.ToString("alert('") & message) + "');", True)
    End Sub


VB.NET
  Private Function oledbConnectionStringBuilder() As String
        Throw New NotImplementedException
    End Function




End Class



pls help me.. thank you very much
Posted
Updated 23-Nov-15 15:28pm
v3
Comments
DamithSL 23-Nov-15 22:18pm    
Any exceptions? what is the message you get?
Member 12077709 23-Nov-15 22:26pm    
if i fill the information and click submit, the information wont be updated into the database.
You need to debug and find out the issues. Also write codes to handle exceptions.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900