Mysql Odbc Memory Allocation Error
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Memory allocation error from MySql ODBC 5.1 driver in C# application on insert statement up vote 4 down vote favorite 1 I have a .NET Wndows application in C#. It's a simple Windows application that is using the MySql 5.1 database community edition. I've downloaded the MySql ODBC driver and have created a dsn to my database on my local machine. On my application, I can perform get type queries without problems, but when I execute a given insert statement (not that I've tried doing any others), I get the following error: {"ERROR [HY001] [MySQL][ODBC 5.1 Driver][mysqld-5.0.27-community-nt]Memory allocation error"} I'm running on a Windows XP machine. My machine has 1 GB of memory. Anyone have any ideas? See code below OdbcConnection MyConn = DBConnection.getDBConnection(); int result = -1; try { MyConn.Open(); OdbcCommand myCmd = new OdbcCommand(); myCmd.Connection = MyConn; myCmd.CommandType = CommandType.Text; OdbcParameter userName = new OdbcParameter("@UserName", u.UserName); OdbcParameter password = new OdbcParameter("@Password", u.Password); OdbcParameter firstName = new OdbcParameter("@FirstName", u.FirstName); OdbcParameter LastName = new OdbcParameter("@LastName", u.LastName); OdbcParameter sex = new OdbcParameter("@sex", u.Sex); myCmd.Parameters.Add(userName); myCmd.Parameters.Add(password); myCmd.Parameters.Add(firstName); myCmd.Parameters.Add(LastName); myCmd.Parameters.Add(sex); myCmd.CommandText = mySqlQueries.insertChatUser; result = myCmd.ExecuteNonQuery(); } catch (Exception e) { //{"ERROR [HY001] [MySQL][ODBC 5.1 Driver][mysqld-5.0.27-community-nt]Memory // allocation error"} EXCEPTION ALWAYS THROWN HERE } finally { try { if (MyConn != null) MyConn.Close(); } finally { } } c# .net mysql odbc share|improve this question asked Jun 5 '10 at 17:10 Chinjoo 1,09051738 add a comment| 2 Answers 2 active oldest votes up vote 9 down vote accepted It was because some fields accept null, I had passed them as null
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Memory allocation error from MySql ODBC 5.1 driver in ASP .NET C# application on insert statement Want to Advertise Here? Solved Memory allocation error from MySql ODBC 5.1 http://stackoverflow.com/questions/2981270/memory-allocation-error-from-mysql-odbc-5-1-driver-in-c-sharp-application-on-ins driver in ASP .NET C# application on insert statement Posted on 2009-02-09 .NET Programming C# MySQL Server 1 Verified Solution 8 Comments 3,469 Views Last Modified: 2013-11-07 I have a ASP .NET application in C#. It's a simple web application that is using the MySql 5.1 database community edition. I've downloaded the MySql ODBC driver and have created a dsn to my https://www.experts-exchange.com/questions/24128176/Memory-allocation-error-from-MySql-ODBC-5-1-driver-in-ASP-NET-C-application-on-insert-statement.html database on my local machine. On my website, I can perform get type queries without problems, but when I execute a given insert statement (not that I've tried doing any others), I get the following error: {"ERROR [HY001] [MySQL][ODBC 5.1 Driver][mysqld-5.1.30-community]Memory allocation error"} I've tried switching everything over to the MyISam engine and increasing memory allocation where I could see it was used; however, I've got no idea why this is being caused. I'm running on a Windows XP machine. My machine has 4 GB of memory (only 3 GB detected due to 32 bit). I'm using MySql Administrator and am watching the connections and every time I open a connection, I see about 5 connections listed to the database. All of my methods close the connection too. Anyone have any ideas? See code below public static readonly String insertChatUser = @"insert into chatuser ( Username, Password, Firstname, Lastname, Sex ) Values ( ?, ? , ? , ? , ?)"; public static void insertChatUser(User u) { OdbcConnection MyConn = DBConnect
Tips/Tricks Top Articles Beginner Articles Technical Blogs Posting/Update Guidelines Article Help Forum Article Competition Submit an article or tip Post your Blog quick answersQ&A Ask http://www.codeproject.com/Questions/194199/memory-allocation-error-while-insert a Question View Unanswered Questions View All Questions... Linux questions C# questions ASP.NET questions SQL questions fabric questions discussionsforums All Message Boards... Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI C# Free Tools Objective-C and Swift mysql odbc Database Hardware & Devices> System Admin Hosting and Servers Java .NET Framework Android iOS Mobile SharePoint Silverlight / WPF Visual Basic Web Development Site Bugs / Suggestions Spam and Abuse Watch features Competitions News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase Research Library CodeProject Stuff communitylounge Who's Who Most Valuable Professionals The Lounge mysql odbc memory The Insider News The Weird & The Wonderful The Soapbox Press Releases Non-English Language > General Indian Topics General Chinese Topics help What is 'CodeProject'? General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site Map Advertise with us About our Advertising Employment Opportunities About Us Ask a Question All Questions All Unanswered FAQ memory allocation error while insert Rate this: Please Sign up or sign in to vote. See more: C# MySQL ODBC Dear all now i was having a problem with UTF8 and my program and the sol was to use ODBC 5.1 instead of 3.5 but now i found new problem when i insert using the following sql command INSERT INTO users (UserName, PassWord) VALUES (?, SHA1(?)) i get ODBC 5.1 error memory allocation error !! although it was working so fine in ODBC 3.5 and when i just remove SHA1 , it worked again ?? so what should i do? i tried many other fun. like MD5 , encrypt ...... all not working Posted 10-May-11 6:46am Just_Done14.9K Updated 10-May-