As the message suggests you have a mismatched number of fields. Either you are missing one of the first 3 in the top part below or you have one that should not be there in the second part below.
The Participant_ID in Insert Into ( ) corresponds to textBox1 in Values ( ).
And I'm extracting the user input for Participant_ID as ' " +textBox1+ " ' . Isn't it correct?
There are 32 fields in the Insert into ( ) option and corresponding to each 32 fields there are 32 fields in the Values ( ) option also.I'm still not understanding why I'm unable to store the data.
Please correct em if I'm wrong.
I have attached image of my error as an attachment.Please check if possible.
Last edited by Jack_Tauson_Sr; September 18th, 2011 at 10:19 PM.
My eye sight is not as good as it used to be and your SQL string is almost impossible to read as written. I did not see the coma between accepted,notaccepted.
Here is your issue
,'"+noofdependents+"''"+referredby+"','"+
You really should break that up into more lines and use some spaces to make it readable.
Furthermore, it seems like poor database design to have all the information stored in one table (unfortunately, it's not that uncommon). You should look into splitting things up a bit.
Does your database contain a table named Interviewdatabase?
If you are using SQL Server do you have the initial database set to the one you should be using?
Most likely it ios one of those, or the spelling of the table name does not match that in the db.
If the database name is InterviewDatabase then you have a problem or perhaps you are just confused on the proper terms to use.
Database = Collection of Tables containing rows of fields as well as other objects, views, procedures and so on.
Table= where the rows of data are located.
You specify the Database in your connection string.
You specify the Table in your SQL Statements.
So unless you have a table in your database and that table name is interviewdatabase then you have an error there as is mentioned in the error message when it tells you that table does not exist.
btw InterviewDatabase is a fine name for a database. It would be a horrible name for a table.
Actually, the table name is InterviewInfo, I corrected it. Thanks for the suggestion. But now I'm getting another execption which says
"oledb exception was unhandled overflow"
Could you please tell me what could be the reason? And even my forms are not closing, I have to close them every time using Task Manager !
I have changed all the fields in my MS Access database file to text but still I'm getting an exception which display's the following message:
"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."
Please help what could be the reason?I'm searching t on google as well but please let me know if you feel something went wrong, Thanks for your itme.
Last edited by Jack_Tauson_Sr; September 20th, 2011 at 10:00 PM.
The first error you mention, Overflow is caused when you try to put a number into a space that is not large enough to hold that number.
The second error indicates that you have one or more fields set in your database to require unique data and you are trying to insert something that is already there. The message pretty much tells you what the problem is and what you need to do about it.
As for your forms not closing hard to say without seeing the code but most likely you are not disposing of something you have created and it is holding the form(s) open.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.