Oledb Exception Was Unhandled Unspecified Error
Contents |
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 system.data.oledb.oledbexception unspecified error the company Business Learn more about hiring developers or posting ads with us Stack system.data.oledb.oledbexception unspecified error excel upload Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of
System.data.oledb.oledbexception Unspecified Error C#
6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up OleDbException was unhandled by user code in c# up vote 0 down vote favorite Here is the cs
System.data.oledb.oledbexception (0x80004005)
file: public int CheckExisting(String sqlDbQry, String sTable) { Qry = sqlDbQry; con = new OleDbConnection(connectionstr); if (con.State == ConnectionState.Open) con.Close(); con.Open(); cmd = new OleDbCommand(Qry, con); dr = cmd.ExecuteReader(); while (dr.Read()) rQry = Convert.ToInt32(dr[0].ToString()); con.Close(); return rQry; } Here is my another cs: protected void btnsub_Click(object sender, EventArgs e) { if (objAdmin.CheckExisting("SELECT COUNT(*) FROM registration where Email='" + Textemail.Text.Trim() + "'", "Temp") > 0) { lblmail.Text = "Your EmailId already Registered, Please system.data.oledb.oledbexception in c# Login!"; return; } if (objAdmin.CheckExisting("SELECT COUNT(*) FROM registration where Phone_num='" + Textphone.Text.Trim() + "'", "Temp") > 0) { lblmail.Text = "Mobile number already exists, Please Login!"; return; } } When i enter input details and hit submit, it shows error something like this, Here is the error of Screenshot Can anyone help me to fix this? c# asp.net oledbexception share|improve this question edited Oct 26 '15 at 16:37 user990423 1,3022824 asked Oct 26 '15 at 16:06 pcs 1,6002522 2 You have a SQL injection vulnerability. –SLaks Oct 26 '15 at 16:09 I m using msaccess.. –pcs Oct 26 '15 at 16:10 2 You still have a SQL injection vulnerability. –SLaks Oct 26 '15 at 16:10 sorry, i can't understand.. –pcs Oct 26 '15 at 16:11 en.wikipedia.org/wiki/SQL_injection –SLaks Oct 26 '15 at 16:11 | show 10 more comments 4 Answers 4 active oldest votes up vote 2 down vote You are manually building a sql string from a textbox labeled "email". Email addresses usually contain an "@". Because you are building a raw sql query you are putting the "@" directly in to the query. OleDb interprets that as a SQL parameter, and expects you to supply it, which you are not, which is what is caus
360 games PC games
System.data.oledb.oledbexception Error
Windows games Windows phone games Entertainment All Entertainment system data oledb oledbexception 0x80004005 unrecognized database format Movies & TV Music Business & Education Business Students & educators system.data.oledb.oledbexception (0x80040e14) Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet http://stackoverflow.com/questions/33350375/oledbexception-was-unhandled-by-user-code-in-c-sharp Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All https://support.microsoft.com/en-us/kb/825738 Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
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/125539/Unspecified-Error-OleDbException-was-unhandled-by 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 unspecified error Swift 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 system.data.oledb.oledbexception unspecified error 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 Unspecified Error - OleDbException was unhandled by user code, Help! Rate this: Please Sign up or sign in to vote. See more: VB Access VB.NET Hi, I get a problem with "Unspecified Error : OleDbException was unhandled by user code". I have a class for retriving datas from access database to datagridview. In rowpostpaint event of datagridview, it will call and get a returning value from a function. So, if i do something to refresh the datagridview repetely for a while, it will occure an error like this. Here is codes in DataGridViewRowPostPaint:
Private Sub gvemployee_RowPostPaint(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowPostPaintEventArgs) Handles gvemployee.RowPostPaint 'Try If Not e.IsLastVisibleRow Then If cancelselectedCell = 0 Th