srazi 0 Newbie Poster

Hello Friends,
I'am an application s/w programmer, was working on Classic VB&ASP(with limited knowledge of .net and c#),now working on SSRS Reports, tasked with designing a two-form application to be deployed on Intermec CN70 device (OS-Microsoft Windows Embedded Handheld 6.5) more specifications here
The required application on successful login(username/password), provide the user with an option to either select the StockOnHand or StockCounting forms.

StockOnHand form need to have a textbox1 which reads itemcode from barcode scanner(built in device),and displays the itemname in textbox2, UnitofMeasure in textbox3 and the corresponding item stocks in multiple warehouses should be displayed in a grid with columns like |Warehouse|AvlbPhyslQty|PO/ResvdQty|OrderedQty|TotalQty(calc field of AvlbPhyslQty-PO/ResvdQty+OrderedQty)|
Possibly the above information pop up as soon as an item is scanned using barcode or else a FIND button could be provided after sanning the itemcode using barcode.

StockCounting form must have similar functionality of item scanning to textbox1, displaying the itemname in textbox2 (or push of button), then the user inputs the ActualQty(after counting), selects the appropriate warehouse(Dropdown list of Warehouses), save button should clear all fields to scan the next item, exit button to close the form,besides ActualQty and warehouse for corresponding item, upon saving the form should save Counting UserName(logged in user state maintained) and Counting BatchID(an identity column only incrementing when user re-visit the StockCounting form i.e., any no' of counts per visit to form will have the same BatchID)
My Database Schema is as follows

ONHAND ITEMMASTER STOCKCOUNT WAREHOUSEMASTER
ItemCode(Foreign Key) ItemCode (Primary Key) Itemcode(Foreign Key) Warehousecode (PKey)
ItemDescription ItemDescription Batch Warehousename
Value UnitofMeasure Warehousecode(Foreign key)
warehousecode(Foreign Key) UOM
avlbphysclqty USERMASTER Qty
respoqty UserID(Primary key) cuser
orderedqty UserName
uom Password
whname

Having spent 8 days(and sleep deprived nights :)) tirelessly(googled and tried so many sample codes), I could succeed only upto Login Form

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlServerCe;

namespace StocksPiping
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void btnreset_Click(object sender, EventArgs e)
        {
            txtuname.Text = "";
            txtpassword.Text = "";

        }

        private void btnsubmit_Click(object sender, EventArgs e)
        {
            PipingStocksDataSet1 ds = new PipingStocksDataSet1();
            PipingStocksDataSet1.USERMASTERDataTable dt = new
            PipingStocksDataSet1.USERMASTERDataTable();
            this.usermasterTableAdapter1.Fill(dt);

            foreach (DataRow dr in dt.Rows)
            {
                                    if (dr[1].ToString() == txtuname.Text && dr[2].ToString() == txtpassword.Text)
                    {
                        txtpassword.Text = "";
                        txtpassword.Text = dr[0].ToString();
                        txtuname.Text = "";
                        txtpassword.Text = "";
                        // MessageBox.Show("Login Valid!");
                        this.Hide();
                        UserOptions uo = new UserOptions();
                        uo.Show();
                    }
                 }    
            }
        }
    }

My StockOnHand Form give me Invalid .sdf path error,having tried all options with connectionstring, but to no avail, the code is

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlServerCe;

namespace StocksPiping
{
    public partial class StocksOnHand : Form
    {
        public StocksOnHand()
        {
            InitializeComponent();
        }

        private void StocksOnHand_Load(object sender, EventArgs e)
        {
            //if (PipingStocksDataSetUtil.DesignerUtil.IsRunTime())
            //{
            //    // TODO: Delete this line of code to remove the default AutoFill for 'pipingStocksDataSet.ONHAND'.
            //    //this.oNHANDTableAdapter.Fill(this.pipingStocksDataSet.ONHAND);
            //}

        }

        private void btnFind_Click(object sender, EventArgs e)
        {
           // SqlCeConnection conn = new SqlCeConnection(@"Data Source=|DataDirectory|\PipingStocks.sdf");
           SqlCeConnection conn = new SqlCeConnection();

           conn.ConnectionString =
   "Persist Security Info = False; Data Source = 'C:\\Users\\iraza\\Documents\\Visual Studio 2008\\Projects\\StocksPiping\\StocksPiping\\database\\PipingStocks.sdf';" +
   "Password = ''; File Mode = 'shared read'; " +
   "Max Database Size = 256; Max Buffer Size = 1024";
                  conn.Open();
                  SqlCeCommand cmd = new SqlCeCommand("SELECT ITEMNAME, WHNAME,ONHANDQTY,RESPOQTY,ORDEREDQTY,UOM FROM ONHAND WHERE [ITEMCODE] = '" + txtItemID.Text + "'", conn);
                   SqlCeDataAdapter da = new SqlCeDataAdapter(cmd);
                    DataTable dt = new DataTable();
                    da.Fill(dt);
                    foreach (DataRow dr in dt.Rows)
                    {
                        txtItemID.Text = dr[0].ToString();
                        txtUOM.Text = dr[5].ToString();
                  }
        }

    }
} 

Still long way to go, since I don't have any idea as to how to populate the Grid with my desired result, maintain the user state, increment the counting batch, populate the Dropdown with Warehouses, I'm using Visual Studio 2008, my compact db is version 3.5. I also have VS2012 Installed (will try it if advised with substantial feedback on basic tasks for my requirements).
The application development and deployment is my first challange and then the unsurmountable task of sychronizing this compact DB with SQL Server ERP DB (to pull updated OnHandStocks and push the counted inventory to a table ) lies ahead.Due to restrictions, I couldn't attach neither my complete project directory nor .sdf, though the above summary narrates all.

Any help rendered is highly appreciated

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.