<connectionStrings> <add name="Store.Properties.Settings.StoreConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Store.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient" /> <add name="StoreEntities" connectionString="metadata=res://*/StoreEntityModel.csdl|res://*/StoreEntityModel.ssdl|res://*/StoreEntityModel.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Store.mdf;integrated security=True;connect timeout=30;user instance=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" /> </connectionStrings>
StoreDataContext store_dc = new StoreDataContext(constr);
try { foreach (StuffRegTable stf in DtgridTbl) { if (stf.Checked == true) { var deletobject = (from rec in store_dc.Stuffs where rec.BareCode == stf.BarCode select rec).Single(); DtgridTbl.Remove(stf); store_dc.Stuffs.DeleteOnSubmit(deletobject); store_dc.SubmitChanges(); } } }//try catch(Exception ex) { MessageBox.Show(ex.Message.ToString()); }
DtgridTbl.Remove(stf);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)