SQL Server LocalDB column error when deployed to Tablet PC

47 Views Asked by At

I am getting a

System.AgumentException: Column 'BarcodeStr' does not belong to table

when I deploy the C# application from the development PC running Windows 10 to a tablet PC running Windows 10.

My application is a C# Windows Forms application with an embedded LocalDb v11.0. On the development PC, it is connecting without a problem but when I deploy it, I get that error.

My connection string is:

Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\LocalDB\StockTakeDB.mdf;Integrated Security=True 

The issue seems to be coming from this line:

int intScanned = dtStockTake.AsEnumerable().Where(r => r ["BarcodeStr"].ToString().Trim().Length > 0 && !r["BarcodeStr"].ToString().ToUpper().Contains("BUNDLE-0-LABEL")).Select(x => x["BarcodeStr"].ToString()).ToList().Distinct().ToList().Count();    
0

There are 0 best solutions below