locked
DB table column mismatch? RRS feed

  • Question

  • Hi, I'm following the Expense app tutorial.

    In the part "Testing the LinePartItem" in document "Step 1b - Building the Line Item Part and View.doc", my application turns up blank with just an empty default Acropolis form.

     

    I tracked the error down to this function:

     

    ExpenseDataService.cs:

    private void BuildDefaultDS()

    {

    myMsds = new MSExpenseDataSet();

    categoriesTableAdapter.Fill(myMsds.Categories);

    accountNumbersTableAdapter.Fill(myMsds.AccountNumbers);

    statusCodesTableAdapter.Fill(myMsds.StatusCodes);

    creditCardTransactionsTableAdapter.Fill(myMsds.CreditCardTransactions);

    creditCardTransactionStatusCodesTableAdapter.Fill(myMsds.CreditCardTransactionStatusCodes);

    }

     

    This exception is thrown (although never visible anywhere, no msgbox or anything):

    "The column name is not valid. [ Node name (if any) = ,Column name = LastEditDate ]"

     

    The cause for the error is that the column 'LastEditDate' in the 'Categories'-table is named 'LastEditDateTime' in MSExpense.sdf. So there is a mismatch between the SQL Express table and the SQL CE table.

     

    I'm using the lastest availble Acropolis sample and VS2008B2 in VPC2007.

     

    // Kenneth

    Monday, September 10, 2007 1:55 PM

Answers

  • Hello

    Open MSExpenseDataSet.xsd

    Remove the tables

    Add them from the Server Explorer Window (Add a new dataconnection to the MSExpense.sdf database)

    Save the xsd

    Rebuild

     

    this should fix the problem. Someone changed the database cols and appended Time to LastEditDate and CreationDate. The dataset still uses the old definitions.

     

    V

    Tuesday, October 16, 2007 2:19 PM

All replies

  • Hello

    Open MSExpenseDataSet.xsd

    Remove the tables

    Add them from the Server Explorer Window (Add a new dataconnection to the MSExpense.sdf database)

    Save the xsd

    Rebuild

     

    this should fix the problem. Someone changed the database cols and appended Time to LastEditDate and CreationDate. The dataset still uses the old definitions.

     

    V

    Tuesday, October 16, 2007 2:19 PM
  • I was having the same problem and have been using the same trick to solve it. However now that my table adapters have quite a few functions in them, I am wondering: is there a better way to 'refresh' a datatable in the dataset against the actual database structure?
    Monday, March 17, 2008 10:29 AM