惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
N
Netflix TechBlog - Medium
宝玉的分享
宝玉的分享
Google DeepMind News
Google DeepMind News
腾讯CDC
G
Google Developers Blog
Martin Fowler
Martin Fowler
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
爱范儿
爱范儿
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
aimingoo的专栏
aimingoo的专栏
有赞技术团队
有赞技术团队
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
M
MIT News - Artificial intelligence
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
美团技术团队
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志

博客园 - .NET初学者俱乐部

给 .net C# 初学者几点建议 软件设计题视频教程下载,不错哟! 地球黑匣子,这个创意怎么样? 在实际开发中碰到的小问题,保存数据时提示:对象必须实现 IConvertible asp.net中使用ajax简单例子 asp.net 版 大学英语四六级、雅思、托福考试系统应用程序实例 spread 7.0 基础知识、程序示例、设置CheckBox、image 格式 C# 操作 Excel 与 C#操作 word 示例大全 asp.net 初学者应用程序示例网 公交车上的艳遇,那对被挤扁了..... 一个 .net 程序员的梦想!大哥们帮帮我好吗? 数据访问优化性能(转载) 全面优化ADO kinmax(转贴) 如何直接将.aspx页面直接生成静态页面.htm (转载) asp.net初学者 零起点 从入门到精通的网站! 再别康桥 --徐志摩 .NET打包工具怎么注册 .dll文件?? 一个简单的EXCEL 导入SQL 的例子 大数据量数据库转换程序写后感……
Excel导入SQL 自定义类
.NET初学者俱乐部 · 2007-06-06 · via 博客园 - .NET初学者俱乐部

public class SaveToSql
 {
  public string strNewCodeId = string.Empty;
  public string strNewCode = string.Empty;
  public string strNewDes = string.Empty;
  public string strOldCodeId = string.Empty;
  public string strOldCode = string.Empty;
  public string strOldDes = string.Empty;
  public string Server = string.Empty;
  public string DataBase = string.Empty;
  public string Uid = string.Empty;
  public string Pwd = string.Empty ;
  private string TableName = string.Empty;

  /// <summary>
  /// 目的表的名称
  /// </summary>
  public string TableNames
  {
   get{return TableName;}
   set{TableName=value;}
  }

  public SaveToSql()
  {
  }
  /// <summary>
  /// 保存数据
  /// </summary>
  public  void Save()
  {
   string strConPath = string.Format("server={0};database={1};uid={2};pwd={3}",this.Server,this.DataBase,this.Uid,this.Pwd);
   SqlConnection con1 = new SqlConnection(strConPath);
   con1.Open();
   SqlCommand com1 = new SqlCommand();
   com1.CommandText = "Insert into "+TableName+"(newCodeId,newCode,newDes,oldCodeId,oldCode,oldDes) Values('"+strNewCodeId+"','"+strNewCode+"','"+strNewDes+"','"+strOldCodeId+"','"+strOldCode+"','"+strOldDes+"')";
   com1.Connection=con1;
   com1.ExecuteNonQuery();
   con1.Dispose();

  }
 }