zoukankan      html  css  js  c++  java
  • vs2013 linq to mysql

    安装文件

    1.下载安装文件

    2.创建项目

    3.创建mysql数据连接

    4.新建ADO.NET数据模型

    项目实现代码

     using (WorkerContainer db = new WorkerContainer()){
                    IQueryable<workers_info> linq = from c in db.workers_info select c;
                    List<workers_info> list = linq.ToList();
                }
                using (WorkerContainer db = new WorkerContainer()){
                    var info = db.workers_info.SingleOrDefault<workers_info>(s => s.id == 2);
                    info.email = "xxxxxx@126.com";
               db.SaveChanges(); }
      using (WorkerContainer db = new WorkerContainer()){
                    workers_info infoModel = new workers_info();
                    infoModel.email = "22222222";
    
                    infoModel.salary = 3;
                    infoModel.workername = "zhaoiyue";
                    infoModel.EmployedDates = DateTime.Now;
                    infoModel.department = "12312";
    
                    db.workers_info.Add(infoModel);
                    db.SaveChanges();
                }
  • 相关阅读:
    BUAA OO Unit1 表达式求导
    中介者模式
    命令模式
    观察者模式
    解释器模式
    策略模式
    迭代器模式
    模板方法模式
    代理模式
    桥接模式
  • 原文地址:https://www.cnblogs.com/z-yue/p/5707718.html
Copyright © 2011-2022 走看看