none
I get an error when I deploy a Visual Studio 2008 into Window Embedded Compact 7 RRS feed

  • Question

  • I get an error when I deploy an Visual Studio 2008 into Window Embedded Compact 7. This is for a MC32No scanner and I'm not sure why I get this exception.  I don't get this error Window version 6.0

    I'm somewhat loss.

    ArgumentOutOfRangeException Specified argument was out of the range of valid values.
    at System,Date.Time.DateToTicks(int 32 year, int32 month, int32 day)
    
    at system.Date.Time..ctor(int 32 year, int32 month, int32 day, int32  hour, int32 minute, int32 second,
    int32 millisecond) at bk.a()
    

    Bellow is the code of my app:

    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.SqlClient;
    using System.Data.SqlTypes;
    using Symbol;
    using Symbol.Barcode2;
    
    
    namespace ReceivingScanTool
    {
        public partial class ReceivingScanner : Form
        {
            string conStr;
            string productMsg;
            string errorMsg;
            string currentTB;
            Barcode2 MyBarcode;
            public ReceivingScanner()
            {
                InitializeComponent();
                conStr = "Data Source=ERPSQL,1433;Initial Catalog=E1_INTEGRATE;Persist Security Info=True;User ID=distscanner;Password=distscanner";
                timer1.Interval = 100;
                timer1.Enabled = false;
              
            }
    
    
    
            private void button1_Click(object sender, EventArgs e)
            {
                try
                {
                    SqlConnection conn = null;
                    conn = new SqlConnection(conStr);
                    conn.Open();
                    SqlCommand cmd = new SqlCommand("usp_VerifyReceivingScan", conn);
                    cmd.CommandType = CommandType.StoredProcedure;
    
                    cmd.Parameters.Add(new SqlParameter("@ItemNbr", SqlDbType.VarChar, 25));
                    cmd.Parameters.Add(new SqlParameter("@LotNbr", SqlDbType.VarChar, 30));
                    cmd.Parameters.Add(new SqlParameter("@PublicationNbr", SqlDbType.VarChar, 30));
                    cmd.Parameters.Add(new SqlParameter("@Quantity", SqlDbType.Int));
    
                    cmd.Parameters.Add(new SqlParameter("@ReturnDesc", SqlDbType.VarChar, 50));
                    cmd.Parameters.Add(new SqlParameter("@ErrMessage", SqlDbType.VarChar, 100));
    
                    cmd.Parameters["@ItemNbr"].Value = tbItem.Text.Trim();//<item nbr value>;
                    cmd.Parameters["@LotNbr"].Value = tbLot.Text.Trim(); //<lot nbr value>;
                    cmd.Parameters["@PublicationNbr"].Value = tbPart.Text.Trim();//<pub nbr value>;
                    cmd.Parameters["@Quantity"].Value = Convert.ToInt32(tbQuant.Text.Trim());
    
                    cmd.Parameters["@ReturnDesc"].Direction = ParameterDirection.Output;
                    cmd.Parameters["@ErrMessage"].Direction = ParameterDirection.Output;
                    cmd.ExecuteNonQuery();
                    errorMsg = (string)cmd.Parameters[5].Value;
                    try
                    {
                        productMsg = (string)cmd.Parameters[4].Value;
                    }
                    catch
                    {
                        productMsg = "No Product Found\r\n" + errorMsg;
                    }
                    
                }
                catch 
                {
                    productMsg = "Please recheck your entries\r\n"+errorMsg;
                }
    
                tbProduct.Text = productMsg;
    
                
    
            }
    
            private void ReceivingScanner_Load(object sender, EventArgs e)
            {
    
                MyBarcode = new Barcode2();
                MyBarcode.Config.TriggerMode = TRIGGERMODES.HARD;
                MyBarcode.Scan();
                MyBarcode.OnScan += new Barcode2.OnScanHandler(MyBarcode_OnScan);
      ////          Barcode2 MyBarcode = new Barcode2("SCN1");
    
            //    Symbol.ResourceCoordination.Trigger T = new Symbol.ResourceCoordination.Trigger();
            //    T.Stage2Notify += new Symbol.ResourceCoordination.Trigger.TriggerEventHandler(T_Stage1Notify);
                tbItem.Focus();
    
               
            }
    
    
    
            void MyBarcode_OnScan(ScanDataCollection scancollection)
            {
                if (tbItem.Focused)
                {
    
                    tbItem.Text = scancollection.GetFirst.ToString();
                }
                if (tbPart.Focused)
                {
                    tbPart.Text = scancollection.GetFirst.ToString();
                }
                if (tbLot.Focused)
                {
                    tbLot.Text = scancollection.GetFirst.ToString();
                }
          //      MyBarcode.Dispose();
                MyBarcode = new Barcode2();
             //   MyBarcode.Config.TriggerMode = TRIGGERMODES.HARD;
                MyBarcode.Scan();
                MyBarcode.OnScan += new Barcode2.OnScanHandler(MyBarcode_OnScan);
            }
    
            private void tbItem_TextChanged(object sender, EventArgs e)
            {
                if (tbItem.Text.Length > 1&&cbAuto.Checked) 
                { 
                currentTB = "1";
                timer1.Enabled = true;
                }
    
    
            }
    
            private void tbLot_TextChanged(object sender, EventArgs e)
            {
                if (tbLot.Text.Length > 1 && cbAuto.Checked) 
                { 
                currentTB = "2";
                timer1.Enabled = true;
                            }
               
            }
    
            private void tbPart_TextChanged(object sender, EventArgs e)
            {
                if (tbPart.Text.Length > 1 && cbAuto.Checked)
                {
                    currentTB = "3";
                    timer1.Enabled = true;
                }
               
            }
    
            private void timer1_Tick(object sender, EventArgs e)
            {
                if (currentTB == "1") 
                { 
                tbLot.Focus();
                timer1.Enabled = false;
                }
                if (currentTB == "2")
                {
                    tbPart.Focus();
                    timer1.Enabled = false;
                }
                if (currentTB == "3")
                {
                    tbQuant.Focus();
                    timer1.Enabled = false;
                }
            }
    
            private void ReceivingScanner_KeyDown(object sender, KeyEventArgs e)
            {
                if (e.KeyCode==Keys.F10) 
                {
                    clearForm();
                }
                else if (e.KeyCode == Keys.Enter) 
                {
                    button1_Click(null, null);
                }
            }
            private void clearForm() 
            {
                tbItem.Text = "";
                tbLot.Text = "";
                tbPart.Text = "";
                tbQuant.Text = "";
                tbProduct.Text = "Waiting for input";
                tbItem.Focus();
            }
    
    
    
            private void button2_Click(object sender, EventArgs e)
            {
                clearForm();
            }
    
            private void ReceivingScanner_Closing(object sender, CancelEventArgs e)
            {
                MyBarcode.Dispose();
            }
    
        }
    }

    Tuesday, April 26, 2016 2:56 PM

All replies

  • Hi Yguyon28,

    First, you should be getting support through Zebra as should your issue be related to an update, only they can provide you with the latest fixes.

    Second, What debugging have you done? What values are you passing into the routine?  the message is telling you that you have a value out of range... have you proven that the value is actually in range?

    Sincerely,

    IoTGirl


    Tuesday, April 26, 2016 4:33 PM
    Moderator