zoukankan      html  css  js  c++  java
  • dataset 和DataTable的用法

    以下包含了这两种不同属性的用法:

    foreach (DataRow dr in dataset.Tables[0].Rows)
                {

                    if (i != 0 && lujing!="")
                    {
                        DataTable dt = new DataTable();
                        dt = new BLL.production().GetList_pro(" production_id=" + dr["Column1"]).Tables[0];
                        int n = int.Parse(dt.Rows.Count.ToString());
                        if (n == 0)
                        {
                            model.channel_id = 20;
                            model.category_id = 83;
                            model.production_id = int.Parse(dr["Column1"].ToString());
                            model.pmzc = dr["Column2"].ToString();
                            model.title1 = dr["Column3"].ToString();
                            model.author = dr["Column4"].ToString();
                            model.img_url1 = lujing + dr["Column5"].ToString();
                            model.size = dr["Column6"].ToString();
                            model.creation_year = dr["Column7"].ToString();
                            model.judge = dr["Column8"].ToString();
                            if (!string.IsNullOrEmpty(dr["Column10"].ToString()))
                            {
                                model.explain_1 = dr["Column10"].ToString();
                            }
                            model.explain_2 = dr["Column11"].ToString();
                            model.sort_id = 99;
                            if (bll.Add(model) < 1)
                            {

                            }
                        }
                        else {
                            foreach (DataRow item in dt.Rows)
                            {

                                Model.production model_1 = bll.GetModel(int.Parse(item["id"].ToString()));
                                model_1.price_1 = dr["Column9"].ToString();
                                if (bll.Update(model_1))
                                {

                                }
                            }
                           
                           
                        }
                       
                    }
                    i++;
                }

  • 相关阅读:
    前端高效开发必备的 js 库梳理
    前端进阶: css必知的几个底层知识和技巧
    Vue项目上线做的一些基本优化
    如何制作一个组件?论组件化思想
    15分钟带你了解前端工程师必知的javascript设计模式(附详细思维导图和源码)
    Promise的源码实现(完美符合Promise/A+规范)
    前端工程师不可不知的Nginx知识
    java EE应用概述
    javaweb学习——session和Cookie实现购物车功能
    javaweb学习——会话技术(二)
  • 原文地址:https://www.cnblogs.com/WZH75171992/p/4140139.html
Copyright © 2011-2022 走看看