0

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();    
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
izek_zam
  • 1
  • 1
  • `LocalDB` is a developer-oriented version of SQL Server **Express** - which is really **NOT** an "embedded" database - it requires an installation on the target machine before it can run there..... – marc_s Oct 25 '17 at 07:52
  • Thanks @Marc_s, how do I install it without installing SQL Server on tablet – izek_zam Oct 25 '17 at 08:05
  • You **cannot** - if you want to use `LocalDB`, then you **must** install the `LocalDB` package (which is the dev-oriented SQL Server version) – marc_s Oct 25 '17 at 08:41
  • Thanks @marc_s, will try sqlce then – izek_zam Oct 25 '17 at 08:46

0 Answers0