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. Access and ASP.Net

Access and ASP.Net

Scheduled Pinned Locked Moved ASP.NET
helpcsharpjavascriptasp-netdatabase
4 Posts 3 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.
  • M Offline
    M Offline
    Muhammad Waqas Butt
    wrote on last edited by
    #1

    Hi, I'm using MS Access 2003 database with c#.net 2003. Now I've a comobo, in which department name are shown and onchangeindex i use to get department code, show i textbox. Now the problem is this when i add department no 11 in the database, my comobox stop working and i got javascript error: Error:Invaild Syntax in statusbar. Kindly help where i made a mistake ( In web code or database) I use normal database settings. Thanks

    |Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com

    S 1 Reply Last reply
    0
    • M Muhammad Waqas Butt

      Hi, I'm using MS Access 2003 database with c#.net 2003. Now I've a comobo, in which department name are shown and onchangeindex i use to get department code, show i textbox. Now the problem is this when i add department no 11 in the database, my comobox stop working and i got javascript error: Error:Invaild Syntax in statusbar. Kindly help where i made a mistake ( In web code or database) I use normal database settings. Thanks

      |Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      Please post your code or run your application with the Break point and try to locate in which line the error shows. We are not magic man without seeing the code how can we tell where the error is.

      Regards, Satips.:rose:

      M 1 Reply Last reply
      0
      • S Sathesh Sakthivel

        Please post your code or run your application with the Break point and try to locate in which line the error shows. We are not magic man without seeing the code how can we tell where the error is.

        Regards, Satips.:rose:

        M Offline
        M Offline
        Muhammad Waqas Butt
        wrote on last edited by
        #3

        Here is a code: try { string cmdstr="SELECT * FROM tablename where dp_head='"+ dpdhead.SelectedValue +"'"; con=new OleDbConnection(cons); cmd=new OleDbCommand(cmdstr,con); con.Open(); OleDbDataReader dr = cmd.ExecuteReader(); bool chkrec = dr.Read(); if(chkrec == true) { string dasv = dr.GetInt32(0).ToString(); txtacno.Text = dasv; } // Output '/LM/w3svc/1/root/expdemo-5-128280938191702288': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\expdemo\280c9982\bd477ac7\gottf48d.dll', Symbols loaded. // Now

        |Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com

        C 1 Reply Last reply
        0
        • M Muhammad Waqas Butt

          Here is a code: try { string cmdstr="SELECT * FROM tablename where dp_head='"+ dpdhead.SelectedValue +"'"; con=new OleDbConnection(cons); cmd=new OleDbCommand(cmdstr,con); con.Open(); OleDbDataReader dr = cmd.ExecuteReader(); bool chkrec = dr.Read(); if(chkrec == true) { string dasv = dr.GetInt32(0).ToString(); txtacno.Text = dasv; } // Output '/LM/w3svc/1/root/expdemo-5-128280938191702288': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\expdemo\280c9982\bd477ac7\gottf48d.dll', Symbols loaded. // Now

          |Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com

          C Offline
          C Offline
          Cfer83
          wrote on last edited by
          #4

          You may be better off by using a Parameter List for your OleDBCommand Object. replace your appropriate lines: string cmdstr = "SELECT * FROM Tablename where field = @fieldvalue;"; cmd = new OleDBCommand(cmdstr,con); cmd.Parameters.AddWithParameter("@fieldvalue",dpdhead.SelectedValue); Parameter Lists help organization And is another obstacle for Hackers. Also look to this: string dasv = dr[0].ToString();

          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