陈宝刚---享受生活,追逐梦想!
理想是心中的火焰,有追求的人才是幸福的人!
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 51 下一页
摘要: public class WordAPI{ private object _template; private object _newWord; private Microsoft.Office.Interop.Word.Application wordApp; private Microsoft.Office.Interop.Word.Document _wordDocument; private object defaultV = System.Reflection.Missing.Value; private object documentType; /// <summary> 阅读全文
posted @ 2011-05-04 16:01 追梦人RUBY 阅读(258) 评论(0) 推荐(1) 编辑
摘要: 1、 Microsoft.Office.Interop.Word.Application wordApp = new ApplicationClass()word对象2、 Microsoft.Office.Interop.Word.Document wordDoc = wordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing) 文档对象3、 Object Nothing = System.Reflection.Missing.Value 常用的一个参数4、wordApp.ActiveWindow.Activ 阅读全文
posted @ 2011-05-04 15:54 追梦人RUBY 阅读(716) 评论(0) 推荐(1) 编辑
摘要: 我们在调用word打印的时候有时候出现过这种情况。即,我们调用wordDoc.PrintOut把数据发送给打印机后,调用关闭程序的方法,有时候会出现数据未完全发送给打印机造成数据丢失页面打印不全的问题。解决办法:强制让程序把数据全部发给打印机后在关掉结束掉打印进程。object wdpa = WdPrintOutRange.wdPrintAllDocument; object wdItem = WdPrintOutItem.wdPrintDocumentContent; object wdPageType = WdPrintOutPages.wdPrintAllPages; object ba 阅读全文
posted @ 2011-05-04 15:54 追梦人RUBY 阅读(598) 评论(0) 推荐(0) 编辑
摘要: protected void Button1_Click(object sender, EventArgs e){ /*=============测试通过===============*/OleDbConnection con = newOleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;DataSource=C:/Inetpub/wwwroot/DotNetArticle/App_Data/DotNetArticle.mdb"); con.Open(); OleDbCommand cmd = new OleDbCommand 阅读全文
posted @ 2011-05-01 17:33 追梦人RUBY 阅读(1712) 评论(0) 推荐(0) 编辑
摘要: Access不能像SQL server一样直接执行多条语句,但是把多条语句绑成事务还是可以一起执行的. 所谓事务,就是把多件事情当做一件事情来处理。也就是大家同在一条船上!由一个事务来完成多个表的同步操作,要么都执行成功,要么都不成功.下面举个例子,用C#实现Access数据库事务的处理方法:向一个表提交数据,同时更新另一个表中的数据using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using Syste 阅读全文
posted @ 2011-05-01 17:31 追梦人RUBY 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 1、说明:复制表(只复制结构,源表名:a 新表名:b) (Access可用)法一:select * into b from a where 1<>1法二:select top 0 * into b from a2、说明:拷贝表(拷贝数据,源表名:a 目标表名:b) (Access可用)insert into b(a, b, c) select d,e,f from b;3、说明:in 的使用方法select * from table1 where a [not] in (‘值1’,’值2’,’值4’,’值6’)4、说明:between的用法,between限制查询数据范围时包括了边 阅读全文
posted @ 2011-05-01 16:51 追梦人RUBY 阅读(154) 评论(0) 推荐(0) 编辑
摘要: LEFT JOIN :以左表为基础,显示左表中的所有列,不管是否与关联条件相匹配,而右表中的数据只显示与关联条件相匹配的列,不匹配的列以NULL字符填充.RIGHT JOIN:以右表为基础,显示右表中的所有列,不管是否与关联条件相匹配,而左表中的数据只显示与关联条件相匹配的列,不匹配的列以NULL字符填充.a表 id name b表 id job parent_id 1 张3 1 23 1 2 李四 2 34 2 3 王武 3 34 4 左连接 select a.*,b.* from a left join b on a.id=b.parent_id 右连接 select a.*,b.* fr 阅读全文
posted @ 2011-05-01 16:39 追梦人RUBY 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 2.外连接 A、left outer join: 左外连接(左连接):结果集几包括连接表的匹配行,也包括左连接表的所有行。 sql: select a.a, a.b, a.c, b.c, b.d, b.f from a LEFT OUT JOIN b ON a.a = b.cB:right outer join: 右外连接(右连接):结果集既包括连接表的匹配连接行,也包括右连接表的所有行。 C:full outer join: 全外连接:不仅包括符号连接表的匹配行,还包括两个连接表中的所有记录。-------------------------------------------------- 阅读全文
posted @ 2011-05-01 16:37 追梦人RUBY 阅读(165) 评论(0) 推荐(0) 编辑
摘要: --方式一 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[USP_ProcedureWithTransaction_Demo]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[USP_ProcedureWithTransaction_Demo] GO -- ============================================= -- Author: <Che 阅读全文
posted @ 2011-04-26 18:13 追梦人RUBY 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 在 SQL Server 中数据库事务处理是个重要的概念,也稍微有些不容易理解,很多 SQL 初学者编写的事务处理代码存往往存在漏洞,本文介绍了三种不同的方法,举例说明了如何在存储过程事务处理中编写正确的代码。在编写 SQL Server 事务相关的存储过程代码时,经常看到下面这样的写法: begin tran update statement 1 ... update statement 2 ... delete statement 3 ... commit tran这样编写的SQL存在很大隐患。请看下面的例子: create table demo(id int not null) go b 阅读全文
posted @ 2011-04-26 18:06 追梦人RUBY 阅读(216) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 51 下一页