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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. doest work!!!

doest work!!!

Scheduled Pinned Locked Moved Visual Basic
helpsharepoint
2 Posts 2 Posters 1 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.
  • P Offline
    P Offline
    pandapatin
    wrote on last edited by
    #1

    this is my code for login but it has an error.it stuck when comes to Myconn.open(). the error is : The ConnectionString property has not been initialized. this is the code : Function DBAuthenticate(ByVal strUsername As String, ByVal strPassword As String) As Integer Dim conMyData As SqlConnection Dim cmdSelect As SqlCommand Dim parmReturnValue As SqlParameter Dim intResult As Integer conMyData = New SqlConnection(ConfigurationManager.AppSettings("psmConnectionString")) cmdSelect = New SqlCommand("sp_ValidateUser", conMyData) cmdSelect.CommandType = CommandType.StoredProcedure parmReturnValue = cmdSelect.Parameters.Add("RETURN_VALUE", SqlDbType.Int) parmReturnValue.Direction = ParameterDirection.Input cmdSelect.Parameters.Add("@noPekerja", SqlDbType.VarChar) cmdSelect.Parameters.Add("@pWord", SqlDbType.VarChar) conMyData.Open() cmdSelect.ExecuteNonQuery() intResult = cmdSelect.Parameters("RETURN_VALUE").Value conMyData.Close() If intResult < 0 Then If intResult = -1 Then lblMessage.Text = "Username Not Registered!" Else lblMessage.Text = "Invalid Password!" End If End If End Function pliz anybody can help me.

    C 1 Reply Last reply
    0
    • P pandapatin

      this is my code for login but it has an error.it stuck when comes to Myconn.open(). the error is : The ConnectionString property has not been initialized. this is the code : Function DBAuthenticate(ByVal strUsername As String, ByVal strPassword As String) As Integer Dim conMyData As SqlConnection Dim cmdSelect As SqlCommand Dim parmReturnValue As SqlParameter Dim intResult As Integer conMyData = New SqlConnection(ConfigurationManager.AppSettings("psmConnectionString")) cmdSelect = New SqlCommand("sp_ValidateUser", conMyData) cmdSelect.CommandType = CommandType.StoredProcedure parmReturnValue = cmdSelect.Parameters.Add("RETURN_VALUE", SqlDbType.Int) parmReturnValue.Direction = ParameterDirection.Input cmdSelect.Parameters.Add("@noPekerja", SqlDbType.VarChar) cmdSelect.Parameters.Add("@pWord", SqlDbType.VarChar) conMyData.Open() cmdSelect.ExecuteNonQuery() intResult = cmdSelect.Parameters("RETURN_VALUE").Value conMyData.Close() If intResult < 0 Then If intResult = -1 Then lblMessage.Text = "Username Not Registered!" Else lblMessage.Text = "Invalid Password!" End If End If End Function pliz anybody can help me.

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

      pandapatin wrote:

      ConfigurationManager.AppSettings("psmConnectionString")

      This is not returning a value because the config file is not set up properly. ColinMackay.net Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

      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