Groups > Asp .Net > Data Access and ObjectDataSource Control > LINQ Specified cast is not valid.




LINQ Specified cast is not valid.

LINQ Specified cast is not valid.
Wed, 2 Apr 2008 15:27:04 +0000
I have written following code to get a single transaction if exist else null. 

 Transaction tran = db.Transactions.SingleOrDefault(tn => tn.TransactionID ==
txtTransactionID.Text);

When i run it  it throws error {"Specified cast is not valid."}. 

txtTransactionID is textbox and In my database Trancsaction is a table with
TransactionID primary key which is nchar(10). 

 I have no clue what went wrong. 

I would appreciate any help
Post Reply
about | contact