TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kamil Kandula
NA
4
608
C# Bardode Scanner. Problem with Display Data.
Aug 17 2018 2:39 PM
Hello !
I am writing Inventory Manager with barcode scanner. I create one database with registration panel. Its work good. I can add, update, and delete product and display this on DataGriedView. Problem is with second panel. Program shoud work like this :
1) Take barcode.
2)
a) If barcode exist in firstdata base, add product to inventory (table,database,list) ,increment amount value, and display on inventorygriedview.
b) if barcode dnt exist in product data base active register panel, add product to database,
add product to inventory table and increment amount.
c) if product was added before in inventory table increment only amount value.
I want to do this with simple array 2D and for loop and next display this on datagriedview but i can't do this. I need help guys. This problem is stoping me. I am trying all way. I am using Entity Framework. In var
private void btnStart_Click(object sender, EventArgs e)
{
using (Entities db = new Entities())
{
object[] table = new object[7];
var result = db.ProductDBs.Where(x => x.Barcode == txtScanner.Text);
var mark = db.ProductDBs.Where(x => x.Barcode == txtScanner.Text).Select(x => x.Mark).FirstOrDefault();
var model = db.ProductDBs.Where(x => x.Barcode == txtScanner.Text).Select(x => x.Model).FirstOrDefault();
var serial = db.ProductDBs.Where(x => x.Barcode == txtScanner.Text).Select(x => x.Serial).FirstOrDefault();
var size = db.ProductDBs.Where(x => x.Barcode == txtScanner.Text).Select(x => x.Size).FirstOrDefault();
var barcode = db.ProductDBs.Where(x => x.Barcode == txtScanner.Text).Select(x => x.Barcode).FirstOrDefault();
var amount = db.ProductDBs.Where(x => x.Barcode == txtScanner.Text).Select(x => x.Amount).FirstOrDefault();
// here i am taking value from first data basei need to display this on datagriedvie and increment value. if product exist in table program shoud only increment amount. Product shoud be display only in one row. I dnt know how to do it.
table[0] = mark;
table[1] = model;
table[3] = serial;
table[4] = size;
table[5] = barcode;
table[6] = amount;
dgvMain.Rows.Add(table);
}
txtScanner.Clear();
txtScanner.Clear();
Reply
Answers (
1
)
Serialization types real world examples
How do i use big data in asp.Net from Beginning