Answer the question
In order to leave comments, you need to log in
Why does System.Data.OleDb.OleDbException occur?
The essence of the problem: I do not want the "id" column to get from the database, so I try to replace * with "Criretia, Employee, Expert1, Expert2, Expert3" (although everything works fine with * and no error occurs).
But during the replacement, an error occurs from the title of the question.
System.Data.OleDb.OleDbException: "A value is missing for one or more required parameters."
Declaration "OleDbConnection conn = new OleDbConnection();" happens at the very beginning of "public partial class Form1 : Form"
Here is the code
conn.ConnectionString = @"provider = microsoft.ace.oledb.12.0; data source = |datadirectory|Database21.accdb";
conn.Open();
OleDbCommand com = new OleDbCommand();
com.Connection = conn;
com.CommandText = "SELECT Criretia, Employee, Expert1, Expert2, Expert3 FROM Table1";
OleDbDataAdapter DA = new OleDbDataAdapter(com);
DataTable DT = new DataTable();
DA.Fill(DT); #ошибка указывает на эту строку
dataGridView1.DataSource = DT;
conn.Close();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question