public string GetRunningLotByItemID(int id) { string lotNo = string.Empty; string prefix = string.Empty; int runningNo = 0; DateTime lastUpdate; ItemMasterModel item = factory.ItemMasterDao.GetByID(id); if (item != null) { lastUpdate = ((item.LastUpdateLot == null) ? DateTime.Now : (DateTime)item.LastUpdateLot); if (DateTime.Now.Date != lastUpdate.Date) { runningNo = 1; } else { runningNo = item.LastLotRunning + 1; } prefix = DateTime.Now.ToString("yyMMdd"); lotNo = string.Format("{0}-{1}", prefix, runningNo.ToString().PadLeft(4, '0')); item.LastUpdateLot = DateTime.Now; item.LastLotRunning = runningNo; UpdateItem(item); } return(lotNo); }
public int InsertItem(ItemMasterModel model) { model.CreationDate = DateTime.Now; model.LastUpdateDate = DateTime.Now; return(factory.ItemMasterDao.Insert(model)); }
private void btnDelete_Click(object sender, EventArgs e) { ItemMasterModel objmodel = objItemMasterBl.GetItemNameByGroupname(tbxGroupName.Text.Trim()); if (objmodel.Name != null) { MessageBox.Show("Can Not Delete Group Name Under Tag With Item Name.." + objmodel.Name); tbxGroupName.Focus(); } if (objmodel.Name == null) { bool isDelete = objItemBL.DeleteItemGroupById(ItemgrpId); if (isDelete) { MessageBox.Show("Delete Successfully!"); ClearControls(); ItemgrpId = 0; Administration.List.ItemgroupList frmList = new Administration.List.ItemgroupList(); frmList.StartPosition = FormStartPosition.CenterScreen; frmList.ShowDialog(); FillItemGroupInfo(); tbxGroupName.Focus(); } } }
public ItemMasterModel GetItemsByName(string itemname) { ItemMasterModel objItem = new ItemMasterModel(); string Query = string.Empty; Query = "SELECT * FROM ITEM_MASTER WHERE ITEM_Name='" + itemname + "'"; System.Data.IDataReader dr = _dbHelper.ExecuteDataReader(Query, _dbHelper.GetConnObject()); while (dr.Read()) { objItem = new eSunSpeedDomain.ItemMasterModel(); objItem.Name = dr["ITEM_Name"].ToString(); objItem.Alias = dr["ITEM_ALIAS"].ToString(); objItem.Unit = dr["ITEM_UNIT"].ToString(); objItem.OpStockQty = Convert.ToDouble(dr["ITEM_OPSTOCKQTY"]); objItem.OpStockValue = Convert.ToDouble(dr["ITEM_OPSTOCKVALUE"]); objItem.SalePrice = Convert.ToDouble(dr["ITEM_SALEPRICE"]); objItem.MRP = Convert.ToDouble(dr["ITEM_MRP"]); objItem.MinSalePrice = Convert.ToDouble(dr["ITEM_MINSALEPRICE"]); objItem.SelfValuePrice = Convert.ToDouble(dr["ITEM_SELFVALUEPRICE"]); objItem.SaleDiscount = Convert.ToDouble(dr["ITEM_SALEDISCOUNT"]); } return(objItem); }
private void btnDelete_Click(object sender, EventArgs e) { ItemMasterModel objmodel = objItemMasterBl.GetItemNameByTaxCategoryname(tbxName.Text.Trim()); if (objmodel.Name != null) { MessageBox.Show("Can Not Delete Tax Name Under Tag With Item Name.." + objmodel.Name); tbxName.Focus(); } if (objmodel.Name == null) { bool isDelete = objtaxbl.DeleteTaxCategorById(Tax_Id); if (isDelete) { MessageBox.Show("Delete Successfully!"); ClearFormValues(); Tax_Id = 0; Administration.List.TaxcategoryList frmList = new Administration.List.TaxcategoryList(); frmList.StartPosition = FormStartPosition.CenterScreen; frmList.ShowDialog(); FillTaxCategoryInfo(); } } }
internal DataTable LoadWarehouse(ItemMasterModel objIMModel) { try { ClsCon.cmd = new SqlCommand(); ClsCon.cmd.CommandType = CommandType.StoredProcedure; ClsCon.cmd.CommandText = "SPMasters"; ClsCon.cmd.Parameters.AddWithValue("@DataInd", objIMModel.Ind); ClsCon.cmd.Parameters.AddWithValue("@OrgID", objIMModel.OrgID); con = ClsCon.SqlConn(); ClsCon.cmd.Connection = con; dtItemMaster = new DataTable(); ClsCon.da = new SqlDataAdapter(ClsCon.cmd); ClsCon.da.Fill(dtItemMaster); dtItemMaster.TableName = "success"; } catch (Exception) { dtItemMaster = new DataTable(); dtItemMaster.TableName = "error"; return(dtItemMaster); } finally { con.Close(); con.Dispose(); ClsCon.da.Dispose(); ClsCon.cmd.Dispose(); } return(dtItemMaster); }
private void btnSave_Click(object sender, EventArgs e) { if (tbxName.Text.Equals(string.Empty)) { MessageBox.Show("Item Group Name can not be blank!"); return; } //if (accObj.IsGroupExists(tbxGroupName.Text.Trim())) //{ // MessageBox.Show("Group Name already Exists!", "SunSpeed", MessageBoxButtons.RetryCancel); // cbxUnderGrp.Focus(); // return; //} ItemMasterModel objModel = new ItemMasterModel(); objModel.CreatedBy = "Admin"; bool isSuccess = objIMBL.SaveItemMaster(objModel); if (isSuccess) { MessageBox.Show("Saved Successfully!"); } }
private bool Save() { ItemMasterModel item = new ItemMasterModel(); if (btn_Save.Text == "Update") { item.Action = "updateitem"; item.ItemId = PItemId; } else { item.Action = "insert"; } item.ItemName = txt_ItemName.Text; item.HSNCode = txt_HSNCode.Text; item.ReorderingLabel = txt_ReorderingLabel.Text; DataSet ds = item.ItemOperation(); if (ds.Tables[0].Rows[0].ItemArray[0].ToString() == "Record Submitted Successfully") { MessageBox.Show("Record Submitted successfully", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Information); return(true); } else if (ds.Tables[0].Rows[0].ItemArray[0].ToString() == "Update Successfully") { MessageBox.Show("Record Updated Successfully", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Information); return(true); } else { MessageBox.Show("Failed to Execute Command!!! Please Try Again Later", "MINIFY", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } }
private DataTable GetAll() { DataTable dt = new DataTable(); dt.Columns.Add("ItemId", typeof(string)); dt.Columns.Add("ItemName", typeof(string)); dt.Columns.Add("HSNCode", typeof(string)); dt.Columns.Add("RateOfGST", typeof(string)); dt.Columns.Add("UnitOfMeasurment", typeof(string)); dt.Columns.Add("ReorderingLabel", typeof(string)); dt.Columns.Add("PurchasePrice", typeof(string)); dt.Columns.Add("SalesPrice", typeof(string)); dt.Columns.Add("CurrentStock", typeof(string)); ItemMasterModel itemMaster = new ItemMasterModel(); itemMaster.Action = "fetch"; DataSet ds = itemMaster.ItemOperation(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dt.Rows.Add( ds.Tables[0].Rows[i]["ItemId"].ToString(), ds.Tables[0].Rows[i]["ItemName"].ToString(), ds.Tables[0].Rows[i]["HSNCode"].ToString(), ds.Tables[0].Rows[i]["RateOfGST"].ToString(), ds.Tables[0].Rows[i]["UnitOfMeasurment"].ToString(), ds.Tables[0].Rows[i]["ReorderingLabel"].ToString(), ds.Tables[0].Rows[i]["PurchasePrice"].ToString(), ds.Tables[0].Rows[i]["SalesPrice"].ToString(), ds.Tables[0].Rows[i]["CurrentStock"].ToString() ); } return(dt); }
public DataSet ItemMasterDDL(ItemMasterModel objIMModel) { DataSet dsItemMaster = new DataSet(); objIMModel.Ind = 2; DataTable dtItemGroup = objIMDA.LoadItemGroup(objIMModel); dtItemGroup.TableName = "ItemGroup"; dsItemMaster.Tables.Add(dtItemGroup); objIMModel.Ind = 14; DataTable dtItemUnit = objIMDA.LoadItemUnit(objIMModel); dtItemUnit.TableName = "ItemUnit"; dsItemMaster.Tables.Add(dtItemUnit); objIMModel.Ind = 2; DataTable dtWarehouse = objIMDA.LoadWarehouse(objIMModel); dtWarehouse.TableName = "Warehouse"; dsItemMaster.Tables.Add(dtWarehouse); objIMModel.Ind = 40; DataTable dtTaxRate = objIMDA.LoadTaxRate(objIMModel); dtTaxRate.TableName = "TaxRate"; dsItemMaster.Tables.Add(dtTaxRate); return(dsItemMaster); }
public void Add(ItemMasterModel itemMasterModel) { ItemMaster newItemMaster = new ItemMaster(); newItemMaster.UpdateItemMaster(itemMasterModel); _itemMasterRepository.Add(newItemMaster); }
public void Delete(ItemMasterModel model) { string sql = @"DELETE FROM mtl_system_items WHERE inventory_item_id = @inventory_item_id"; object[] parms = { "@inventory_item_id", model.InventoryItemId }; db.Update(sql, parms); }
public StockDetailModel ConvertItemtoStok(ItemMasterModel itemMaster) { if (itemMaster != null) { StockDetailModel stockDetailModel = new StockDetailModel { StockDetailItemId = itemMaster.ItemMasterId, StockDetailItem = itemMaster, StockDetailQty = 1, StockDetailUnitPrice = 0, StockDetailPurchaserType = 1, StockDetailTransferType = 1 }; return(stockDetailModel); } return(null); }
internal DataTable SaveItem(ItemMasterModel objIMModel) { try { ClsCon.cmd = new SqlCommand(); ClsCon.cmd.CommandType = CommandType.StoredProcedure; ClsCon.cmd.CommandText = "SPItems"; ClsCon.cmd.Parameters.AddWithValue("@Ind", objIMModel.Ind); ClsCon.cmd.Parameters.AddWithValue("@OrgID", objIMModel.OrgID); ClsCon.cmd.Parameters.AddWithValue("@YrCD", objIMModel.YrCD); ClsCon.cmd.Parameters.AddWithValue("@ItemMainID", objIMModel.ItemMainID); ClsCon.cmd.Parameters.AddWithValue("@ItemSubID", objIMModel.ItemSubID); ClsCon.cmd.Parameters.AddWithValue("@ItemMinorID", objIMModel.ItemMinorID); ClsCon.cmd.Parameters.AddWithValue("@ItemGroupID", objIMModel.ItemGroupID); ClsCon.cmd.Parameters.AddWithValue("@ItemName", objIMModel.ItemName); ClsCon.cmd.Parameters.AddWithValue("@ItemShortName", objIMModel.ItemShortName); ClsCon.cmd.Parameters.AddWithValue("@ItemUnitID", objIMModel.ItemUnitID); ClsCon.cmd.Parameters.AddWithValue("@GoodServiceInd", objIMModel.GoodServiceInd); ClsCon.cmd.Parameters.AddWithValue("@ItemSellingRate", objIMModel.ItemSellingRate); ClsCon.cmd.Parameters.AddWithValue("@ItemDescription", objIMModel.ItemDesc); ClsCon.cmd.Parameters.AddWithValue("@HSNSACCode", objIMModel.HSNSACCode); ClsCon.cmd.Parameters.AddWithValue("@ItemCode", objIMModel.ItemCode); ClsCon.cmd.Parameters.AddWithValue("@User", objIMModel.User); ClsCon.cmd.Parameters.AddWithValue("@IP", objIMModel.IP); ClsCon.cmd.Parameters.AddWithValue("@TaxRate", objIMModel.TaxRate); ClsCon.cmd.Parameters.AddWithValue("@TaxRateDesc", objIMModel.TaxRateDesc); ClsCon.cmd.Parameters.AddWithValue("@ItemMinorUnitID", objIMModel.ItemMinorUnitID); ClsCon.cmd.Parameters.AddWithValue("@ItemMinorUnitQyt", objIMModel.ItemMinorUnitQyt); ClsCon.cmd.Parameters.AddWithValue("@StockMaintainInd", objIMModel.StockMaintainInd); ClsCon.cmd.Parameters.AddWithValue("@TblItemOpening", objIMModel.DtItemOpening); con = ClsCon.SqlConn(); ClsCon.cmd.Connection = con; dtItemMaster = new DataTable(); ClsCon.da = new SqlDataAdapter(ClsCon.cmd); ClsCon.da.Fill(dtItemMaster); dtItemMaster.TableName = "success"; } catch (Exception) { dtItemMaster = new DataTable(); dtItemMaster.TableName = "error"; return(dtItemMaster); } finally { con.Close(); con.Dispose(); ClsCon.da.Dispose(); ClsCon.cmd.Dispose(); } return(dtItemMaster); }
private void txt_itemName_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { ItemMasterModel itemMasterModel = new ItemMasterModel(); itemMasterModel.ItemName = txt_itemName.Text; itemMasterModel.Action = "fetchbyitemname"; DataSet ds = itemMasterModel.ItemOperation(); txt_hsnCode.Text = ds.Tables[0].Rows[0]["HSNCode"].ToString(); txt_price.Text = ds.Tables[0].Rows[0]["SalesPrice"].ToString(); } }
public bool SaveItem(ItemMasterModel itemModel) { if (itemModel.ItemMasterId > 0) { itemRepositry.UpdateItem(itemModel); } else { itemRepositry.AddItem(itemModel); } return(true); }
internal void AddItem(ItemMasterModel itemModel) { itemModel.IsActive = true; itemModel.QtyOnHand = 0; svssstores_itemmaster itemMasterEntity = ConvertModeltoEntity(itemModel); bool retunResult = DBHelper.SaveItemMaster(itemMasterEntity); if (retunResult) { //this.GetItemList(); } //itemMasterList.Add(itemModel); }
public IHttpActionResult GetItemModel(int Id) { try { using (MaxMasterDbEntities db = new MaxMasterDbEntities()) { var model = db.ItemsMasters.Where(x => x.Id == Id).FirstOrDefault(); ItemMasterModel itemModel = new ItemMasterModel(); itemModel.ItemName = model.ItemName; itemModel.ModelNum = model.ModelNumber; itemModel.Manufacturer = model.Manufacturer; itemModel.CountryId = model.MadeIn; itemModel.EAN = model.EAN; itemModel.UPC = model.UPC; itemModel.PowerInput = model.PowerInput; itemModel.PowerInputUnits = model.PowerInputUnits; itemModel.Units = model.Units; itemModel.Description = model.Description; itemModel.Contents = model.ItemContents; itemModel.Country = model.Country.Name; itemModel.HSNCode = model.HSNCode; itemModel.Brand = model.Brand; itemModel.ThresholdValue = model.ThresholdQuantity; itemModel.SerialNoExists = model.SrlNoExists; itemModel.GSTRate = model.GST + model.CGST; var gst = db.GSTs.Where(x => x.Rate == itemModel.GSTRate).FirstOrDefault(); var cpOfItem = db.ItemPrices.Where(x => x.ItemModelId == Id && x.ToDate == null).FirstOrDefault(); if (cpOfItem != null) { itemModel.CostPrice = cpOfItem.DealerPrice; } if (gst != null) { itemModel.GSTID = gst.Id; itemModel.GST = gst.GSTName + "[" + itemModel.GSTRate + "%]"; itemModel.GSTRate = gst.Rate; } return(Content(HttpStatusCode.OK, new { itemModel })); } } catch (Exception ex) { new Error().logAPIError(System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString(), ex.StackTrace); return(Content(HttpStatusCode.InternalServerError, "An error occured, please try again later")); } }
private svssstores_itemmaster ConvertModeltoEntity(ItemMasterModel itemModel) { svssstores_itemmaster itemMasterEntity = new svssstores_itemmaster(); itemMasterEntity.ItemMaster_ID = itemModel.ItemMasterId; itemMasterEntity.ItemMaster_ItemName = itemModel.ItemMasterName; itemMasterEntity.ItemMaster_UOM = itemModel.UOM; itemMasterEntity.ItemMaster_IsActive = itemModel.IsActive; itemMasterEntity.ItemMaster_UnitPrice = itemModel.UnitPrice; itemMasterEntity.ItemMaster_QtyOnHand = itemModel.QtyOnHand; itemMasterEntity.ItemMaster_ItemCode = itemModel.ItemCode; itemMasterEntity.ItemMaster_GroupId = itemModel.itemGroupId; return(itemMasterEntity); }
public static void UpdateItemMaster(this ItemMaster itemMaster, ItemMasterModel itemMasterVm) { itemMaster.Id = itemMasterVm.Id; itemMaster.IMPack = itemMasterVm.IMPack; itemMaster.IMDescription = itemMasterVm.IMDescription; itemMaster.IMImageData = itemMasterVm.IMImageData; itemMaster.IMIsHazardousMaterial = itemMasterVm.IMIsHazardousMaterial; itemMaster.IMExpirationDate = itemMasterVm.IMExpirationDate; itemMaster.IMUnitPrice = itemMasterVm.IMUnitPrice; itemMaster.IMWidth = itemMasterVm.IMWidth; itemMaster.IMLength = itemMasterVm.IMLength; itemMaster.IMHeight = itemMasterVm.IMHeight; itemMaster.IMIsPrePack = itemMasterVm.IMIsPrePack; itemMaster.IMPrePackStyle = itemMasterVm.IMPrePackStyle; itemMaster.IMCostCenterCode = itemMasterVm.IMCostCenterCode; }
public ItemMasterViewModel() { itemMaster = new ItemMasterModel(); itemMasterManger = new ItemMasterManager(); itemGroup = new ItemGroupModel(); itemMasterList = new ObservableCollection <ItemMasterModel>(); saveItemCmd = new RelayCommand(Save, CanSave); clearItemCmd = new RelayCommand(ClearItemDetails, CanClearItemDetails); openGroupCmd = new RelayCommand(OpenPOPupView, CanOpenPOPupView); addItemGroupCmd = new RelayCommand(SaveGroup, CanSaveGroup); clearItemGroupCmd = new RelayCommand(SaveGroup, CanSaveGroup); itemMasterList = itemMasterManger.GetItemList(); itemGroupList = itemMasterManger.GetIemGroupList(); this.UnitPrice = 0; }
public IHttpActionResult GetDetail(int id) { using (var ctx = new RestMgmtEntities()) { ItemMasterModel itemMasterModel = ctx.ItemMasters.Where(t => t.Id == id).Select(t => new ItemMasterModel { Id = t.Id, ItemName = t.ItemName, GroupId = t.GroupId, Price = t.Price }).FirstOrDefault(); return(Ok(itemMasterModel)); } }
public IHttpActionResult Insert(ItemMasterModel model) { using (var ctx = new RestMgmtEntities()) { ctx.ItemMasters.Add(new ItemMaster() { ItemName = model.ItemName, GroupId = model.GroupId, Price = model.Price, CreatedUserId = model.CreatedUserId, CreatedDate = DateTime.Now }); ctx.SaveChanges(); } return(Ok()); }
public void Save(object obj) { var itemMaster = new ItemMasterModel { ItemMasterId = this.ItemId, ItemMasterName = this.ItemName, UOM = this.UOM, ItemCode = this.ItemCode, UnitPrice = this.UnitPrice, itemGroupId = this.SelectedItemGroupValue }; if (itemMasterManger.SaveItem(itemMaster)) { this.ItemMasterList = (ObservableCollection <ItemMasterModel>)itemMasterManger.GetItemList(); ClearValue(); MessageBox.Show("Item Details Saved Successfully"); } else { MessageBox.Show("Unable to Save Item Details"); } }
public IHttpActionResult Update(int id, ItemMasterModel model) { using (var ctx = new RestMgmtEntities()) { ItemMaster itemMaster = ctx.ItemMasters.Where(t => t.Id == id).FirstOrDefault(); if (itemMaster != null) { itemMaster.ItemName = model.ItemName; itemMaster.GroupId = model.GroupId; itemMaster.Price = model.Price; itemMaster.UpdatedDate = DateTime.Now; itemMaster.UpdateUserId = model.UpdateUserId; ctx.SaveChanges(); } } return(Ok()); }
private ItemMasterModel ConvertEntitytoModel(svssstores_itemmaster itemMasterEntity) { ItemMasterModel itemModel = new ItemMasterModel(); itemModel.ItemMasterId = itemMasterEntity.ItemMaster_ID; itemModel.ItemMasterName = itemMasterEntity.ItemMaster_ItemName; itemModel.UOM = itemMasterEntity.ItemMaster_UOM; itemModel.IsActive = itemMasterEntity.ItemMaster_IsActive.HasValue ? itemMasterEntity.ItemMaster_IsActive.Value : true; itemModel.ItemCode = itemMasterEntity.ItemMaster_ItemCode; itemModel.UnitPrice = itemMasterEntity.ItemMaster_UnitPrice.HasValue ? itemMasterEntity.ItemMaster_UnitPrice.Value : 0; itemModel.QtyOnHand = itemMasterEntity.ItemMaster_QtyOnHand.HasValue ? itemMasterEntity.ItemMaster_QtyOnHand.Value : 0; itemModel.itemGroupId = itemMasterEntity.ItemMaster_GroupId.HasValue ? itemMasterEntity.ItemMaster_GroupId.Value : 0; if (itemMasterEntity.svssstores_itemgroup != null) { itemModel.itemGroupModel = ConvertGroupEntitytoGroupGroup(itemMasterEntity.svssstores_itemgroup); } return(itemModel); }
public void Auto() { AccountHeadModel accountHeadModel = new AccountHeadModel(); accountHeadModel.Action = "Search"; accountHeadModel.AccountHeadName = txt_accountHeadName.Text; DataSet dt = accountHeadModel.AccountHeadOperation(); if (dt.Tables[0].Rows.Count > 0) { for (int i = 0; i < dt.Tables[0].Rows.Count; i++) { col.Add(dt.Tables[0].Rows[i]["AccountHeadName"].ToString()); } } //else //{ // MessageBox.Show("Name not Found."); //} txt_accountHeadName.AutoCompleteMode = AutoCompleteMode.Suggest; txt_accountHeadName.AutoCompleteSource = AutoCompleteSource.CustomSource; txt_accountHeadName.AutoCompleteCustomSource = col; //fetch item name ItemMasterModel item = new ItemMasterModel(); item.Action = "Search"; item.ItemName = txt_itemName.Text; DataSet dt1 = item.ItemOperation(); if (dt1.Tables[0].Rows.Count > 0) { for (int i = 0; i < dt1.Tables[0].Rows.Count; i++) { col1.Add(dt1.Tables[0].Rows[i]["ItemName"].ToString()); } } else { MessageBox.Show("Name not Found."); } txt_itemName.AutoCompleteMode = AutoCompleteMode.Suggest; txt_itemName.AutoCompleteSource = AutoCompleteSource.CustomSource; txt_itemName.AutoCompleteCustomSource = col1; }
public ItemEntry(int ItemId) { InitializeComponent(); PItemId = ItemId; ItemMasterModel table = new ItemMasterModel(); table.Action = "fetchbyid"; table.ItemId = PItemId; DataSet ds = table.ItemOperation(); if (ds.Tables[0].Rows.Count > 0) { txt_ItemName.Text = ds.Tables[0].Rows[0]["ItemName"].ToString(); txt_HSNCode.Text = ds.Tables[0].Rows[0]["HSNCode"].ToString(); txt_ReorderingLabel.Text = ds.Tables[0].Rows[0]["ReorderingLabel"].ToString(); btn_AddSaveNew.Enabled = false; btn_Save.Text = "Update"; } }
private void SelectingRow(object sender, EventArgs e) { MetroGrid grd = sender as MetroGrid; List <ItemMasterModel> lines = new List <ItemMasterModel>(); ItemMasterModel line = new ItemMasterModel(); if (grd.SelectedRows.Count > 0) { foreach (DataGridViewRow row in grd.SelectedRows) { line = (ItemMasterModel)row.DataBoundItem; lines.Add(line); } } _view.itemsSelected = lines; }
public void Auto() { ItemMasterModel item = new ItemMasterModel(); item.Action = "Search"; item.ItemName = textBox_itemName.Text; DataSet dt1 = item.ItemOperation(); if (dt1.Tables[0].Rows.Count > 0) { for (int i = 0; i < dt1.Tables[0].Rows.Count; i++) { col1.Add(dt1.Tables[0].Rows[i]["ItemName"].ToString()); } } textBox_itemName.AutoCompleteMode = AutoCompleteMode.Suggest; textBox_itemName.AutoCompleteSource = AutoCompleteSource.CustomSource; textBox_itemName.AutoCompleteCustomSource = col1; }