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. General Programming
  3. .NET (Core and Framework)
  4. Help Needed

Help Needed

Scheduled Pinned Locked Moved .NET (Core and Framework)
databasehelp
4 Posts 2 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.
  • A Offline
    A Offline
    Arunava35
    wrote on last edited by
    #1

    am working on a project with the following codes: Private Sub prono_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles prono.TextChanged obj = objordder.getIDfrmno(CStr(prono.Text)) cmdPid.Text = Val(obj) End Sub where objordder.getIDfrmno is the dll and cmdPid.Text is the destinesion text box the definetion for objordder.getIDfrmno is as follows: public object getIDfrmno(int productno) { SqlConnection con = new SqlConnection(constr); string sql = "select ProductID from tblProduct where productno=" + productno + ""; SqlCommand cmd = new SqlCommand(sql, con); con.Open(); object obj = cmd.ExecuteScalar(); con.Close(); return (obj); } constr is the conecction string but not being able to get the desiered result can anyone hrlp

    D 1 Reply Last reply
    0
    • A Arunava35

      am working on a project with the following codes: Private Sub prono_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles prono.TextChanged obj = objordder.getIDfrmno(CStr(prono.Text)) cmdPid.Text = Val(obj) End Sub where objordder.getIDfrmno is the dll and cmdPid.Text is the destinesion text box the definetion for objordder.getIDfrmno is as follows: public object getIDfrmno(int productno) { SqlConnection con = new SqlConnection(constr); string sql = "select ProductID from tblProduct where productno=" + productno + ""; SqlCommand cmd = new SqlCommand(sql, con); con.Open(); object obj = cmd.ExecuteScalar(); con.Close(); return (obj); } constr is the conecction string but not being able to get the desiered result can anyone hrlp

      D Offline
      D Offline
      DigiOz Multimedia
      wrote on last edited by
      #2

      Arunava35 wrote:

      constr is the conecction string

      What is the exact connection string you are using?

      Arunava35 wrote:

      but not being able to get the desiered result can anyone hrlp

      In what way? Is it giving you an error message? If so, what is the error message. Or is it giving you a blank screen?

      Pete Soheil DigiOz Multimedia http://www.digioz.com

      A 1 Reply Last reply
      0
      • D DigiOz Multimedia

        Arunava35 wrote:

        constr is the conecction string

        What is the exact connection string you are using?

        Arunava35 wrote:

        but not being able to get the desiered result can anyone hrlp

        In what way? Is it giving you an error message? If so, what is the error message. Or is it giving you a blank screen?

        Pete Soheil DigiOz Multimedia http://www.digioz.com

        A Offline
        A Offline
        Arunava35
        wrote on last edited by
        #3

        it is not giving an error but the result which is being shown is not correct.

        D 1 Reply Last reply
        0
        • A Arunava35

          it is not giving an error but the result which is being shown is not correct.

          D Offline
          D Offline
          DigiOz Multimedia
          wrote on last edited by
          #4

          That can only mean that your query is wrong, and/or you didn't take a foreign key relation or something along those lines into consideration.

          Pete Soheil DigiOz Multimedia http://www.digioz.com

          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