Showing posts with label OleDbException was unhandled. Show all posts
Showing posts with label OleDbException was unhandled. Show all posts
Sunday, 7 April 2013
Saturday, 6 April 2013
Data type mismatch in criteria expression.
While I Am Trying To Retrieve Data From The Database by Giving Sql Query ..I Got The Bug "OleDbException was unhandled,Data type mismatch in criteria expression" As Shown In The Picture Below:
Actually in My Sql Query I am trying To Give An Integer As The Parameter..So While Giving Integer We Should Not Put The Parameter In Double Quotations..That Is We Have to Give as:
cmd.commandcmd.CommandText = "SELECT StarT,Paadam,VarnamT,VasyamT FROM Nakshatra_Kutami Where Paadam="+ padam; (This Is Correct Format When We Are Giving Parameters As Integer Values)
but I Had Given As :
cmd.CommandText = "SELECT StarT,Paadam,VarnamT,VasyamT FROM Nakshatra_Kutami Where Paadam='"+ padam+"'"; (This Is Correct Format, Incase We Are Giving Text/String As Parameter But Incase Of Giving Integer as Parameter It Is Incorrect)
Thursday, 11 October 2012
Saturday, 29 September 2012
The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
"The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again." OleDbException was unhandled.
Actually Here I Want To Save The DataGridview Data In The Database. In The Database One Column That Is First Column Has Primary Key, Which Does Not Allow Duplicate Values.
I Had Saved Some Data In To The DataBase Through THe DataGridView...And When I Reload(Re-Run) The Form Then The Data Is Reloaded At Form Load Time..Due To The OleDb Connection The Data Is Stored In The DataSet, So When We Load The Form The Previous Stored Data Will Also Display In The DataGridView. As Shown Below I Am Showing That THe DataGridView Data Previously Stored And Also The New Data That I Had Given Now. When I Click On Save Button..Due To The Already Stored Data In The Database Again It Is Trying To Save The Existing Data WIth The New Data.
Due To That Database Does Not Allow Duplicate Values In To The Database. It Shows An Error That Is: OleDbException was unhandled."The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again."
So To Overcome This Exception We Have to Clear The DataTable At Form Load. So We Can Enter New Data. And It Does Not Show THe Old Data or Already Existing Data. After Clearing THe DataTable It Looks As Below:
Now We Can Enter New Data In The Database And Click Save Button. Then The New Data Is Stored In THe Database Through The DataGridView. And Runs Successfully .
Wednesday, 26 September 2012
IErrorInfo.GetDescription failed with E_FAIL(0x80004005).
OleDbException was unhandled,IErrorInfo.GetDescription failed with E_FAIL(0x80004005). I Got This Exception When I Tried To Print The Crystal Report Directly Without showing the Crystal Report.
This Exception Is Because Of That Some Reserved Word As The Field Name In The Database.i.e. Names..When I Renamed The "Names" Field With Other Name Then It Runs Successfully..
After The Bug Fixing The Form Runs Successfully Without Any Exception as shown Below:
Saturday, 22 September 2012
No value given for one or more required parameters.
In Winforms, I Am Trying To Retrieve Data From The DataBase To The TextBoxes By Using Button Click "btnRetrieve_Click" Event. Then I Got An Exception,i.e., "OleDbException Was Unhandled, No value given for one or more required parameters". See The Below Code Snippet.
Rectified No value given for one or more required parameters. Exception:-
Later I Had Fix That Error By Using The Below Code Snippet..I Had Written The Below Selected Line In My Code Snippet. Then The Exception Rised Is Rectified(i.e. error is fixed.)
Subscribe to:
Posts (Atom)