Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. login page

login page

Scheduled Pinned Locked Moved ASP.NET
sharepointtoolsarchitecturehelpannouncement
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sritha
    wrote on last edited by
    #1

    we completed the registration page in our project and whatever the details we have given in that registration page they are also going to update in the backend also. but whatever the username and password we have given in the registration page is not accepted by the login page.while giving the username and password it is showing the error like below object reference is not set to an instance of an object code i have written for registration page bal data = new bal(); data.FirstName = Text_FirstName.Text.Trim(); data.LastName = Text_LastName.Text.Trim(); data.Gender = Text_Gender.Text.Trim(); data.EmailId = Text_EmailId.Text.Trim(); data.UserName = Text_UserName.Text.Trim(); data.Password = Text_Password.Text.Trim(); data.ConfirmPassword = Text_ConfirmPassword.Text.Trim(); data.Country = ddlCountry.SelectedItem.ToString(); data.State = Text_state.Text.Trim(); data.City = Text_City.Text.Trim(); data.Dob = DateTime.Parse(Dob.Value); data.PhoneNumber = Text_PhoneNumber.Text.Trim(); data.MobileNumber = Text_MobileNumber.Text.Trim(); data.Currentlocation = Text_Currentlocation.Text.Trim(); data.PreferedJobLocations = Text_Location.Text.Trim(); data.JobCategory = ddljobcategory.SelectedItem.ToString(); data.KeySkills = Text_KeySkills.Text.Trim(); data.HighestQualificationheld = ddlhqh.SelectedItem.ToString(); data.SpecialisationMajor = ddlspecialisation.SelectedItem.ToString(); data.Institute = ddlinstitute.SelectedItem.ToString(); data.YearPassedOut = ddlyrpassedout.SelectedItem.ToString(); try { int res = data.insertreg(); if (res > 0) { Page.RegisterStartupScript("SS", "<script> alert('Completed Successfully');</script>"); } else { lblmessage.Text = "registration failed"; } } catch { } i have used 3 tier architecture the code in the dal layer for registration page static SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ToString()); internal static int insertreg(bal bal) { //throw new NotImplementedException(); con.Close(); con.Open(); SqlCommand cmd = new SqlCommand("sp_reg", con); cmd.CommandType = CommandType.StoredPr

    C S A 3 Replies Last reply
    0
    • S sritha

      we completed the registration page in our project and whatever the details we have given in that registration page they are also going to update in the backend also. but whatever the username and password we have given in the registration page is not accepted by the login page.while giving the username and password it is showing the error like below object reference is not set to an instance of an object code i have written for registration page bal data = new bal(); data.FirstName = Text_FirstName.Text.Trim(); data.LastName = Text_LastName.Text.Trim(); data.Gender = Text_Gender.Text.Trim(); data.EmailId = Text_EmailId.Text.Trim(); data.UserName = Text_UserName.Text.Trim(); data.Password = Text_Password.Text.Trim(); data.ConfirmPassword = Text_ConfirmPassword.Text.Trim(); data.Country = ddlCountry.SelectedItem.ToString(); data.State = Text_state.Text.Trim(); data.City = Text_City.Text.Trim(); data.Dob = DateTime.Parse(Dob.Value); data.PhoneNumber = Text_PhoneNumber.Text.Trim(); data.MobileNumber = Text_MobileNumber.Text.Trim(); data.Currentlocation = Text_Currentlocation.Text.Trim(); data.PreferedJobLocations = Text_Location.Text.Trim(); data.JobCategory = ddljobcategory.SelectedItem.ToString(); data.KeySkills = Text_KeySkills.Text.Trim(); data.HighestQualificationheld = ddlhqh.SelectedItem.ToString(); data.SpecialisationMajor = ddlspecialisation.SelectedItem.ToString(); data.Institute = ddlinstitute.SelectedItem.ToString(); data.YearPassedOut = ddlyrpassedout.SelectedItem.ToString(); try { int res = data.insertreg(); if (res > 0) { Page.RegisterStartupScript("SS", "<script> alert('Completed Successfully');</script>"); } else { lblmessage.Text = "registration failed"; } } catch { } i have used 3 tier architecture the code in the dal layer for registration page static SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ToString()); internal static int insertreg(bal bal) { //throw new NotImplementedException(); con.Close(); con.Open(); SqlCommand cmd = new SqlCommand("sp_reg", con); cmd.CommandType = CommandType.StoredPr

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      sritha wrote:

      object reference is not set to an instance of an object

      And what line is that error occurring?

      sritha wrote:

      catch { }

      This is bad practice - Don't do it.

      sritha wrote:

      try { return ds; } catch { throw; } finally { cmd.Dispose(); con.Close(); }

      WTF? Exactly what exception will return ds throw? Surely the try block should go around everything, not just the last line. You are not doing anything in the catch block other than rethrowing the exception. Remove the catch block it is not required. Your connection is stored elsewhere. .NET does connection pooling, don't keep connection objects around, create a new one each time.

      Man who stand on hill with mouth open wait long time for roast duck to drop in

      1 Reply Last reply
      0
      • S sritha

        we completed the registration page in our project and whatever the details we have given in that registration page they are also going to update in the backend also. but whatever the username and password we have given in the registration page is not accepted by the login page.while giving the username and password it is showing the error like below object reference is not set to an instance of an object code i have written for registration page bal data = new bal(); data.FirstName = Text_FirstName.Text.Trim(); data.LastName = Text_LastName.Text.Trim(); data.Gender = Text_Gender.Text.Trim(); data.EmailId = Text_EmailId.Text.Trim(); data.UserName = Text_UserName.Text.Trim(); data.Password = Text_Password.Text.Trim(); data.ConfirmPassword = Text_ConfirmPassword.Text.Trim(); data.Country = ddlCountry.SelectedItem.ToString(); data.State = Text_state.Text.Trim(); data.City = Text_City.Text.Trim(); data.Dob = DateTime.Parse(Dob.Value); data.PhoneNumber = Text_PhoneNumber.Text.Trim(); data.MobileNumber = Text_MobileNumber.Text.Trim(); data.Currentlocation = Text_Currentlocation.Text.Trim(); data.PreferedJobLocations = Text_Location.Text.Trim(); data.JobCategory = ddljobcategory.SelectedItem.ToString(); data.KeySkills = Text_KeySkills.Text.Trim(); data.HighestQualificationheld = ddlhqh.SelectedItem.ToString(); data.SpecialisationMajor = ddlspecialisation.SelectedItem.ToString(); data.Institute = ddlinstitute.SelectedItem.ToString(); data.YearPassedOut = ddlyrpassedout.SelectedItem.ToString(); try { int res = data.insertreg(); if (res > 0) { Page.RegisterStartupScript("SS", "<script> alert('Completed Successfully');</script>"); } else { lblmessage.Text = "registration failed"; } } catch { } i have used 3 tier architecture the code in the dal layer for registration page static SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ToString()); internal static int insertreg(bal bal) { //throw new NotImplementedException(); con.Close(); con.Open(); SqlCommand cmd = new SqlCommand("sp_reg", con); cmd.CommandType = CommandType.StoredPr

        S Offline
        S Offline
        saanj
        wrote on last edited by
        #3

        Hi, Have you tried to debug it by setting breakpoints and stepping into the execution lines? Debug and you will definitely find the issue. Regards Saanj

        Either you love IT or leave IT...

        1 Reply Last reply
        0
        • S sritha

          we completed the registration page in our project and whatever the details we have given in that registration page they are also going to update in the backend also. but whatever the username and password we have given in the registration page is not accepted by the login page.while giving the username and password it is showing the error like below object reference is not set to an instance of an object code i have written for registration page bal data = new bal(); data.FirstName = Text_FirstName.Text.Trim(); data.LastName = Text_LastName.Text.Trim(); data.Gender = Text_Gender.Text.Trim(); data.EmailId = Text_EmailId.Text.Trim(); data.UserName = Text_UserName.Text.Trim(); data.Password = Text_Password.Text.Trim(); data.ConfirmPassword = Text_ConfirmPassword.Text.Trim(); data.Country = ddlCountry.SelectedItem.ToString(); data.State = Text_state.Text.Trim(); data.City = Text_City.Text.Trim(); data.Dob = DateTime.Parse(Dob.Value); data.PhoneNumber = Text_PhoneNumber.Text.Trim(); data.MobileNumber = Text_MobileNumber.Text.Trim(); data.Currentlocation = Text_Currentlocation.Text.Trim(); data.PreferedJobLocations = Text_Location.Text.Trim(); data.JobCategory = ddljobcategory.SelectedItem.ToString(); data.KeySkills = Text_KeySkills.Text.Trim(); data.HighestQualificationheld = ddlhqh.SelectedItem.ToString(); data.SpecialisationMajor = ddlspecialisation.SelectedItem.ToString(); data.Institute = ddlinstitute.SelectedItem.ToString(); data.YearPassedOut = ddlyrpassedout.SelectedItem.ToString(); try { int res = data.insertreg(); if (res > 0) { Page.RegisterStartupScript("SS", "<script> alert('Completed Successfully');</script>"); } else { lblmessage.Text = "registration failed"; } } catch { } i have used 3 tier architecture the code in the dal layer for registration page static SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ToString()); internal static int insertreg(bal bal) { //throw new NotImplementedException(); con.Close(); con.Open(); SqlCommand cmd = new SqlCommand("sp_reg", con); cmd.CommandType = CommandType.StoredPr

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          sritha wrote:

          object reference is not set to an instance of an object

          Did you debug your code? Where are you getting the error ? Does that object initialize?

          cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups