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. Memory allocation error in odbc driver + mysql data base

Memory allocation error in odbc driver + mysql data base

Scheduled Pinned Locked Moved ASP.NET
databasemysqlperformancehelpquestion
3 Posts 3 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.
  • R Offline
    R Offline
    rinku soni 23
    wrote on last edited by
    #1

    hello every one i am trying to make a method which takes vaolues of controls and insert those into database. I am giving the code. The error message is ==" memory allocation " ==============code of Function is==================================== string cmdtext = "CALL INSERT_PROCEDURE(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; cmd = new OdbcCommand(cmdtext, con); OdbcParameter p2 = new OdbcParameter("_section", OdbcType.VarChar,50); p2.Value = @section ; OdbcParameter p3 = new OdbcParameter("_Broad_Cat", OdbcType.VarChar,50); p3.Value = @Broad_Cat; OdbcParameter p4 = new OdbcParameter("_Cat", OdbcType.VarChar,50); p4.Value = @Cat; OdbcParameter p5 = new OdbcParameter("_Attribute1", OdbcType.VarChar,50); p5.Value = @Attribute1; OdbcParameter p6 = new OdbcParameter("_Attribute2", OdbcType.VarChar,50); p6.Value = @Attribute2; OdbcParameter p7 = new OdbcParameter("_Attribute3", OdbcType.VarChar,50); p7.Value = @Attribute3; OdbcParameter p8 = new OdbcParameter("_Attribute4", OdbcType.VarChar,50); p8.Value = @Attribute4; OdbcParameter p9 = new OdbcParameter("_Attribute5", OdbcType.VarChar,50); p9.Value = @Attribute5; OdbcParameter p10 = new OdbcParameter("_Loaction", OdbcType.VarChar,50); p10.Value = @Location ; OdbcParameter p11 = new OdbcParameter("_pincode", OdbcType.VarChar,50); p11.Value = @Pincode; OdbcParameter p12 = new OdbcParameter("_Locality", OdbcType.VarChar,50); p12.Value = @Locality ; OdbcParameter p13 = new OdbcParameter("_Description", OdbcType.VarChar,50); p13.Value = @Description; OdbcParameter p14 = new OdbcParameter("_Image", OdbcType.VarChar,50 ); p14.Value = @Image; OdbcParameter p15 = new OdbcParameter("_Total_Char", OdbcType.VarChar,50); p15.Value = @Total_Char ; OdbcParameter p16 = new OdbcParameter("_Extra_Cha", OdbcType.VarChar,50); p16.Value = @Extra_Char ; OdbcParameter p17 = new OdbcParameter("_WebPage_Link", OdbcType.VarChar,50); p17.Value = @Web_Link ; OdbcParameter p18 = new OdbcParameter("_Email_id", OdbcType.VarChar,50); p18.Value = @Email_Id; OdbcParameter p19 = new OdbcParameter("_Total_Cost", OdbcType.VarChar,50); p19.Value = @Total_Cost; OdbcParameter p20 = new OdbcParameter("_Duration", OdbcType.VarChar,50); p20.Va

    A C 2 Replies Last reply
    0
    • R rinku soni 23

      hello every one i am trying to make a method which takes vaolues of controls and insert those into database. I am giving the code. The error message is ==" memory allocation " ==============code of Function is==================================== string cmdtext = "CALL INSERT_PROCEDURE(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; cmd = new OdbcCommand(cmdtext, con); OdbcParameter p2 = new OdbcParameter("_section", OdbcType.VarChar,50); p2.Value = @section ; OdbcParameter p3 = new OdbcParameter("_Broad_Cat", OdbcType.VarChar,50); p3.Value = @Broad_Cat; OdbcParameter p4 = new OdbcParameter("_Cat", OdbcType.VarChar,50); p4.Value = @Cat; OdbcParameter p5 = new OdbcParameter("_Attribute1", OdbcType.VarChar,50); p5.Value = @Attribute1; OdbcParameter p6 = new OdbcParameter("_Attribute2", OdbcType.VarChar,50); p6.Value = @Attribute2; OdbcParameter p7 = new OdbcParameter("_Attribute3", OdbcType.VarChar,50); p7.Value = @Attribute3; OdbcParameter p8 = new OdbcParameter("_Attribute4", OdbcType.VarChar,50); p8.Value = @Attribute4; OdbcParameter p9 = new OdbcParameter("_Attribute5", OdbcType.VarChar,50); p9.Value = @Attribute5; OdbcParameter p10 = new OdbcParameter("_Loaction", OdbcType.VarChar,50); p10.Value = @Location ; OdbcParameter p11 = new OdbcParameter("_pincode", OdbcType.VarChar,50); p11.Value = @Pincode; OdbcParameter p12 = new OdbcParameter("_Locality", OdbcType.VarChar,50); p12.Value = @Locality ; OdbcParameter p13 = new OdbcParameter("_Description", OdbcType.VarChar,50); p13.Value = @Description; OdbcParameter p14 = new OdbcParameter("_Image", OdbcType.VarChar,50 ); p14.Value = @Image; OdbcParameter p15 = new OdbcParameter("_Total_Char", OdbcType.VarChar,50); p15.Value = @Total_Char ; OdbcParameter p16 = new OdbcParameter("_Extra_Cha", OdbcType.VarChar,50); p16.Value = @Extra_Char ; OdbcParameter p17 = new OdbcParameter("_WebPage_Link", OdbcType.VarChar,50); p17.Value = @Web_Link ; OdbcParameter p18 = new OdbcParameter("_Email_id", OdbcType.VarChar,50); p18.Value = @Email_Id; OdbcParameter p19 = new OdbcParameter("_Total_Cost", OdbcType.VarChar,50); p19.Value = @Total_Cost; OdbcParameter p20 = new OdbcParameter("_Duration", OdbcType.VarChar,50); p20.Va

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      rinku soni 23 wrote:

      OdbcParameter p2 = new OdbcParameter("_section", OdbcType.VarChar,50); p2.Value = @section ;

      This is weird... :confused: We do like this...

      OdbcParameter p2 = new OdbcParameter("@section", OdbcType.VarChar,50);
      p2.Value = _section ; // if your insert_values gets the argument _section.

      Or you made symbolic representation??? or your variable is @section... :confused::confused: I dont think there is problem with memory allocation, with such few objects being created.. If it isnt from your SQL server where you might be running quite a long TSQL statements... :omg:

      Abhishek Sur


      My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

      **Don't forget to click "Good Answer" if you like to.

      1 Reply Last reply
      0
      • R rinku soni 23

        hello every one i am trying to make a method which takes vaolues of controls and insert those into database. I am giving the code. The error message is ==" memory allocation " ==============code of Function is==================================== string cmdtext = "CALL INSERT_PROCEDURE(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; cmd = new OdbcCommand(cmdtext, con); OdbcParameter p2 = new OdbcParameter("_section", OdbcType.VarChar,50); p2.Value = @section ; OdbcParameter p3 = new OdbcParameter("_Broad_Cat", OdbcType.VarChar,50); p3.Value = @Broad_Cat; OdbcParameter p4 = new OdbcParameter("_Cat", OdbcType.VarChar,50); p4.Value = @Cat; OdbcParameter p5 = new OdbcParameter("_Attribute1", OdbcType.VarChar,50); p5.Value = @Attribute1; OdbcParameter p6 = new OdbcParameter("_Attribute2", OdbcType.VarChar,50); p6.Value = @Attribute2; OdbcParameter p7 = new OdbcParameter("_Attribute3", OdbcType.VarChar,50); p7.Value = @Attribute3; OdbcParameter p8 = new OdbcParameter("_Attribute4", OdbcType.VarChar,50); p8.Value = @Attribute4; OdbcParameter p9 = new OdbcParameter("_Attribute5", OdbcType.VarChar,50); p9.Value = @Attribute5; OdbcParameter p10 = new OdbcParameter("_Loaction", OdbcType.VarChar,50); p10.Value = @Location ; OdbcParameter p11 = new OdbcParameter("_pincode", OdbcType.VarChar,50); p11.Value = @Pincode; OdbcParameter p12 = new OdbcParameter("_Locality", OdbcType.VarChar,50); p12.Value = @Locality ; OdbcParameter p13 = new OdbcParameter("_Description", OdbcType.VarChar,50); p13.Value = @Description; OdbcParameter p14 = new OdbcParameter("_Image", OdbcType.VarChar,50 ); p14.Value = @Image; OdbcParameter p15 = new OdbcParameter("_Total_Char", OdbcType.VarChar,50); p15.Value = @Total_Char ; OdbcParameter p16 = new OdbcParameter("_Extra_Cha", OdbcType.VarChar,50); p16.Value = @Extra_Char ; OdbcParameter p17 = new OdbcParameter("_WebPage_Link", OdbcType.VarChar,50); p17.Value = @Web_Link ; OdbcParameter p18 = new OdbcParameter("_Email_id", OdbcType.VarChar,50); p18.Value = @Email_Id; OdbcParameter p19 = new OdbcParameter("_Total_Cost", OdbcType.VarChar,50); p19.Value = @Total_Cost; OdbcParameter p20 = new OdbcParameter("_Duration", OdbcType.VarChar,50); p20.Va

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        This is really, really nasty. The issue as far as I can see is that you have 21 ? and you're only adding 20 parameters. I'd suggest cleaning this code up.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        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