예제 #1
0
        private static void BulkInsertToDataBase(string Object1, long HeadID, string SessionID)
        {
            DataSet           ds          = new DataSet();
            SqlConnection     conn        = new SqlConnection("");
            iCycleCountClient cycleclient = new iCycleCountClient();

            conn.ConnectionString = ConfigurationManager.ConnectionStrings["elegantcrm7ConnectionString"].ConnectionString;
            conn.Open();
            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                DataTable     dt      = new DataTable();
                ds = cycleclient.GetCycleTempDataToInsert(Object1, profile.Personal.UserID, SessionID, profile.DBConnection._constr);
                dt = ds.Tables[0];
                DataRow row = dt.NewRow();
                dt.Columns.Add("CycleHeadID", typeof(System.Int64));
                dt.Columns["CycleHeadID"].Expression = HeadID.ToString();
                cycleclient.SaveCyclePlanData(dt, profile.DBConnection._constr);
            }
            catch { }
            finally
            {
                cycleclient.Close();
                conn.Close();
            }
        }