V
Val
Hi all,
having trouble with an Access database, it has a table "Books", the program
uses a dataset to work with the database.
I set up the schema for the table "Books" as follows:
(C#)
////////////////////////////
m_dataset.Tables.Add("Books");
DataColumn PrimaryKeyColumn =
m_dataset.Tables["Books"].Columns.Add("ID",typeof(int));
m_dataset.Tables["Books"].PrimaryKey = new DataColumn[] {PrimaryKeyColumn};
m_dataset.Tables["Books"].Columns.Add("Name",typeof(string));
m_dataset.Tables["Books"].Columns.Add("ISBN",typeof(string));
m_dataset.Tables["Books"].Columns.Add("Price",typeof(float));
m_dataset.Tables["Books"].Columns.Add("iStock",typeof(int));
m_dataset.Tables["Books"].Columns.Add("mStock",typeof(int));
m_dataset.Tables["Books"].Columns.Add("Barcode",typeof(string));
m_dataset.Tables["Books"].Columns.Add("Description",typeof(string));
////////////////////////////
and then everytime i try to fill it with the dataadapter an exeption
"Missing SourceColumn mapping for 'ID' " is thrown.
Im totaly in the dark with this one, nothing I try makes any difference, any
help would be great!
Val
having trouble with an Access database, it has a table "Books", the program
uses a dataset to work with the database.
I set up the schema for the table "Books" as follows:
(C#)
////////////////////////////
m_dataset.Tables.Add("Books");
DataColumn PrimaryKeyColumn =
m_dataset.Tables["Books"].Columns.Add("ID",typeof(int));
m_dataset.Tables["Books"].PrimaryKey = new DataColumn[] {PrimaryKeyColumn};
m_dataset.Tables["Books"].Columns.Add("Name",typeof(string));
m_dataset.Tables["Books"].Columns.Add("ISBN",typeof(string));
m_dataset.Tables["Books"].Columns.Add("Price",typeof(float));
m_dataset.Tables["Books"].Columns.Add("iStock",typeof(int));
m_dataset.Tables["Books"].Columns.Add("mStock",typeof(int));
m_dataset.Tables["Books"].Columns.Add("Barcode",typeof(string));
m_dataset.Tables["Books"].Columns.Add("Description",typeof(string));
////////////////////////////
and then everytime i try to fill it with the dataadapter an exeption
"Missing SourceColumn mapping for 'ID' " is thrown.
Im totaly in the dark with this one, nothing I try makes any difference, any
help would be great!
Val