Your query is incorrect. You are giving a Where condition but you are not providing any value for the ID column. You should correct your query, something like this would return all records
Code:
string queryString = "SELECT ID, Name, LastName, Nick, MobileNumber, MobileNumber2, e-Mail, e-Mail2, Type FROM Table1";
Use [code]your code here[/code] tags when you post source code
Search here before you post your question, someone might have already asked it before. My Articles
Your query is incorrect. You are giving a Where condition but you are not providing any value for the ID column. You should correct your query, something like this would return all records
Code:
string queryString = "SELECT ID, Name, LastName, Nick, MobileNumber, MobileNumber2, e-Mail, e-Mail2, Type FROM Table1";
Same message error (No value given for one or more required parameters)...
I have empty DataGridView... and when I start the aplication only the DataGridView to fullfill with the suitable base of...
I did not realize that you have a special character in the fieldnames. It is a bad practice to put special characters in the Column Names. You have a Hyphen in e-Mail & e-Mail2 fields. Either you rename them in your database or use a query like this
Code:
SELECT ID, Name, LastName, Nick, MobileNumber, MobileNumber2, [e-Mail], [e-Mail2], Type FROM Table1;
I have put square brackets for the email field names.
I would rather go and rename the fields.
Edit
One more thing. when you encounter these type of errors that are related to the SQL Query you wrote, the easiest way to debug them would be to copy the query and run it in the database directly that you are using. In this case, I would copy the query and open the access database, create a new query go to SQL view, paste the query and run it to see what the exact problem is.
Last edited by Shuja Ali; July 5th, 2009 at 01:06 PM.
Reason: Added a tip
Use [code]your code here[/code] tags when you post source code
Search here before you post your question, someone might have already asked it before. My Articles
You are welcome. But I seriously don't understand how you solved the problem with two tables. Can you post the exact solution so that others will also get benefited.
Use [code]your code here[/code] tags when you post source code
Search here before you post your question, someone might have already asked it before. My Articles
You are welcome. But I seriously don't understand how you solved the problem with two tables. Can you post the exact solution so that others will also get benefited.
In the first table are the information for the my contacts and in the second table are the group of the contacts (Friends, Coworkers, Relatives...).
So, my DataGridView is | Name | Last Name | Mobile | Mobile2 | e-Mail | e-Mail2 | Group |
Here is my code:
Code:
string queryString = "SELECT ID, Name, LastName, MobileNumber, MobileNumber2, eMeil, eMail2, Type FROM Table1,Table2 WHERE Table2.typeID = Table1.typeID";
loadDataGrid(queryString);
Bookmarks