<?xml version="1.0" encoding="gb2312"?>

<!-- RSS generated by oioj.net on 4/16/2004 ; 感谢LeXRus提供 RSS 2.0 文档; 此文件可自由使用，但请保留此行信息 --> 
<!-- Source download URL: http://blogger.org.cn/blog/rss2.asp       -->
<rss version="2.0">

<channel>
<title>人在旅途</title>
<link>http://blogger.org.cn/blog/blog.asp?name=zhoujianjun</link>
<description>人在旅途的博客</description>
<copyright>blogger.org.cn</copyright>
<generator>W3CHINA Blog</generator>
<webMaster>webmaster@blogger.org.cn</webMaster>
<item>
<title><![CDATA[我的第一份工作--上海贝尔 18. 郑州2]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=47312</link>
<author>zhoujianjun</author>
<pubDate>2009-10-22 9:55:17</pubDate>
<description><![CDATA[<a>&nbsp;&nbsp;&nbsp; 第二天,我去了省政府电信科的小机房,一帮中年妇女正聊天呢,她们和我说她们那里没啥事情,就是担心总局升级的时候出事,让我去总局,还告诉我郑州没啥好玩的,只有个亚细亚商场还可以.我就去电信局看看,一路上漫天大风沙,知道是从黄河刮过来的,不知道有没有北京厉害,反正我是受不了.在路边打了个长途回家,又被宰了刀,不过反正有发票可报销.<br>&nbsp;&nbsp;&nbsp; &nbsp;到了电信局,已经有三个BELL人在那里了,两个愁眉哭脸的在忙活,估计碰到问题了,一个悠闲地在闭目养神.和他们聊了几句,知道没我啥事,我只要软件升级那晚来看看就可以了.两个忙的人一时出去了,那个闭目养神开始敲键盘打命令了,一边做还一边说"把我说的话当耳边风,你们有本事咋摆不平呢!"<br>&nbsp;&nbsp; &nbsp;回到招待所,省政府电信科来个人请我去吃饭,其间他对我诉苦一番,最后总结了句:"改革的春风就是吹不进河南啊!"<br>&nbsp;&nbsp; &nbsp;第二天我参加少林寺一日游,半路上上车个导游问我们收导游费(原来昨天交的只是车费),不过给我们车票代替发票用,反正可报销,就没人找她麻烦了.先去了个展览馆参观,当然也要买门票的,最后到了少林寺了,进门路上到处是当地人在卖一种自制的会叫的少林寺工夫和尚的小玩意,开始叫卖5块,最后2毛都肯卖.进了寺,到处逛逛,没啥特别的,除了历代主持的墓地,一座座塔的地方,可以回忆下电影里的情节.还可以看十分钟电影,介绍少林功夫的.最后去坐缆车,不知道是不是少室山,反正很矮,不陡,要排很长的对,不少人等不及就自己走下山去了.对了中午在那里的一家餐馆吃饭,又给宰了顿,吃了个鸭掌,要了我60块(两天工资).<br>&nbsp;&nbsp; &nbsp;电信局软件升级那天晚上,来了很多人,都是电信局的头头,BELL方也来了个测试部三级经理.升级的时候,大家都盯着指示灯看,比预计的时间晚了点才好,大家都捏把汗.完事后,测试部经理大呼我的名字,让我打电话去省政府问问有没有问题,总算我有点用处了.<br>&nbsp;&nbsp; &nbsp;升级完第二天我就回上海,记得是坐飞机的,因为在侯机的时候和个上海律师聊了起来了,那时候律师还是个新鲜职业呢,他给了我张名片,让我有事找他,说不贵的.</a>]]></description>
</item><item>
<title><![CDATA[我的第一份工作--上海贝尔 17. 郑州]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=46882</link>
<author>zhoujianjun</author>
<pubDate>2009-8-19 14:50:58</pubDate>
<description><![CDATA[<p style="font-family: 仿宋_GB2312;"><a>&nbsp;&nbsp;&nbsp; 晚上离开了吉首,我去郑州,小P和小A则回武汉,不过我们都要先到长沙转车.邮电局的人只给我们搞到了两张卧铺票,我和小A就商量好上半夜我睡卧铺,下半夜他睡.于是我先睡上了卧铺,看我的&lt;三个火枪手&gt;(旅途中是看长篇的好时间);小A就坐窗边.在我快迷糊的时候,来了个列车员查票,把小A赶到普通车厢去了.</a></p><p style="font-family: 仿宋_GB2312;"><a>&nbsp;&nbsp; &nbsp;第二天早上,小A回来了,向我们诉苦,说晚上睡着的时候差点给人偷了,衣服口袋也给割破了,他知道了也不敢声张(&lt;天下无贼&gt;原来是真的).小P就怨他自己不机灵,其实晚上检查的时候,小P就溜去上厕所,小A机灵的话,就睡小P的铺位就不会被赶走了.</a></p><p style="font-family: 仿宋_GB2312;"><a>&nbsp;&nbsp; &nbsp;上午路过个地方,产煤的,真黑真脏啊,似乎整个地方都给染黑了.</a></p><p style="font-family: 仿宋_GB2312;"><a>&nbsp;&nbsp; &nbsp;下午到了长沙,下车后,小P就劝我和他们一起去武汉,然后在武汉转车去郑州.我没答应,因为我想玩玩长沙.出了车站,就有个人自动上前问我要旅馆吗?我也糊涂了,就说我想买飞机票,他就带我去售票处,结果没有飞郑州的航班,我想甩了那人,那人就问我要十块钱服务费,我知道碰上流氓了,就还价五块,那人就凶起来了,我只好自认倒霉.自己找了家旅馆住下,出去逛逛,看到个录像馆,就去买票.卖票的小女孩和我说人民币可以抽奖,让我把钱包里的人民币给她看,我又犯糊涂了,就全拿出来给她看.她先装模作样地一张张对号码,速度越来越快,最后竟然往自己口袋塞,还好我动作快,一把拦下.她也一点不害怕,我还舍不得录像票呢,就进去看录像,寻思着是否要去报案.想想算了,人生地不熟的,长沙又这么乱,估计是警匪一家了.</a></p><p style="font-family: 仿宋_GB2312;"><a>&nbsp;&nbsp; &nbsp;连吃两次亏,心情很坏,也不打算玩长沙这破地方了,第二天就买火车票去郑州了.在火车上晃了几小时后就进了河南了,在个小站停车的时候,下面上来几个人,其中一个人拉了一段二胡,还有两个就把车门把住,然后一个个收钱,不给不行,大家都给,我也就很郁闷地给了两块钱.真他妈的现代版铁道游击队,也不见乘警来管,估计又是警匪一家了.公司老前辈说得没错,内地是很乱的,到了地就要找地头蛇--邮电局,事事和他们一起就不会吃亏.</a></p><p style="font-family: 仿宋_GB2312;"><a>&nbsp;&nbsp; &nbsp;终于到了郑州,河南省政府电信科竟然来个科长接我,受宠若惊(原来他们和我们公司关系很好),还去饭店请吃饭,然后去他们机房逛了圈,就把我安排在省政府招待所里了,中饭和午饭时都会有个科员来请我去吃饭,有时候他们科长也会来.果然是大衙门地人即有钱又有空.</a></p>]]></description>
</item><item>
<title><![CDATA[上网本的液晶砸坏了.]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=46452</link>
<author>zhoujianjun</author>
<pubDate>2009-7-8 16:22:39</pubDate>
<description><![CDATA[<a>　附近商场新装开店,去买了个打折的上网本,8.9寸的DELL货,配置都不错,N270+1G内存+8G的SSD,才2万日元不到.赚到便宜货了,高兴.没高兴几天,不小心闹钟掉下来砸到液晶了,表面玻璃一点事都没有,里面</a><a>液晶可坏了.点亮后,整个尔碎镜子的样子.<br>&nbsp; 快打电话,人家说你自己弄坏的,不保修,自己出钱修,开价2.3万+新液晶的费用.再去找别的小公司修,只要1.6万.还是嫌贵,打电话问国内的维修公司,人家说只要4,5百RMB.不过担心,国内的不保险,给你换次品,甚至换掉你的原装内存和SSD.算了就把它留做服务器用吧,因为只是液晶坏了,其他都OK,接个外接显示器照样用,只是不能带出去了.不过它没有硬盘,倒是很剩点,适合做一直开着的服务器用,只是SSD小了点,再插块SD卡吧,也可做文件服务器了.等SSD便宜了再换大点的,不过是IDE借口的,到时候这种SSD还有没有都成问题.<br>另外新疆暴乱了,死了一百多人,大部分是汉人.不过国外媒体都说成是少数民族死了.<br></a>]]></description>
</item><item>
<title><![CDATA[如何配置 SQL Server 2005 以允许远程连接]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=46375</link>
<author>zhoujianjun</author>
<pubDate>2009-7-2 8:44:56</pubDate>
<description><![CDATA[<P>文章编号: 914277 - 最后修改: 2007年11月30日 - 修订: 1.0<BR>如何配置 SQL Server 2005 以允许远程连接<BR>查看本文应用于的产品<BR>本页 <BR>简介 <BR>更多信息 <BR>为 SQL Server 2005 Express Edition 或 SQL Server 2005 Developer Edition 启用远程连接 <BR>启用 SQL Server Browser 服务 <BR>在 Windows 防火墙中创建例外 <BR>在 Windows 防火墙中为 SQL Server 2005 创建例外 <BR>在 Windows 防火墙中为 SQL Server Browser 服务创建例外 <BR>展开全部 | 关闭全部 <BR>简介 <BR>在尝试从远程计算机连接到 Microsoft SQL Server 2005 实例时，可能会接收到错误消息。在使用任何程序连接到 SQL Server 时都可能...<BR>在尝试从远程计算机连接到 Microsoft SQL Server 2005 实例时，可能会接收到错误消息。在使用任何程序连接到 SQL Server 时都可能会发生此问题。例如，在使用 SQLCMD 实用工具连接到 SQL Server 时收到以下错误消息： <BR>Sqlcmd:错误:Microsoft SQL Native Client:建立到服务器的连接时发生错误。连接到 SQL Server 2005 时，默认设置 SQL Server 不允许远程连接这个事实可能会导致失败。<BR>如果没有将 SQL Server 2005 配置为接受远程连接，则可能会发生此问题。默认情况下，SQL Server 2005 Express Edition 和 SQL Server 2005 Developer Edition 不允许远程连接。若要配置 SQL Server 2005 以允许远程连接，请完成以下所有步骤： <BR>在您要从远程计算机连接到的 SQL Server 实例上启用远程连接。 <BR>打开 SQL Server Browser 服务。 <BR>配置防火墙以允许与 SQL Server 和 SQL Server Browser 服务相关的网络通讯。<BR>本文介绍如何完成这些步骤中的每一步。 <BR>回到顶端<BR>更多信息 <BR>若要在 SQL Server 2005 实例上启用远程连接并打开 SQL Server Browser 服务，请使用 SQL Server 2005 外围应用配...<BR>若要在 SQL Server 2005 实例上启用远程连接并打开 SQL Server Browser 服务，请使用 SQL Server 2005 外围应用配置器工具。在安装 SQL Server 2005 时会安装外围应用配置器工具。 <BR>回到顶端<BR>为 SQL Server 2005 Express Edition 或 SQL Server 2005 Developer Edition 启用远程连接<BR>必须为要从远程计算机连接到的每个 SQL Server 2005 实例启用远程连接。为此，请按照下列步骤操作： <BR>单击“开始”，依次指向“程序”、“Microsoft SQL Server 2005”和“配置工具”，然后单击“SQL Server 外围应用配置器”。 <BR>在“SQL Server 2005 外围应用配置器”页上，单击“服务和连接的外围应用配置器”。 <BR>在“服务和连接的外围应用配置器”页上，展开“数据库引擎”，依次单击“远程连接”和“本地连接和远程连接”，单击适用于您的环境的相应协议，然后单击“应用”。</P>
<P>注意：请在接收到以下消息时单击“确定”： <BR>直到重新启动数据库引擎服务后，对连接设置所做的更改才会生效。<BR>在“服务和连接的外围应用配置器”页上，展开“数据库引擎”，依次单击“服务”和“停止”，等待 MSSQLSERVER 服务停止，然后单击“启动”以重新启动 MSSQLSERVER 服务。<BR>回到顶端<BR>启用 SQL Server Browser 服务<BR>如果您是通过使用实例名称来运行 SQL Server 2005 并且在连接字符串中没有使用特定的 TCP/IP 端口号，则必须启用 SQL Server Browser 服务以允许远程连接。例如，使用 &lt;计算机名&gt;\SQLEXPRESS 的默认实例名称安装的 SQL Server 2005 Express。不管您正在运行多少个 SQL Server 2005 实例，只需要启用一次 SQL Server Browser 服务。若要启用 SQL Server Browser 服务，请执行以下步骤。</P>
<P>重要说明：这些步骤可能会增加您的安全风险。这些步骤还可能导致您的计算机或网络更易于受到恶意用户或恶意软件（如病毒）的攻击。我们之所以推荐本文介绍的这一过程，是为了使程序能够按照设计意图运行，或者为了实现特定的程序功能。我们建议在进行这些更改之前，充分考虑在您的特定环境中实施这一过程可能带来的风险。如果您选择实施此过程，请采用任何适当的附加步骤以保护您的系统。我们建议只有确实需要这一过程时才使用它。 <BR>单击“开始”，依次指向“程序”、“Microsoft SQL Server 2005”和“配置工具”，然后单击“SQL Server 外围应用配置器”。 <BR>在“SQL Server 2005 外围应用配置器”页上，单击“服务和连接的外围应用配置器”。 <BR>在“服务和连接的外围应用配置器”页上，单击“SQL Server Browser”，在“启动类型”中单击“自动”选项，然后单击“应用”。</P>
<P>注意：在单击“自动”选项后，每次启动 Microsoft Windows 时将自动启动 SQL Server Browser 服务。 <BR>单击“启动”，然后单击“确定”。<BR>注意：在计算机上运行 SQL Server Browser 服务时，计算机显示其上运行的每个 SQL Server 实例的实例名称和连接信息。如果不启用 SQL Server Browser 服务并且通过分配的 TCP 端口直接连接到 SQL Server 实例，则可以降低此风险。本文不讨论如何通过 TCP 端口直接到 SQL Server 实例。有关 SQL Server Browser 服务和连接到 SQL Server 实例的更多信息，请参见《SQL Server 联机丛书》中的以下主题： <BR>SQL Server Browser 服务 <BR>连接到 SQL Server 数据库引擎 <BR>客户端网络配置<BR>回到顶端<BR>在 Windows 防火墙中创建例外<BR>这些步骤适用于 Windows XP Service Pack 2 (SP2) 和 Windows Server 2003 中包含的 Windows 防火墙版本。如果您使用的是不同的防火墙系统，请参阅相应的防火墙文档以了解更多信息。 </P>
<P>如果在运行 SQL Server 2005 的计算机上运行防火墙，将会阻止访问 SQL Server 2005 的外部连接，除非 SQL Server 2005 和 SQL Server Browser 服务可以通过防火墙进行通信。必须为每个要接受远程连接的 SQL Server 2005 实例创建一个例外，并为 SQL Server Browser 服务创建一个例外。</P>
<P>在安装 SQL Server 2005 的程序文件时，SQL Server 2005 会使用一个实例 ID 作为路径的一部分。若要为每个 SQL Server 实例创建一个例外，必须确定正确的实例 ID。若要获取实例 ID，请执行以下步骤： <BR>单击“开始”，依次指向“程序”、“Microsoft SQL Server 2005”和“配置工具”，然后单击“SQL Server 配置管理器”。 <BR>在“SQL Server 配置管理器”中，单击右窗格中的“SQL Server Browser 服务”，右键单击主窗口中的实例名称，然后单击“属性”。 <BR>在“SQL Server Browser 属性”页上，单击“高级”选项卡，定位到属性列表中的实例 ID，然后单击“确定”。<BR>若要打开 Windows 防火墙，请单击“开始”，再单击“运行”，键入 firewall.cpl，然后单击“确定”。 <BR>在 Windows 防火墙中为 SQL Server 2005 创建例外<BR>若要在 Windows 防火墙中为 SQL Server 2005 创建例外，请执行以下步骤： <BR>在 Windows 防火墙中，单击“例外”选项卡，然后单击“添加程序”。 <BR>在“添加程序”窗口中，单击“浏览”。 <BR>单击 C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe 可执行程序，单击“打开”，然后单击“确定”。</P>
<P>注意：上述路径可能会根据 SQL Server 2005 的安装位置而不同。MSSQL.1 这个占位符代表的是您在前面过程的步骤 3 中获得的实例 ID。 <BR>对于每个需要为其创建例外的 SQL Server 2005 实例，重复步骤 1 到步骤 3。<BR>在 Windows 防火墙中为 SQL Server Browser 服务创建例外<BR>若要在 Windows 防火墙中为 SQL Server Browser 服务创建例外，请执行以下步骤： <BR>在 Windows 防火墙中，单击“例外”选项卡，然后单击“添加程序”。 <BR>在“添加程序”窗口中，单击“浏览”。 <BR>单击 C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe 可执行程序，单击“打开”，然后单击“确定”。</P>
<P>注意：上述路径可能会根据 SQL Server 2005 的安装位置而不同。<BR>回到顶端</P>
<P>--------------------------------------------------------------------------------</P>
<P>这篇文章中的信息适用于:<BR>Microsoft SQL Server 2005 Developer Edition <BR>Microsoft SQL Server 2005 Express Edition<BR>回到顶端<BR>关键字：&nbsp;&nbsp; kbhowto kbinfo kbtshoot KB914277 </P>
<P>回到顶端<BR>Microsoft和/或其各供应商对于为任何目的而在本服务器上发布的文件及有关图形所含信息的适用性，不作任何声明。 所有该等文件及有关图形均"依样"提供，而不带任何性质的保证。Microsoft和/或其各供应商特此声明，对所有与该等信息有关的保证和条件不负任何责任，该等保证和条件包括关于适销性、符合特定用途、所有权和非侵权的所有默示保证和条件。在任何情况下，在由于使用或运行本服务器上的信息所引起的或与该等使用或运行有关的诉讼中，Microsoft和/或其各供应商就因丧失使用、数据或利润所导致的任何特别的、间接的、衍生性的损害或任何因使用而丧失所导致的之损害、数据或利润不负任何责任。<BR>&nbsp; <BR>&nbsp;<BR>&nbsp;<BR>&nbsp;<BR>请提供关于这些信息的反馈<BR>&nbsp;<BR>这些信息帮助解决问题了吗？<BR>&nbsp; 是 <BR>&nbsp;<BR>&nbsp;否 <BR>&nbsp;<BR>&nbsp;我不知道 <BR>&nbsp;</P>
<P>&nbsp;<BR>这些信息和问题是相关的吗？<BR>&nbsp; 是 <BR>&nbsp;<BR>&nbsp;否 <BR>&nbsp;</P>
<P>&nbsp;<BR>您认为我们怎样才能提高这些信息的质量呢？</P>
<P>&nbsp;<BR>为了保护您的隐私，请不要在您的反馈中提及联系信息。<BR>&nbsp;&nbsp; </P>
<P>非常感谢！您的反馈将被用来改进我们的支持内容。更多的帮助选项，请访问微软帮助和支持主页.<BR>&nbsp;&nbsp; <BR>&nbsp; 需要更多帮助?<BR>请通过电子邮件、联机或电话与支持工程师联系 </P>
<P>文章翻译<BR>Hebrew阿拉伯语德语俄语法语繁体中文哈萨克韩国语荷兰语葡萄牙语葡萄牙语(巴西)日语斯洛维亚语土耳其语西班牙语希腊语意大利语英语 (US)&nbsp;&nbsp;&nbsp; </P>
<P>相关支持中心<BR>SQL Server 2005<BR>&nbsp;</P>
<P>页面工具<BR>打印此页 <BR>通过电子邮件发送此页<BR>&nbsp;<BR>&nbsp;</P>
<P>&nbsp;需要更多帮助?<BR>请通过电子邮件、联机或电话与支持工程师联系 </P>]]></description>
</item><item>
<title><![CDATA[我的第一份工作--上海贝尔 16. 吉首(二)]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=45691</link>
<author>zhoujianjun</author>
<pubDate>2009-5-28 15:37:09</pubDate>
<description><![CDATA[<a>&nbsp;&nbsp;&nbsp; 到了周末了,邮局的人怂恿我们去张家界玩.早听说张家界风景秀丽,可比九寨沟,于是我们当然去咯.<br>&nbsp;&nbsp; &nbsp;忘记是坐火车还是坐汽车去的,反正不是很远.大门在山脚下,游人挺多的,有个独眼老头上来介绍自己,说他是导游兼挑夫,只要五块钱一天.我们就雇了他,说他是导游,话不多(只是一个尽怂恿我们去玩漂流);说他是挑夫,只给我们背了个小包.<br>&nbsp;&nbsp; &nbsp;一路上风景的确不错,也有些景点,什么将军台什么的,记不清了.傍晚独眼老头给我们介绍了个私人小旅馆,在那里吃饭,结果向我们要一百多,小A大为生气,和老板娘理论,总算少付了点.饭后,我们告诉独眼老头说我们不去漂流了,老头大是失望,要了他的五块钱就走了,说不陪我们了.其实我们也想去,可路程太远了,大半天坐车.睡觉前去上厕所,应该说上茅房才对,没水,没灯,臭气熏天,还好小A给我点了根烟,这样我才没被熏死.<br>&nbsp;&nbsp; &nbsp;第二天,没了导游,倒觉得很自在,在山上慢慢逛.有个尼姑俺,进去求了挂,是上上签,我就开玩笑说里面都是好签,老尼姑说:"难道下下签才好?"老尼姑给我解签,说我人生之路要有大转变(于是我更加决定要辞职了),我给了几块香油钱.<br>&nbsp;&nbsp; &nbsp;有个大溶洞,我们坐车去玩,在车上我和小P被误会成夫妻.小P比我大很多,其实我一直老相,24岁时去买本命年生肖,被误认为是替孩子买的.溶洞很大,刚开发出来,游人不是很多,钟乳石很好看,解说的说那里有个手,这里是老毛的像,看看的确有点象.<br>&nbsp;&nbsp; &nbsp;回到吉首,第二天晚上就开工了,我们坐着邮局的车去个小地方,开通我们的RASM.线接好了,不通.我只好自认倒霉,又失败了,不过没上次安达那么紧张,我准备打持久战了.小P还是说她们的光纤是好的.回到总局,总局有个A培在开局,好象经验有点的样子.我就让他看看软件有没有问题,他说没问题,不过多了很多警告,不知为什么,正在查原因.第二天我打电话回公司报告情况,C经理安慰我说碰到问题是好事情,可以多学点东西.<br>&nbsp;&nbsp; &nbsp;过了几天,问题还没解决,C经理就问我来这里的路,我告诉他要坐飞机,还要转两次火车,他骂了句:"这破地方."就打消了亲自来的想法.那个A陪熬不住了,把那些警告打出来给我,说他看着烦,让我传回公司看看.我就FAX回去了.没多久,我们组里的退休回聘的J工打来电话,说他研究过了,可能是两根光纤线接反了.我们马上坐车去看,小P一查,还真是弄反了,调过来后马上就好了.这下我轻松了,因为不是我们公司的问题.小P比较气愤,就打电话回她们的公司,痛骂了安装光纤的人,说因为他们装反了,让我们白白多呆了一星期.看来姜还是老的辣,人家退休回聘是有道理的.<br>&nbsp;&nbsp; &nbsp;于是我们决定马上回去咯,邮局代我们买火车票,结果只弄到两张卧铺,还有张是坐票.他们劝我再等两天走,那时他们还能再弄张卧铺票,我没答应,坚持一起走.走之前,给公司打了电话,C经理让我先不要回去,先去次郑州,原来那里的系统要升级,本来没有RASM什么事情,不过人家不放心,让我们去个人,人家可以河南省政府,于是又让我去做人质了.<br>&nbsp;&nbsp; &nbsp;走之前我去邮电局取我存的邮政储蓄,他们竟然给我一大包碎票,我发火了,这么多碎票让我如何带在路上?再说我存进去的可都是百元大钞.最后好歹给我换了百元大钞.<br>&nbsp;&nbsp; &nbsp;早上坐火车离开了吉首,这次不走襄樊,而是从湘南绕道长沙.路上遇到不少事.</a>]]></description>
</item><item>
<title><![CDATA[关于SUBMIT一个FORM后，SERVER端收到的汉字是乱码的问题]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=45590</link>
<author>zhoujianjun</author>
<pubDate>2009-5-22 11:43:41</pubDate>
<description><![CDATA[<a>　使用JAVASCRIPT来SUBMIT一个FORM后，SERVER端收到的汉字是乱码，可在JSP开头添加如下代码来解决：<br>&lt;%request.setCharacterEncoding("XXXXX"); %&gt;<br></a>]]></description>
</item><item>
<title><![CDATA[使用jsp:usebean]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=45391</link>
<author>zhoujianjun</author>
<pubDate>2009-5-13 8:45:15</pubDate>
<description><![CDATA[<a>　使用jsp:usebean来自动映射HTML的FIELD时要注意:<br>
1.</a><a>HTML的FIELD名要以小写字母开始,因为BEAN的PROPERTY名字也是</a><a>以小写字母开始(x.getAbc()时</a><a>PROPERTY名字为abc</a><a>)</a><a>;<br>
2.scope要设置为"request",因为它只在BEAN生成时才进行</a><a>映射</a><a>操作,如果使用</a><a>"session"那么它只在画面第一显示时进行</a><a>映射</a><a>操作,而那时根本没有任何</a><a>HTML的FIELD可</a><a>映射.</a>]]></description>
</item><item>
<title><![CDATA[12岁男孩在派出所被打20多耳光 被要求擦车( 组图 )]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=45070</link>
<author>zhoujianjun</author>
<pubDate>2009-4-27 9:46:41</pubDate>
<description><![CDATA[<a>　<span class="oblog_text"><a>时间：<span id="pub_date">2009-04-27 10:16</span>&nbsp;&nbsp;&nbsp;来源：<span id="art_source">华商网-华商报</span>&nbsp;&nbsp;&nbsp;浏览次数：<br>核心提示：12岁的男孩因与另一少年打架被警方调查，男孩称在派出所不但被民警抽打了20多耳光，还被要求擦了几小时的车，其中包括两辆警车。男孩的母亲称曾有两名男子上门告诫他们此事不得"对外声张，扩大事态"。<br>
<br>
　　</a><div style="text-align: center;"><img onload="javascript :if(this.width onmousewheel='return bbimg(this)' border='0'  border='0' title='点击在新窗口查看原始图片' onload='java_script_:if(this.width>500)this.width=500'>570) this.width=570" src="http://img1.cache.netease.com/catchpic/1/1A/1A3F4E9109CF9AF7E96D60F1CF7B55BB.jpg"></div><br>
<br>
　　<div style="text-align: center;">小印左脸颊上有红肿的伤痕 本组图片由本报记者 李华 摄</div><br>
<br>
　　<div style="text-align: center;"><img onload="javascript :if(this.width onmousewheel='return bbimg(this)' border='0'  border='0' title='点击在新窗口查看原始图片' onload='java_script_:if(this.width>500)this.width=500'>570) this.width=570" src="http://img1.cache.netease.com/catchpic/A/A3/A3367F46DBE4BD757CEFF2A97E1627BB.jpg"></div><br>
<br>
　　<div style="text-align: center;">小印擦洗的车辆</div><br>
<br>
　　<div style="text-align: center;"><img onload="javascript :if(this.width onmousewheel='return bbimg(this)' border='0'  border='0' title='点击在新窗口查看原始图片' onload='java_script_:if(this.width>500)this.width=500'>570) this.width=570" src="http://img1.cache.netease.com/catchpic/D/DE/DE48C0502DF227E591AF5439C8ACEC21.jpg"></div><br>
<br>
　　<div style="text-align: center;">小印的父亲在楼道里向孙刚询问孩子的书包下落</div><br>
<br>
　　<strong>华商报4月27日报道</strong> 两少年打架，一方叫来民警将对方带到派出所“调查”。昨日，躺在病床上的12岁男孩小印(化名)捂着左脸上的伤痕难过地说，自己在派出所里不但被民警殴打，还被要求擦了几个小时的车。<br>
<br>
　　<strong>少年：派出所里被打20多个耳光</strong><br>
<br>
　　小印说他在富平县庄里镇初中上学。4月24日下午4时许放学后，他在镇街道一家游戏厅因争游戏机与15岁的小柯(化名)打架，对方指着他狠狠地说：“
你等着……”约40分钟后，街边停下一辆车，来人问小柯是谁打的，小柯用手指了指小印，小印随即被拉上车带到富平县公安局庄里派出所。<br>
<br>
　　他说，一进派出所值班室，一名穿运动鞋的便衣民警就开始打他。“他连着打了我20多个耳光，还让我蹲下，在胸口连着踹了好几脚……最后就要求我去擦停
在派出所大院里的5辆车，其中有两辆警车。”小印说，当时自己被拳打脚踢时，值班室内还有4名民警正在看电视，“他们嘻嘻哈哈冲我笑……”打人男子还威胁
他，再不老实就把他铐在院子里的树上。<br>
<br>
　　<strong>协警：孩子主动要求擦车</strong><br>
<br>
　　小印的父亲说，当晚不见儿子回家，就让女儿去找，后通过同学打听到消息。等赶到派出所后，他看到脸部肿胀的孩子在提水擦车，值班民警说等外出办案民警返回所里确认后才能领人。直到晚8时多见到民警孙刚，他才将儿子接走。<br>
<br>
　　25日，小印住院治疗，医生诊断面部肿胀，伴有耳鸣、恶心、呕吐、胸部疼痛，全身多处软组织损伤。昨日，他的同学冀某证实，发生打架后，对方最后叫来了穿便衣的警察，把小印带走了。<br>
<br>
　　昨日下午，庄里派出所副所长马向锋表示，办案民警和主管领导都不在，要等周一上班才能了解情况。但此时来所里寻找孩子书包的小印的父亲，却在楼道里遇见了孙刚。<br>
<br>
　　孙刚表示，自己是所里的协警，当日是接到小柯报警后，才和警长李某一同处警。经小柯确认后，民警将小印带回所里调查。“我带人上车，一扭头，报案人就
不见人影了。”孙刚否认自己曾动手打小印，并有同事可以作证，自己当时问过小印，想通知其家人，但小印说不出家人的电话。至于擦车，他说是小印主动要求擦
车的。后来他要出警，也就同意了。<br>
<br>
　　<strong>家人：处警记录是刚填的</strong><br>
<br>
　　记者询问调查笔录，孙刚表示要等到周一上班后看领导决定是否移交给谁主办此案，目前调查笔录还没做。在值班室，宣传栏上原先公布的孙刚的照片、警员职
务、联系电话，也变成了空白。记者翻阅当日的处警记录，上面的记载只有几句，只有小印父亲的电话，并无小柯的联系电话，小印的家属认定“这个记录是刚刚填
写上去的”。孙刚称小柯也是庄里镇初中学生，当日也没留联系电话，至今联系不上，并否认自己认识其或与其有亲戚关系。<br>
<br>
　　小印家人表示，这个警察真会“自圆其说”。小印的母亲说，事发后，孙刚曾托中间人来医院探望说和遭拒绝。昨日上午，来了两名可能是县上某部门的男士，告诫小印家人不要“对外声张，扩大事态”。							
								</span></a>]]></description>
</item><item>
<title><![CDATA[我的第一份工作--上海贝尔 15. 吉首(一)]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=44883</link>
<author>zhoujianjun</author>
<pubDate>2009-4-16 16:22:17</pubDate>
<description><![CDATA[<a>　&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp; &nbsp;这次去的是吉首,吉首在湘西,建国初土匪多,有过湘西剿匪这一电视剧.<br>&nbsp;&nbsp; &nbsp;我先飞到武汉,还是先和武汉光电所的人汇合.这次还是小P和我合作,还带个年青的(比当时的我年青一点点,名字忘记了,就称他为小A吧),当晚就出发,坐火车去,不过先要到襄樊转车,因为买的是卧铺票,所以很舒服地在天刚亮的时候到了襄樊.在襄樊没多呆,只在车站旁小摊吃了顿早饭,买了张地图留念,就又坐上火车往南开了.估计要开一天,又没卧铺票,于是我们三个就聊天打牌玩.不小心我把我带的那几千块差旅费给拿出来了,当时很多人在看我们打牌,于是我就开始提心吊胆.本来就觉得内地不安全,这样更要时不时摸摸口袋了.<br>&nbsp;&nbsp; &nbsp;好不容易到了吉首,天都黑了,我更是一步不离开他(她)们,东张西望地看看是否给人盯上了.叫了车去邮电局,机房里还真有人在开局.还是老样子,一个在贝尔进行过A培的,再加两个本地机房的人(一男一女,都很年青).他们介绍我们去邮电招待所去住,我要了个最好的房间(那里真便宜,最好的房间也没用掉我报销额的一半),小P和小A只好去睡宿舍样的房间了.<br>&nbsp;&nbsp; &nbsp;第二天一大早我把钱存到邮政储蓄(总算安心了)后就和小P和小A去机房报到,RASM还没准备好,我们又有时间玩了,上午出去玩,中午去邮电局吃饭(当然免费,几乎顿顿有猪蹄吃).<br>&nbsp;&nbsp; &nbsp;湘西是少数民族的地方,不过他们基本上给同化了,一起开机的那几个大多是苗族,不过我们都看不出听不出来,一起吃饭聊天都不把他们当少数民族,他们自己也不觉得和我们有什么不同(如同回族,我认识几个回族的同学同事的,他们和我们的差别就是高考可以用少数民族身份加几分,猪肉和我们吃得一样多).不过上了街就可以看到头上缠着毛巾帽子的老人了,到了老城更多了.老城还是古色古香的,大石头和木头房子,街窄窄的,老是上下坡的(和电视里差不多).邮电局附近的新城就很现代了,和上海差不多了,路边有报廊,上面正介绍以前剿匪的故事,好象有个女匪头,最后给抓起来改恶从善了.也有商厦,衣服不便宜,逛的人也很少.<br>&nbsp;&nbsp; &nbsp;晚上去赶集,有很多小吃,便宜得很,吃了个饱.回到招待所,见到了和我住一个套间的一对老夫妇,他们是邮电部的退休干部,回来玩庆祝他们的结婚纪念日.没两天他(她)们就回去了,于是我就让小P和小A一起住过来,小P一间,小A和我一间,房钱一起付(我多点他们少点).<br>&nbsp;&nbsp; &nbsp;星期天,邮电局两个年青人就邀请我们一起去郊外旅游,一起坐公交去的,已经到了农村边上了,有苗族老人在一辆卡车旁休息,路边还有几头牛在吃草,我和小A还去逗一头小牛玩.最后我们来到一个小瀑布边的水潭旁,一起拍了张照片.傍晚要回去了,却发现没公交车了.还好有个技校来这里游玩,他们有车,于是我就上去说明了下情况并要求搭车去市里(没办法,其他人都不肯上去说),那个老师就让我们最后上车.</a>]]></description>
</item><item>
<title><![CDATA[做了个记账软件]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=44255</link>
<author>zhoujianjun</author>
<pubDate>2009-3-28 8:37:26</pubDate>
<description><![CDATA[
<P>做了个记账软件.</P>
<P>需要DOTNET2.5。</P>
<P>安装程序：<IMG src="http://www.blogger.org.cn/blog/images/file/zip.gif" border=0><A href="http://www.blogger.org.cn/blog/uploadfile/20093288342161.ZIP" target=_blank>mymoney.zip</A></P>
<P>文档：<IMG src="http://www.blogger.org.cn/blog/images/file/zip.gif" border=0><A href="http://www.blogger.org.cn/blog/uploadfile/200932883718200.ZIP" target=_blank>MyMoneyDoc.zip</A></P>]]></description>
</item><item>
<title><![CDATA[我的第一份工作--上海贝尔 14. 歧城]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=43482</link>
<author>zhoujianjun</author>
<pubDate>2009-3-4 14:09:17</pubDate>
<description><![CDATA[<a>　从安达回来后,把该报的都报销掉了,该赚的都赚好了(嗯,比工资多点),就又到饭厅去找一帮至今留守的兄弟们了.这种日子很久没过了,还真有点想念.不过没多久,C经理就又让我出差了,还是一个人去,这次去湖北的歧城.又一个我听都没听说过的小县城(这是由我们产品的性质决定的).后来回去查了下地图,这歧城可是重要的地方啊,地理位置好,在三峡口上,如果苏联和台湾联手一北一南打过来,最后会在这里汇合,所以那里存了不少过气的军用物资(想象的).歧城不但在长江边上,而且还有条南北向的铁路通过.当初我们南北向的大铁路线只有津沪线和京广线,后来有个姓将的英明将军,调查后说,将来日本打过来,津沪线和京广线都收不住,如果我们要在四川外站有一席之地,就一定要在山区里再修条铁路.后来津沪线和京广线果然都守不住了,这条通过歧城铁路可发挥大作用了.<br>&nbsp;&nbsp; &nbsp;说远了,不过当时了解了这些情况后,我可是兴冲冲的去的.首先是去软测组打电话给武汉的W总工,让他派车来接我,本想着凭我们在安达的交情(我借了本书给他看),这不成问题,不过人家可没理睬我,说让我自己打的去.自己打的就自己打,又不是没得报销.不过武汉那机场太破了,比火车站还不如呢,出租车也很少,好容易上了车,人家还不开,等司机又招了两个人的生意才开车.<br>&nbsp;&nbsp; &nbsp;车过长江大桥,司机指着对岸一高楼说,那是武汉一高,本来上面有一外国香烟的广告,后来来了卫生部长,说你们不把那广告下下来,就撤你们卫生城市的帽子,所以就下下来了,不过陪了不少钱(那时代对着广告特别在意,广州上了日本公司的广告牌,就被人说成广州又沦陷了).那车七怪八拐花了很长时间才把我送到目的地-武汉光电所,问我要一百多块,甩给我两百多的票,大家心照不宣,一人赚一比吧.<br>&nbsp;&nbsp; &nbsp;找到了W总,他把我安排在集体宿舍里,说贵宾楼在装修.然后给我接风,就在湖边一餐厅吃饭,问我要吃什么,我读过老毛的诗,记得有个武昌鱼的东西,就说要吃那(纯粹开开玩笑,想着不会有那鱼吧,既然人家已经进入了老毛的诗,成了名鱼).W总却当真,脸色不自然地要菜单,看完后说现在没这鱼,下次给我吃吧(看样子,十有八九是价钱太贵).<br>&nbsp;&nbsp; &nbsp;回到宿舍才发现又乱又脏,勉强睡一晚,一大早就退房搬家.武汉从没来过,只好找个电话厅翻黄页找旅馆,然后打电话问价格,问了个刚好用完我报销额度的,就坐BUS去了.那时候,我还太嫰,还不能象&lt;二子开店&gt;里的旅客进门就问"开票吗?",所以只好把报销额度都用光,不便宜公司.那旅馆不怎么样,房间很旧,也赃,不过有厕所和洗澡的.安定下来,就打电话给W总联系去歧城的事情,他说他们现在还派不出人手,让我等.我只好等,给一起坐班车上下班的老C的姐夫打了电话,让他来取老C给他们的东西.结果姐姐和姐夫一起来了,姐夫是个学校老师,要和我聊天,滔滔不绝地讲了二个多小时.<br>&nbsp;&nbsp; &nbsp;第二天开始逛武汉,当然先去看黄鹤楼咯,结果去了没看到啥么特别的,毫无印象.就这么混了一星期,小P来电话了,说这次还是她和我合作,一起去的还有位老X(有点年纪了,估计是保镖的作用),票已买好了,是坐船(后来给经理臭骂一顿,说公司不让坐船),想这可以慢悠悠地逛长江和三峡了.结果晚上仓里太热,只好到船桥去打地铺,又给蚊子咬个半死.最后总算看到了三峡大坝(还在修),体验了下船是如何被一节一节地象坐电梯一样被抬上去的滋味.<br>&nbsp;&nbsp; &nbsp;坐了两天船后到了歧城码头,坐了当地的电动三轮车往城里去,到了城里已经是快半夜了,不管三七二十一往邮电局闯,叫来项目负责人给我们接风.老X讨出一把皱皱的发票,说是坐三轮车的费用,要报销.<br>&nbsp;&nbsp; &nbsp;这次工作挺顺利没出什么问题,很快就完成了,给留了几天,成天打牌(一种武汉的玩法--&lt;跑得快&gt;).回去的时候,我再也不愿意坐船了,按邮电局里的人的指导,买了夜间BUS票,一路睡回武汉.然后在武汉找旅馆(这次在市中心,也很赃乱),买飞机票,等飞机的几天又逛了逛武汉,细节记不起来了,很多事都忘了.<br>&nbsp;&nbsp; &nbsp;回到上海因为坐船的事给训了顿,大概就是从那时候起,我开始心存异心,决定一定要跳槽.</a>]]></description>
</item><item>
<title><![CDATA[How to use Linq and SQL Compact 3.5]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=43273</link>
<author>zhoujianjun</author>
<pubDate>2009-2-25 15:47:33</pubDate>
<description><![CDATA[<a>　本贴转自http://developers.ie/ShowArticle.aspx?id=c506c27e-8566-4db9-bb95-7a4689c2550c</a><h1 id="HeaderArticle">
        <span id="ctl00_LeftColumn1_ArticleTitle">How to use Linq and SQL Compact 3.5?</span></h1>
    <div id="subcol" style="width: 250px;">
        <a href="http://developers.ie/Articles.aspx" class="noline">
            <img src="http://developers.ie/images/back2.gif" alt="Back to the list of articles" border="0" width="40" height="40"></a>&nbsp;
        <a href="http://developers.ie/PrintArticle.aspx?id=c506c27e-8566-4db9-bb95-7a4689c2550c" id="ctl00_LeftColumn1_ButPrint" class="noline" target="Print">
            <img src="http://developers.ie/images/bt_print2.gif" alt="Printer Friendly" width="40" height="40"></a>&nbsp; <a href="http://developers.ie/emailfriend.aspx?height=500&amp;width=500&amp;id=c506c27e-8566-4db9-bb95-7a4689c2550c" id="ctl00_LeftColumn1_ButEmailFriend" class="thickbox noline" title="Send to a Friend">
                <img src="http://developers.ie/images/devguy.gif" width="40" height="40"></a>&nbsp;<a href="http://developers.ie/commentsarticle.aspx?height=500&amp;width=550&amp;id=c506c27e-8566-4db9-bb95-7a4689c2550c&amp;TB_iframe=true" id="ctl00_LeftColumn1_ButComments" title="Comments" class="thickbox noline">
                    <img src="http://developers.ie/images/comment.gif" alt="comments" width="40" height="40"></a>&nbsp;<a href="http://developers.ie/ShowArticle.aspx?id=c506c27e-8566-4db9-bb95-7a4689c2550c#" class="noline">&nbsp;</a><a href="http://developers.ie/SubmitArticle.aspx" class="noline"><img src="http://developers.ie/images/email.gif" alt="Submit an article" width="40" height="40"></a>
                        <!-- END #subcol -->
    </div>
    <!-- BEGIN #maincol -->
    
        <!--[if IE]>
<P><![if !IE]><![endif]-->
        <p>
            <!--[if IE]><![endif]><![endif]-->
            By
            <span id="ctl00_LeftColumn1_ArticleAuthor">Peter Fenyvesi</span>
            -
            <span id="ctl00_LeftColumn1_ArticlePosted" style="font-size: 8pt;">05/02/2008</span>
            -
            <img src="http://developers.ie/images/rate.gif" align="absmiddle"><img src="http://developers.ie/images/rate.gif" align="absmiddle"><img src="http://developers.ie/images/rate.gif" align="absmiddle"><img src="http://developers.ie/images/rate.gif" align="absmiddle"><img src="http://developers.ie/images/rate.gif" align="absmiddle">
            <span id="ctl00_LeftColumn1_NbComments"></span>
            <br>
            <br>
            </p><p style="background-color: rgb(238, 238, 238);">
                <b>Summary:</b><br>
                <span id="ctl00_LeftColumn1_ArticleSummary">Summary:
This walkthrough gives a quick overview on how to use .NET
Language-Integrated Query (LINQ) to retrive and manipulate realtional
data. It also demonstrates some of the new features of SQL Compact 3.5
which is used as the relational engine in this example. We were really
excited when we’ve heard about Linq because it can fill the gap that
SQL Compact’s lack of stored procedure support exposes. And of course
many more (11 printed pages)
</span></p>
        
        <p class="GraySeparator" align="right">
            <b>Rate this article: </b>
            <span id="ctl00_LeftColumn1_brating"><input id="ctl00_LeftColumn1_brating_0" name="ctl00$LeftColumn1$brating" value="1 " type="radio"><label for="ctl00_LeftColumn1_brating_0">1 </label><input id="ctl00_LeftColumn1_brating_1" name="ctl00$LeftColumn1$brating" value="2 " type="radio"><label for="ctl00_LeftColumn1_brating_1">2 </label><input id="ctl00_LeftColumn1_brating_2" name="ctl00$LeftColumn1$brating" value="3 " type="radio"><label for="ctl00_LeftColumn1_brating_2">3 </label><input id="ctl00_LeftColumn1_brating_3" name="ctl00$LeftColumn1$brating" value="4 " type="radio"><label for="ctl00_LeftColumn1_brating_3">4 </label><input id="ctl00_LeftColumn1_brating_4" name="ctl00$LeftColumn1$brating" value="5 " type="radio"><label for="ctl00_LeftColumn1_brating_4">5 </label></span>
            <input name="ctl00$LeftColumn1$SubmitRating" value="Rate it" id="ctl00_LeftColumn1_SubmitRating" type="submit"></p>
        <span id="ctl00_LeftColumn1_ArticleBody" class="std" style="font-family: Verdana,Arial,Helvetica; font-size: 10pt;"><div style="margin: 12pt 0cm 3pt;"><strong><font size="6"><font face="Arial">How to use Linq and SQL Compact 3.5?</font></font></strong></div>
<p>&nbsp; </p>
<h1><a name="_Toc188980914"></a><a name="_Toc188980759"><span style=""><span style="" lang="EN-IE">How to use Linq and SQL Compact 3.5?</span></span></a><span style="" lang="EN-IE"><o:p></o:p></span></h1>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">Peter Fenyvesi, Damien Noonan, Tom McArdle<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">January 2008<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-IE">Applies to:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"><span style="font-family: Symbol;" lang="EN-IE"><span style="">·<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="" lang="EN-IE">Visual Studio 2008 Code Name "Orcas"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"><span style="font-family: Symbol;" lang="EN-IE"><span style="">·<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="" lang="EN-IE">.Net Framework 3.5<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"><span style="font-family: Symbol;" lang="EN-IE"><span style="">·<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="" lang="EN-IE">SQL Compact 3.5<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><strong style=""><span style="" lang="EN-IE">Summary</span></strong><span style="" lang="EN-IE">:
This walkthrough gives a quick overview on how to use .NET
Language-Integrated Query (LINQ) to retrive and manipulate realtional
data. It also demonstrates some of the new features of <span style="">&nbsp;</span>SQL Compact 3.5 which is used as the relational engine in this example. <br>
We were really excited when we’ve heard about Linq because it can fill
the gap that SQL Compact’s lack of stored procedure support exposes.
And of course many more (11 printed pages)</span><span style="font-size: 12pt; line-height: 150%; font-family: 'Times New Roman';" lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoToc2" style=""><span class="MsoHyperlink"><span style="" lang="EN-GB"><a href="http://www.developers.ie/fckeditor/editor/fckeditor.html?InstanceName=ArtText&amp;Toolbar=Default#_Toc188980915"><span style="" lang="EN-IE">SQL Compact</span></a></span></span><span style="font-size: 12pt; font-family: 'Times New Roman';" lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoToc2" style=""><span class="MsoHyperlink"><span style="" lang="EN-GB"><a href="http://www.developers.ie/fckeditor/editor/fckeditor.html?InstanceName=ArtText&amp;Toolbar=Default#_Toc188980916"><span style="" lang="EN-IE">Linq</span></a></span></span><span style="font-size: 12pt; font-family: 'Times New Roman';" lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoToc2" style=""><span class="MsoHyperlink"><span style="" lang="EN-GB"><a href="http://www.developers.ie/fckeditor/editor/fckeditor.html?InstanceName=ArtText&amp;Toolbar=Default#_Toc188980917"><span style="" lang="EN-IE">Project setup</span></a></span></span><span style="font-size: 12pt; font-family: 'Times New Roman';" lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoToc2" style=""><span class="MsoHyperlink"><span style="" lang="EN-GB"><a href="http://www.developers.ie/fckeditor/editor/fckeditor.html?InstanceName=ArtText&amp;Toolbar=Default#_Toc188980918"><span style="" lang="EN-IE">Database access</span></a></span></span><span style="font-size: 12pt; font-family: 'Times New Roman';" lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoToc2" style=""><span class="MsoHyperlink"><span style="" lang="EN-GB"><a href="http://www.developers.ie/fckeditor/editor/fckeditor.html?InstanceName=ArtText&amp;Toolbar=Default#_Toc188980919"><span style="" lang="EN-IE">Refinements</span></a></span></span><span style="font-size: 12pt; font-family: 'Times New Roman';" lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoToc2" style=""><span class="MsoHyperlink"><span style="" lang="EN-GB"><a href="http://www.developers.ie/fckeditor/editor/fckeditor.html?InstanceName=ArtText&amp;Toolbar=Default#_Toc188980920"><span style="" lang="EN-IE">And this is where the fun begins</span></a></span></span><span style="font-size: 12pt; font-family: 'Times New Roman';" lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoToc2" style=""><span class="MsoHyperlink"><span style="" lang="EN-GB"><a href="http://www.developers.ie/fckeditor/editor/fckeditor.html?InstanceName=ArtText&amp;Toolbar=Default#_Toc188980921"><span style="" lang="EN-IE">Summary</span></a></span></span><span style="font-size: 12pt; font-family: 'Times New Roman';" lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><o:p>&nbsp;</o:p></span></p>
<h2><a name="_Toc188980915"></a><a name="_Toc188980760"><span style=""><span style="" lang="EN-IE">SQL Compact</span></span></a><span style="" lang="EN-IE"><o:p></o:p></span></h2>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">SQL
Compact Edition (SQL CE)is a slimmed down version of the SQL server
family. It can run on a low-end PC or even on a PDA. The database
engine’s footprint is really tiny (2Mb) and though provides only very
basic sql functionality, there were important improvements here as well
in the 3.5 release. This version is shipped with VS2008, but available
as a separate, free download as well. Now for example we can use
subqueries or we can define foreign key constraints on a graphical user
interface and do not have to write sql statements for this type of
task. There are still a lot of limitations there compared e.g. to
SQLExpress, but the target here is quite different. I think of SQL CE
as a very reliable, tiny, relational alternative to text files and
simple spreadsheets. And indeed, in the real word we used SQL CE to
replace modules of older applications where simple text files were
used. But even if SQL CE provides much more functionality then a simple
text file, sooner or later the lack of stored procedures would cause
headaches.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">And
this is where Linq comes into play. Up until now, working with SQL CE
meant to work with nasty embedded SQL statements which always made me
uncomfortable. Using SP’s were the preferred way of doing things, so we
were a bit reluctant to go back to the embedded SQL spaghetti. But up
until now we had no choice.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">With Linq the things are quite different. <o:p></o:p></span></p>
<h2><a name="_Toc188980916"></a><a name="_Toc188980761"><span style=""><span style="" lang="EN-IE">Linq</span></span></a><span style="" lang="EN-IE"><o:p></o:p></span></h2>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">Linq
stands for “Language Integrated Query”. This means that you can write
SQL-ish C# (or VB) code, to query and modify data. “Data” basically
means any kind of data – not limited to databases, but including
objects, xml, ect. To keep focus, I just want to give a brief
introduction on “Linq to SQL” and will not cover the rest in this
article (Linq to XML, Linq to object).<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">So
in our walk-through article we’ll create a tiny desktop application
that will store some records about the department’s MSDN disks in a SQL
Compact database. The app will use Linq to SQL to access and modify the
data in the database. This small internal project meant to address the
problem that the management of our huge amount of heavily used MSDN
disks expose (what exactly do we have, who borrowed, what, when, when
is that due back, etc). Some kind of DVD inventory.<o:p></o:p></span></p>
<h2><a name="_Toc188980917"></a><a name="_Toc188980762"><span style=""><span style="" lang="EN-IE">Project setup</span></span></a><span style="" lang="EN-IE"><o:p></o:p></span></h2>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">First of all let’s create a new Windows Forms application called MSDNDB. Let’s add a local database (SQL CE 3.5) to the project:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><v:shape id="_x0000_i1025" style="width: 387pt; height: 243.6pt;" type="#_x0000_t75"><v:imagedata o:title="01_sdf" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image001.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">When
this is added, the “Data Source Configuration Wizard” appears, as
Visual Studio assumes, we want to add a dataset as well to the project.
Since we do not, just cancel the dialog.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">Instead,
open the new database file in server explorer and let’s add the
required tables to it. We’ll need a table to store some details about
the MSDN DVD’s…<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1026" style="width: 387.6pt; height: 327pt;" type="#_x0000_t75"><v:imagedata o:title="04_db" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image003.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">…and an other one for the categories.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1027" style="width: 387.6pt; height: 323.4pt;" type="#_x0000_t75"><v:imagedata o:title="05_db" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image005.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">Once
it’s done, we can define the relationships between the two tables. As I
mentioned before, now foreign-key constraints can be defined on a GUI,
which is new in VS2008.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1028" style="width: 387pt; height: 302.4pt;" type="#_x0000_t75"><v:imagedata o:title="06_FK" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image007.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">To complete the initial database we can add a couple of categories to the corresponding table.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1029" style="width: 387.6pt; height: 243.6pt;" type="#_x0000_t75"><v:imagedata o:title="07_Category" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image009.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<h2><a name="_Toc188980918"></a><a name="_Toc188980763"><span style=""><span style="" lang="EN-IE">Database access</span></span></a><span style="" lang="EN-IE"><o:p></o:p></span></h2>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">Well,
Linq. At first people would think that by adding a dbml file to the
project and dragging’n’dropping the required tables from server
explorer would work. And it does with SQLExpress and with the bigger
editions, but wouldn’t with SQL CE. If you have a try, you’ll get a
“The selected object(s) use an unsupported data provider.” error as you
can see below.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1030" style="width: 387pt; height: 243pt;" type="#_x0000_t75"><v:imagedata o:title="08_dbml" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image011.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1031" style="width: 387pt; height: 243pt;" type="#_x0000_t75"><v:imagedata o:title="09_dbml" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image013.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">But
fortunately Microsoft provides a nice little tool called SQLMetal that
can help to solve the problem. This command-line utility can be used to
generate the dbml file we need from any sort of database, including the
SQL Compact edition. This could generate strait the CS codefile as
well, but once we’ve got the dbml, that can be added to the project and
Visual Studio can handle the rest.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">So just execute <o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%; font-family: 'Lucida Console';" lang="EN-IE">"C:\Program
Files\Microsoft SDKs\Windows\v6.0A\Bin\sqlmetal" /conn:"Data
Source=C:\Work\MS\MSDNDB\MSDNDB.sdf" /dbml:MSDNDB.dbml
/provider:SQLCompact<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">from
the command prompt and add the dbml to the project. You’ll see
immediately as the MSDNDB.designer.cs appears which is the generated CS
code for the database tables. This contains the mapping between the
.net objects and the SQL tables, between the object properties and
table columns and serves as the source for IntelliSense to show column
names, relations, etc when writing Linq expressions.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">Here
you have to change the Inheritance Modifier to none. Without this the
generated class would be abstract, so we would need to inherit our own
from that, but in this simple scenario this is not necessary. It is
also advisable to change the name property, which is the name of the
DataContext class. By default it contains the full path to the sdf
file, like: “C__Work_MS_MSDNDB_MSDNDB_Sdf”.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1032" style="width: 441pt; height: 266.4pt;" type="#_x0000_t75"><v:imagedata o:title="11_dbml" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image015.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">You
might have noticed by now the way the new ctrl+tab works in Visual
Studio 2008. Now instead of purely showing the names of the open files
that are in various windows, you can even see the window’s content as a
small screenshot which makes navigation between the open windows much
easier.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1033" style="width: 440.4pt; height: 267pt;" type="#_x0000_t75"><v:imagedata o:title="16_ctrl+tab" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image017.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">At
this stage we’re ready to drop a DataGridView onto our form, anchor it
to the 4 sides of the form and write a few lines of code to make it a
working application!<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1034" style="width: 441pt; height: 266.4pt;" type="#_x0000_t75"><v:imagedata o:title="12_form" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image019.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">In
the code file create a member variable with the type of our own
DataContext. This will be responsible for all the interaction with the
database, including opening the connection to it, executing commands,
etc.<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> </span><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">&lt;summary&gt;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> the Linq.DataContext instance which helps to track changes <o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> we make on records and generates the<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> correct SQL statements to persist those changes into the database.<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> </span><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">&lt;/summary&gt;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: blue; font-family: 'Courier New';" lang="EN-GB">private</span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"> <span style="color: rgb(43, 145, 175);">MSDNDB</span> db;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">Since </span><span style="font-size: 10pt; line-height: 150%; font-family: 'Courier New';" lang="EN-GB">DataContext</span><span style="line-height: 150%;" lang="EN-IE"> works with database, it implements </span><span style="font-size: 10pt; line-height: 150%; font-family: 'Courier New';" lang="EN-GB">IDisposable</span><span style="line-height: 150%;" lang="EN-IE"> to clean up all the resources at the end of it’s lifecycle. So we should respect this and should call </span><span style="font-size: 10pt; line-height: 150%; font-family: 'Courier New';" lang="EN-GB">Dispose()</span><span style="line-height: 150%;" lang="EN-IE"> at the right time. The easiest way to do this is to move the form’s </span><span style="font-size: 10pt; line-height: 150%; font-family: 'Courier New';" lang="EN-GB">Dispose</span><span style="line-height: 150%;" lang="EN-GB"> </span><span style="line-height: 150%;" lang="EN-IE">function
from the MediaList.Designer.cs file into the MediaList.cs (so Visual
Studio will never overwrite our changes) and add the two highlighted
lines to it.<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> </span><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">&lt;summary&gt;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> Clean up any resources being used.<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> </span><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">&lt;/summary&gt;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> </span><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">&lt;param name="disposing"&gt;</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB">true if managed resources should be disposed; otherwise, false.</span><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">&lt;/param&gt;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: blue; font-family: 'Courier New';" lang="EN-GB">protected</span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"> <span style="color: blue;">override</span> <span style="color: blue;">void</span> Dispose(<span style="color: blue;">bool</span> disposing)<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">{<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">if</span> (disposing &amp;&amp; (components != <span style="color: blue;">null</span>))<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>components.Dispose();<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p>
<p class="MsoNormal" style=""><strong style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">if</span> (disposing)<o:p></o:p></span></strong></p>
<p class="MsoNormal" style=""><strong style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>db.Dispose();<o:p></o:p></span></strong></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">base</span>.Dispose(disposing);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">To just grab all the data from the tblMSDN table and display that in a grid is really simple. Add the 3 lines below to the </span><span style="font-size: 10pt; line-height: 150%; font-family: 'Courier New';" lang="EN-GB">MediaList_Load</span><span style="line-height: 150%;" lang="EN-IE"> method:<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB">//Specify the connection string for the DataContext's constructor.<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB">//The "Data Source" is the path to the sdf file, which in this <o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB">//case should be the in the same folder as the exe.<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">db = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">MSDNDB</span>(<span style="color: rgb(163, 21, 21);">"Data Source=MSDNDB.sdf"</span>);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB">//At first just grab all the data from the tblMSDN table.<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB">//This is probably the simplest Linq expression.<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: blue; font-family: 'Courier New';" lang="EN-GB">var</span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"> q = db.TblMSDN.AsQueryable&lt;<span style="color: rgb(43, 145, 175);">TblMSDN</span>&gt;();<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB">//Bind it to the grid<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: blue; font-family: 'Courier New';" lang="EN-GB">this</span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">.dataGridView1.DataSource = q;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">If you even call </span><span style="font-size: 10pt; line-height: 150%; font-family: 'Courier New';" lang="EN-GB">SubmitChanges</span><span style="line-height: 150%;" lang="EN-IE">
after the row was changed and validated, you should have a working
application that supports adding, updating and deleting records.<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> </span><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">&lt;summary&gt;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> When a record was changed, let's call the SubmitChanges <o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> method and let Linq to generate and execute the SQL statement<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> required to persist the data into the database<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">///</span><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB"> </span><span style="font-size: 10pt; color: gray; font-family: 'Courier New';" lang="EN-GB">&lt;/summary&gt;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: blue; font-family: 'Courier New';" lang="EN-GB">private</span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"> <span style="color: blue;">void</span> dataGridView1_RowValidated(<span style="color: blue;">object</span> sender, <span style="color: rgb(43, 145, 175);">DataGridViewCellEventArgs</span> e)<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">{<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>db.SubmitChanges();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">}</span><span style="" lang="EN-IE"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">So try to build and run it! <o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">Well, if you’re on a 64 bit OS, you’ll run into an issue. Namely “Provider ‘System.Data.SqlServer.Ce.3.5’ not installed”.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1035" style="width: 306.6pt; height: 73.8pt;" type="#_x0000_t75"><v:imagedata o:title="13_NotInstalled" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image021.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">This
can be a bit misleading, but basically this is because SQLCE is not
supported on 64 bit OS. You can easily overcome this by targeting only
the x86 platform. The form is available from the solution properties or
from the toolbar.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1036" style="width: 387.6pt; height: 256.8pt;" type="#_x0000_t75"><v:imagedata o:title="14_config" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image023.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">So at this stage we’ve got a working application which can create, read, update and delete database records!<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1037" style="width: 386.4pt; height: 144.6pt;" type="#_x0000_t75"><v:imagedata o:title="15_app" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image025.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<h2><a name="_Toc188980919"></a><a name="_Toc188980764"><span style=""><span style="" lang="EN-IE">Refinements</span></span></a><span style="" lang="EN-IE"><o:p></o:p></span></h2>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">To make our little application a bit more user-friendly, let’s define the columns and the column types in the grid first.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE"><v:shape id="_x0000_i1038" style="width: 512.4pt; height: 330pt;" type="#_x0000_t75"><v:imagedata o:title="17_Columns" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image027.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">Here we can use Linq to SQL again to populate the “category” dropdown list. To do this extend the </span><span style="font-size: 10pt; line-height: 150%; font-family: 'Courier New';" lang="EN-GB">MediaList_Load</span><span style="line-height: 150%;" lang="EN-IE"> method with:<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB">//Populate the dropdown list<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: rgb(43, 145, 175); font-family: 'Courier New';" lang="EN-GB">DataGridViewComboBoxColumn</span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"> col = <o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>(<span style="color: rgb(43, 145, 175);">DataGridViewComboBoxColumn</span>)(<span style="color: blue;">this</span>.dataGridView1.Columns[<span style="color: rgb(163, 21, 21);">"CategoryId"</span>]);<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: blue; font-family: 'Courier New';" lang="EN-GB">var</span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"> qCat = db.TblCategory.AsQueryable();<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">col.DataSource = qCat;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">col.ValueMember = <span style="color: rgb(163, 21, 21);">"CategoryId"</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">col.DisplayMember = <span style="color: rgb(163, 21, 21);">"Category"</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">And since now we specified the columns manually, we should disable the automatic generation of columns, like this:<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: green; font-family: 'Courier New';" lang="EN-GB">//Bind it to the grid<o:p></o:p></span></p>
<p class="MsoNormal" style=""><strong style=""><span style="font-size: 10pt; color: blue; font-family: 'Courier New';" lang="EN-GB">this</span></strong><strong style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">.dataGridView1.AutoGenerateColumns = <span style="color: blue;">false</span>;<o:p></o:p></span></strong></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: blue; font-family: 'Courier New';" lang="EN-GB">this</span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">.dataGridView1.DataSource = q;<o:p></o:p></span></p>
<h2><a name="_Toc188980920"></a><a name="_Toc188980765"><span style=""><span style="" lang="EN-IE">And this is where the fun begins</span></span></a><span style="" lang="EN-IE"><o:p></o:p></span></h2>
<p class="MsoNormal"><span style="" lang="EN-IE">Now we’ve got a working skeleton application. It’s time to add more stuffs to it and explore the capabilities of Linq!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-IE">For example I’ve added a </span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">textBoxBarCode</span><span style="" lang="EN-IE"> and a </span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">buttonRefresh</span><span style="" lang="EN-IE"> controls to the form to add optional filtering capability. I also added the following method which is called from both the </span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">buttonRefresh_Click</span><span style="" lang="EN-IE"> and from the </span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">MediaList_Load</span><span style="" lang="EN-IE"> event handlers.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-IE"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; color: blue; font-family: 'Courier New';" lang="EN-GB">private</span><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"> <span style="color: blue;">void</span> PopulateGridView()<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">{<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: green;">//Select all the records<o:p></o:p></span></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">var</span> q = <span style="color: blue;">from</span> m <span style="color: blue;">in</span> db.TblMSDN<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">select</span> m;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: green;">//add a filter by BarCode, if this criteria was specified.<o:p></o:p></span></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">if</span> (textBoxBarCode.Text != <span style="color: rgb(163, 21, 21);">""</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>q = <span style="color: blue;">from</span> m <span style="color: blue;">in</span> q<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">where</span> m.BarCode == textBoxBarCode.Text<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">select</span> m;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: green;">//add ordering to the query<o:p></o:p></span></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>q = <span style="color: blue;">from</span> m <span style="color: blue;">in</span> q<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">orderby</span> m.MSDNId<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">select</span> m;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: green;">//Bind it to the grid<o:p></o:p></span></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">this</span>.dataGridView1.AutoGenerateColumns = <span style="color: blue;">false</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">this</span>.dataGridView1.DataSource = q;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: 'Courier New';" lang="EN-GB">}</span><span style="" lang="EN-IE"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-IE"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-IE">I’m sure you can add more filters and other features form here by yourself.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-IE"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-IE">So with Linq you can
select, filter, order, shape the data the same way as you would do in a
stored procedure, but with the added benefit of the intellisense and
compile-time check support. So in a where clause for example, you can
just select the available fields from a list and you do not have to
type in the column names. Also, the fields are strongly typed and the
expressions are validated at compile time – just to name a few benefits.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-IE"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-IE"><v:shape id="_x0000_i1039" style="width: 333.6pt; height: 235.8pt;" type="#_x0000_t75"><v:imagedata o:title="18_IntelliSense" src="file:///C:%5CDOCUME%7E1%5CPETER%7E1.FEN%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image029.png"></v:imagedata></v:shape><o:p></o:p></span></p>
<h2><a name="_Toc188980921"></a><a name="_Toc188980766"><span style=""><span style="" lang="EN-IE">Summary</span></span></a><span style="" lang="EN-IE"><o:p></o:p></span></h2>
<p class="MsoNormal" style="margin: 6pt 0cm 12pt; line-height: 150%;"><span style="line-height: 150%;" lang="EN-IE">In
this little walk-trough we’ve tried to demonstrate how Linq and SQL
Compact can be used from Visual Studio 2008 to build database-driven
applications. Obviously this article only scratched the surface and
just tried to wet your appetite. You can find a lot of other Linq
examples and more specific documentations in MSDN.</span></p></span>]]></description>
</item><item>
<title><![CDATA[SQLSERVER中的ROW LOCK]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=43086</link>
<author>zhoujianjun</author>
<pubDate>2009-2-17 15:34:49</pubDate>
<description><![CDATA[<a>　如果要在SQLSERVER中使用ROWLOCK（select 。。。from xxxTABLE with（rowlock，updlock？）WHERE 。。。），则必须在</a><a>xxxTABLE上建立包含</a><a>WHERE语句中FIELD的INDEX，否则结果不是ROWLOCK而是TABLOCK（表的LOCK）。</a>]]></description>
</item><item>
<title><![CDATA[我的第一份工作--上海贝尔 13. 安达（四）]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=41679</link>
<author>zhoujianjun</author>
<pubDate>2008-12-11 13:00:18</pubDate>
<description><![CDATA[&nbsp;&nbsp;&nbsp; 在安达时间呆长了,公司那里终于熬不住了,CH经理要大驾光临了.那天邮电局派了辆车给我去哈尔滨机场接他,毕竟身份不同嘛.接到后,在回来的路上,我就向他汇报了我来的时候错过航班的事,想问他这个退票手续费是否可以报销,结果给他拉长脸训了顿.<br>&nbsp;&nbsp;&nbsp; 到了安达,C工就请我们这帮人一起吃饭.吃饭时,旁桌那帮人突然过来敬酒,说他们刚谈成了笔生意,高兴.靠,东北人就这么豪放?<br>&nbsp;&nbsp;&nbsp; 我想讨好CH经理,就问他是否要住宾馆,他说不用,我就安排他和我们一起住住招待所.第二天起来,我去他房间找他,发现没人,就去了机房,发现他一人正忙着搞呢.见了我,对我说,他早上醒来以为他的同房是我,就把他叫醒,结果给人臭了一顿,后来一个人来机房也找不到人帮忙,就自己开始测试,现在快完了.CH经理是硬件测试出身,所以没多久就把有问题的部分的硬件都测试了便.可惜问题不在硬件部分(这个我们早就知道了,因为进行过了替换实验),他也没啥别的办法了,于是他就要回上海了,说到了上海再想办法,还是把我押在这里.邮电局的看他没解决问题,也就没心情派车送他了,只好由我送他去火车站,开车前我对他说,请快点把我救出去.<br>&nbsp;&nbsp;&nbsp; CH经理回上海后没把我忘记,没几天来了电话,说需要调试下软件,说是可以通过电话线接MODEM来调试.我就问C工要,C工说没有,大W就发火了,臭了C工几句,C工就满肚子不高兴地去问局里的其他人借.借来后,大W就装上,上海那边由我们组里的小CH来调试软件.调试了一个多小时,问题就发现了,是数据包给改动过了,改回后就解决问题了.因为那个数据包是小W负责的,大W这个气啊,马上打电话给小W,骂他没事乱改啥数据.<br>&nbsp;&nbsp;&nbsp; 好了,问题终于解决了,大家都很高兴,全不理会自己为啥这么废物.他们局里也好交差了,对人民的承诺也对线了.我也急着回去了,不过C工让我等等,说局里要开会.我可不管这个,他们开会没啥好事,无非要追究延期责任,这又不是我的责任,而且还是我们公司给解决的,就让大W一个人去抗吧.于是第二天一早我就和他们说我要走了,C工急匆匆的从局长会议室赶过来,一见面就臭我,你不等我就走啦,你还想要不要开发票报销啦(很是内行,既狠又准,我们出差就是图点虚发票赚点小钱).于是他带我先去邮政储蓄取我存的钱,仿佛他不去我就没得取的样子,不过确实可以不用排队,而且取出来都是百元大钞.接着又带我去招待所结帐,我让他们按我可以报销的上限开(连同陈经理那几天的我也一起赚了),不过C公要我付200块伙食费(我们的伙食的确全由他们负责,本来以为是他们请客的),我借口说刚开始的时候我没和他们一起吃,只给了他100块.<br>&nbsp;&nbsp;&nbsp; 最后我去机房道别,大W听说伙食费的事,就骂C公过河拆桥,里子面子都要.最后C公说他如果来上海一定去公司找我,我也客气了几句.<br>&nbsp;&nbsp;&nbsp; 坐火车到了哈尔滨,不认识路,就打车去机场,那个远啊,当时已经三伏天了,想想我来的时候还要穿皮衣呢,那车也没空调,看着满大街光帮子的行人,我也想脱了.到了机场,靠,车费都快赶上机票钱了,不过人家司机看都没看就扔给我一本发票,说肯定够,我也就没说话了.那个时代,大家心照不宣,国家的钱大家一起赚.在机场当场买票,票价也贵死人,不过我一点不在乎.<br>&nbsp;&nbsp;&nbsp; 于是我就结束了这次慢长而有花费不非的出差回到了久违上海,钱虽然花了很多,不过这是相对我干的那点活来说,公司是不会在乎的,这只是公司这比生意赚的零头的零头而已.公司是高价把交换机卖给邮电局的,相当于一线1000元(90年代初的价格),邮电局的装机费是多少,大家应该知道.于是大家都赚到了钱,我赚点出差和虚发票的钱(我算了下,比工资还高呢,只是后来公司出纳小姐点我那本出租车发表本点到手酸;CH经理看到了也说钱真好赚,不过他看到我把他的住宿费也按最高价来报,还是脸黑了几秒钟才给我签字报销),用户最后买单,谁让他们是上帝呢,上帝有钱!]]></description>
</item><item>
<title><![CDATA[我的第一份工作--上海贝尔 12. 安达（三）]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=40989</link>
<author>zhoujianjun</author>
<pubDate>2008-11-4 14:47:50</pubDate>
<description><![CDATA[&nbsp;&nbsp;&nbsp;终于轮到我干活了(去接那几根线),工作的地方在离开安达两公里半的一个名叫两公里半地方(一个卫星居民点吧),我还有武汉的小P和小Z还有C工一起去.交通工具是三轮车,在上海被叫做黄鱼车的东西,大概旧上海用来送黄鱼的说,不过在交通工具不发达的以前也用来送高级的东西,比如我爸以前厂里开个电脑公司,就用它送计算机配件.说远了,我们四个花了1,2块钱雇了辆黄鱼车没多久就到了两公里半(还好没坐那里唯一的一条公交线,那BUS的发车间隔都快赶上北朝鲜的火车了了).<br>&nbsp;那时候正是三伏天,我们被晒得够呛,C工就请我们和值班的一起吃棒冰(那种土产的货),我和武汉的接好线和总局联系了下,那边二W说通了,我们就回去了.<br>&nbsp;等我们回到总局,二W又说不好了,其实是时断时续.于是我们就分析原因,武汉的两位小姐说他们的光纤机没问题,都测试过了,我说我就接那几根线会有啥问题(觉得自己很废物,既然有了问题错误不可能在我这里,我不是吃白饭的吗?不过我代表的公司最牛--上海贝尔,所以没人愿意得罪我),于是二W就面面相觑,因为他们负责的部分(软件测试)最复杂,不敢保证没问题.于是以后的几星期就变成二W工作,我和武汉二位小姐看热闹了(对了,小P很讨厌郭富成,认为他年纪一把还装小孩).不过二W怎么都查不出原因,估计二W技术上虽然比我厉害多了,可还是不牛.时间长了我和武汉二小姐就觉得无聊,于是在C工的建议下去大庆玩.<br>&nbsp;去大庆坐车就可以了,如同去郊县的距离.那时正是盛夏,看不出王铁人奋斗的环境,和南方没啥两样,不过环境很好,不脏,不象一个石油城市,挺富有的样子.我们一起去划了船(被二位小姐嘲笑上海人没力气),玩了飞镖游戏.<br>&nbsp;安达县开运动会了,都没去看,没啥好看的,不过大家都听到电信局长(大局长)把某月某日安达程控电话的扩容作为政绩来宣布.大W很不满意,就埋怨C工,说不是还没完成吗?谁能保证完成呢?(的确对客户很霸道,不过大家都是公对公,大地方来的就可以欺负小地方的)C工就两面受气.果然到了那天还是老样子,大局长决定硬性开通,把那时断时续的电话抛了出去,老百姓不答应,花了钱又不保证质量,大局长很生气就派二局长来机房教训我们.当时气氛很严肃,他们局里的没人敢说话,可我们又不怕他,也没顶他,于是他一屁股坐下,严肃地问了句:"怎么回事?"半天没人理睬,他又回去了.我不认识二局长,又后知后觉,等二W嘲笑二局长后才知道发生了什么事.<br>&nbsp;不过工程不能无限制拖下去,上海贝尔扔我个废物在东北倒满不在乎,人家可受不了.先是武汉那里来了个白头发W总来看看怎么回事,W总来了后就断定没他们的事,就让小P和小Z去大连玩几天,然后一个人在招待所里看我那本书,就是那本让我误点班机的书,说是很好看.过几天二位小姐兴奋地回来,W总就带她们回武汉了.<br>&nbsp;又过了几天,哈尔滨工程公司的领导也来了,不过没和我见面,我只听见大W在招待所里用电话向他是啊是啊地汇报工作,扔下电话就破口大骂,说他个狗屁领导什么都不会,现在一个人住宾馆呢.我就安慰他,说那宾馆我住过,一点不舒服,厕所老堵.大W的领导如愿以偿地没解决任何问题,不过把小W带走去开另一个局了,留下大W和我继续熬.<br>&nbsp;我于是搬去大W一个房间住,我们的脾气都变坏了,就哪C工出气,说他们局这不好那不好,可能引起现在这问题,不过老C年轻时去上海培训过步进制交换机,我们扯的太离线了他还是会反击的.C工还是知道我们火气大的,于是就请我们吃饭,看录像,买香烟(我不抽,所以都孝敬了大W),大概是怕我们再一走,他的工程就没人管了,他那个技术股股长的位置估计就完了.那时的环境,顾客真不是皇帝,工程人员才是呢.<br>&nbsp;招待所的厕所虽然没堵,不过浴缸却脏得不能用,我和大W都痒得难受,于是我就请大W去A旅馆,开了个房间洗澡.帐台的大妈知道我们来意后大是惊奇,很不理解,在我们走的时候说:"两位走好啊,下次要洗澡再来开房!"大W脸红得象猴屁股,不过我却一点没事,因为我反应太慢了吧.]]></description>
</item><item>
<title><![CDATA[中国的毒奶粉和日本的污染大米]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=40185</link>
<author>zhoujianjun</author>
<pubDate>2008-9-22 9:18:24</pubDate>
<description><![CDATA[<P>&nbsp;&nbsp;&nbsp; 最近有两条新闻上了日本报纸头条,那就是中国的毒奶粉和日本的污染大米。我对此做了下比较：</P>
<P>1。中国的毒奶粉是人为原因，谋材害命的。日本的污染大米，是把进口检查后不符合卫生标准而准备作为猪饲料的大米作为一般大米卖给百姓。</P>
<P>2。日本的污染大米到目前为止并未有人因此生病。中国已经有数万小孩就医，数个小孩失去了生命，还不知道有多少小孩会因此痛苦一辈子。</P>
<P>3。中国的毒奶粉公司老板在案发后先否认并称他的奶粉经过国家检验毫无问题，最后迫不得已才道歉。日本贩卖污染大米的公司老板已经自杀。</P>
<P>4。中国政府到目前为止无人为此道歉下台，总理放出不追求默视人民的经济增长，惩治凶犯的豪言壮语，典型的在尸体上插红旗，美化悲剧，逃避责任，以前你干嘛去了？干嘛不好好检查食品？人民过去现在都在被漠视，将来也会被漠视。日本的卫生部长开始也是拖脱责任，现在被迫辞职。日本的卫生部长是换得最勤的，一有食品事件，十有八九要下台。他也许很委屈，才做了几天，完全没办法防止，但比起人命来说，他的政治生命毫无价值。</P>
<P>5。中国的毒奶粉事件8月2日就报到石家庄市政府了，但一直到9月上旬才转到省政府，期间正是奥运敏感时期，动机相当令人怀疑。奥运会和小孩的生命谁重要，在日本提出这个问题的政治家马上要下台，在中国很难说。</P>
<P>6。中国的政府结果，中央，省，市，县，镇，每一层都有卫生部门；日本的政府结构，中央，县，市，正式的卫生部门只设在中央，警察部门只到县，市专管福利。中国的一层套一层，重重叠叠的政府机构对日本分权式的政府机构说明了什么。说明了日本政府是服务人民的，中国政府是管理人民的，要依靠庞大的官僚体制，所以一层套一层地乐得不行。多交了税还不知道税用到了哪里去了，都给一层层官僚分去了？还是买了雷曼公司的债券来帮助美国人买房子？官僚层越多越不办事，越要吃案，越是责任不清，越是没有责任心，越是推脱责任，越可以腐败无耻。不象日本，每层政府机构都是自己直选，然后把税分开来交给不同层次的政府机构，自己很清楚我把我的钱交给了谁去办什么事了。日本的警察每天可以站在警察局门前大声象每个路人问好，以为他清楚他拿的工资是这些人给的。责，权，利不明，就会产生寄生虫，产生贪污，产生犯罪，这是不合理的，那些寄生虫也知道这不合理，人民会不满，他们无法给出合理的服务，于是就只有靠统治来维护不合理了。</P>
<P>&nbsp;&nbsp;&nbsp; 感想很多，大国的雄起，是每个个人的雄起，还是民族的雄起？不好说，对每个个人当然希望自己过得好，但对于种群还有历史哪个更好呢？想不清，也没正确答案，只有平衡的问题吧。不过请先尊重生命的平等吧，我们这一代已经没救了，因为我们已经从骨子里漠视他人的生命，也从骨子里承认命分贵贱了（我就觉得我有城市户口真好），那么好好教育下一代吧，他们还有希望。</P>]]></description>
</item><item>
<title><![CDATA[我的第一份工作--上海贝尔 11. 安达（二）]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=39992</link>
<author>zhoujianjun</author>
<pubDate>2008-9-17 14:49:40</pubDate>
<description><![CDATA[&nbsp;&nbsp;工程终于开始了，我开始白天睡觉,晚上跑机房的日子了。不过我负责的RASM还没开始，我只是到现场看看。现场人不多，邮电局的人有几个，每天晚上有一人值班，哈尔滨某个工程公司派来两个在BELL经过A级培训（和我一样）的人来调试软件，两个人都姓王，年纪不大，三十不到的样子。以前东北出过两个抢银行，杀人的凶犯兄弟，流窜全国，搞的人人自危，很巧他们也姓王，于是我私下称哈尔滨工程公司的两位为二王。因为这是个扩容工程，所以一定要晚上做。每天晚上干个几小时，凌晨就回旅馆休息。所以我也就经常两三点回旅馆敲门，安达宾馆的服务员就不大高兴了。这也难怪，人家安达小地方是低收入低效率，下午不到六点大家就开始窝在家里自娱自乐，中午12点还回家吃午饭，睡个午觉下午二三点再来上班。你个半夜去敲门不要人家命吗？反正我对安达宾馆的厕所是越来越不满了，于是马上搬，搬到对面的一个旅馆去住，名字忘了，就称为A旅馆吧，A旅馆比较老，不过人家愿意半夜给我开门，我于是住上A旅馆的最高级的套房，有卧式，有客厅，才80块一天（虽然我只能报销70块，不过每天还有30块的伙食费可用），我第一次出门住套房，从那以后就没再住过套房了。虽然愿意半夜给我开门，不过人家小地方的服务员小姐还是长心眼的，每次都是两个人一起来给我开大门，然后陪我走过那白天都很暗的走廊带我到我的套房。<BR>&nbsp;&nbsp;&nbsp; 刚开始很不习惯，白天还是很有精神，于是去书店买了套古龙的武狭小说《大人物》看，后来发现出差真的是看书的好季节（虽然已经有过看小说误飞机的经历）。后来就慢慢习惯了，和二王还有C工(程师)以及机房大姐都混熟了，他们也都知道我是菜鸟了，每天晚上聊聊天，有时还玩玩游戏。C工对我打键盘的本领很惊奇，因为他们都是一个手指一个手指地打的，见我可以盲打就夸我是高手。机房大姐让我好好跟二王学学交换机软件调试本领，结果引来大王发怒，说大家都是A级培训出来的，水平都一样，只是分工不同，弄得机房大姐灰头灰脸。后来果然出了个问题，我们三个A级培训都摆不平，让我在那里耗了三个多月。<BR>&nbsp;&nbsp;&nbsp; 和他们搞熟了后，C工就让我每天中饭和午饭一起去吃，有时候还有酒喝，都是邮电局掏钱，还让我搬到他们的邮电招待所住，便宜得很，也不用一周结一次帐（因为曹工已经让我把我的出差费存到他们的邮政储蓄，不怕我赖帐），于是我就过起“白吃白喝白住”的日子（后来知道，我们出差，白住是不大有的，不过基本上可以白吃白喝）。不过他们的招待所可不高级，厕所里的澡盆是脏得不能进去的，我住的二人间也经常换房客，有天早上醒来，我竟然发现有个陌生男子在用我的电动刮胡刀刮胡子。<BR>&nbsp;&nbsp;&nbsp; 随着工程的进展，武汉光电所也来了两个调试光纤通信的女同胞，一个个子矮矮小小叫小P，另一个个子挺高的叫小Z，两个都很活泼，她们也一起住邮电招待所了。机房里人越来越多，也就更热闹了。机房的工作不多，大部分是局长传条子让封掉某人的电话，因为他没交电话费，有时侯还会封自己职员的电话，那时那人就会跑来机房闹着要开通，说干邮电的没啥油水，不就指望着免费打电话吗？说起免费电话，有时晚上我们还能和家里打免费长途，C工说他们这里没啥娱乐活动，就让我们给家里打打长途吧。不过长途话费虽然不是我们出，邮电局还是有的收的，跳下线就可以了，找个长途电话费较多的单位的电话，跳下线来用，长途话费就算他们头上了，反正公对公，被发现了就说计费系统出错了，人家也没办法。<BR>&nbsp;&nbsp;&nbsp; 一天机房里跑来个小老头和我们聊天，自称他帮机房搞过报时系统（也就是弄个报时机接上电话线，人家拨这号码就可听时间了）。后来他邀请我们去他开的游戏房打游戏，我去了，房子破破，有几台立式大游戏机。他和我抱怨一块游戏卡要几千块钱，也没啥人来玩，老亏本，不知道如何是好。我想他是在让我想办法，我是大城市来的嘛。我本想告诉他上海游戏机房都改用家用游戏机了，有台电视机就可以了，一张家用游戏机卡也不过上百块，成本有限。不过想想还是算了，免得他亏了后找我算帐，于是我就装糊涂，免费玩了把游戏就回去了。]]></description>
</item><item>
<title><![CDATA[我的第一份工作--上海贝尔 10. 安达（一）]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=39884</link>
<author>zhoujianjun</author>
<pubDate>2008-9-12 12:16:31</pubDate>
<description><![CDATA[<P>&nbsp;&nbsp;&nbsp; 安达是我第一个正式工作的出差地点,我在那里呆了3到4个月,目的呢,只为RASM接几根线.太简单了吧,我们部门的工作就这么简单(如果一切顺利的话)。派我去的时候，当地工作的条件远远没有准备好，想着让我先过去，看看别人如何调试安装交换机软件的（我的工作要在软件调试完毕后才能进行，而且要在武汉光电所的人安装完他们的光通讯机器后），反正在公司也没别的事可做。不过虽然只是那几根线，我可从来没接过，只是看过图纸，很简单的样子，武汉光电所的人合作过几次后自己都能接，不过他们坚持要我们去人，就怕万一不好。不过话说回来，万一接上不好，我这个菜鸟又能如何，新手第一次出门竟然是独自一个人，只好祈祷万事大吉了（也有好处，不用伺候“老”师傅们了）。<BR>&nbsp;&nbsp;&nbsp; 安达是在哈尔滨和大庆之间，以前是蒙古人的地方，看过《射雕》的人应该知道安达在蒙古语中的意思是“兄弟”。要先坐飞机到哈尔滨，尽管已经是4，5月份的光景，但那里还是冷得很，所以要带上皮衣和大包衣服。虽然不是第一次坐飞机，但还是在机场排错了队，等我发觉时飞机已经上跑道了（因为一边排队一边看小说）。我力马觉醒起来，飞快地找到航空公司办事处，他们说没办法了，但可以退票。觉得相当高兴，因为以前坐船坐车晚了点从没听说可以退票的，车都开了还给你退票，现在飞机飞走了可还能退票。当然退票要损失30%的机票钱，但是我运气好两小时后就有下一航班，况且机票是可以报销的，我只要担心那30%的退票费是否能报销就可以了。<BR>&nbsp;&nbsp;&nbsp; 快到哈尔滨的时候往下看，因为是缺水季节，松花江都见河底了。下了飞机就去火车站，哈尔滨机场离市区可真远，坐BUS要一个多小时。到了乱哄哄的火车站很方便就买到了去安达的车票。很近，就一两个小时的路程，不过要等3个多小时，就在车站里面逗，发现个录像厅，非常高兴，马上买票进去看武打片。等车开的时候，天已大黑，火车轰鸣着开进黑漆漆的松花江大平原，这个时候才担心起到安达后如何在夜里找旅馆，以及身边那几千块出差费的安全（外地是很乱很不安全的，可不如上海）。<BR>&nbsp;&nbsp;&nbsp; 下了车已经是午夜时分了，出了站，整个县城一片漆黑，只在车站口有点灯光，有些拉生意的三轮车。我四面一瞄，不远处有盏灯，隐隐约约是家小旅馆，就马上跑过去，先凑和一晚再说。还好，的确是个旅馆，还有人值班，然后我打听出我这一辈子所听到的最便宜的旅馆价钱，一晚上2块钱。于是我再问问有没有贵点的，得到的答复是让我去安达宾馆。于是我当机力断，两块就两块，马上付钱住下。一个房间住好几人，给一瓶热水，我也不洗了，倒下就睡，把钱压在枕头下面。没多久又进来两东北人，他们也不管其他人要不要睡觉，躺下就大嗓门聊天，什么腐败啦，大庆的物价啦，反正就是觉得世道不好混。弄得我失眠，不过倒也可看着枕头下的钱。<BR>&nbsp;&nbsp;&nbsp; 后来迷迷糊糊地睡了点，天刚亮就赶快起来退房，问了下安达宾馆，说不远。出了门一看，果然不远，就在马路斜对面几百米，这条宽宽的大马路从火车站开始，就是安达唯一的主马路了。安达宾馆如同个土皇宫，只有两层，不过占地很大，周围有个大大的广场围着。进去问了下价钱，70块，正好是公司允许报销的上限。马上住下，然后就去安达邮电局联系工作，邮电局离安达宾馆也不远，其实整个县城就不大，据说有十万人口。和邮电局门卫说我是上海BELL来的，他们让我自己找技术股，进了他们的小大楼，找到技术股，里面有两三人，其中有个小老头穿着举止还算看得过去，50来岁，瘦瘦小小的，一只眼睛有点翻白，正在打电话。后来知道他就是技术股的股长，是个工程师，姓C，据说全局就他一个工程师，他自夸工资比局长还高呢。曹工（程师）瞄了我一眼继续打电话，完了后才来理我，我说我是开RASM局的，他说现在工程还没开始，问我住哪里后让我回去等。我只好回宾馆，给公司打了电话，C经理出差了，我就让组里的人转告我的情况，然后回房间等。<BR>&nbsp;&nbsp;&nbsp; 当然不能干等，我先看看地方电视，然后拿出我带来的游戏机，接上电视，开始玩三国志。当时那张三国志的卡还是日文的，开始打着费力，根据上面有限的汉字琢磨着玩，后来连玩一个星期后就熟门熟路了，那些乱七八遭的日文假名都知道什么意思了。我想我大概成了安达宾馆的怪人了，因为服务员每次来打扫卫生都看见我在打游戏，而且我不大出门，我一出门她们都会奇怪地看我，在想这个上海来的怪物在干什么呢？难道大老远来就是为了躲在宾馆里打游戏呢？如果我再肥点年纪大点，大概她们会认为我是贪污通缉犯，来这里避难的吧。我也是没办法，安达又小又破，实在没啥好玩的，又人生地不熟，不敢远走，所以只好窝在宾馆里等邮电局的工作通知了。每天吃饭就买方便面，然后买只烤鸡，可以吃一天，难得出去下馆子，很便宜，不过东北馆子的菜的量可太多了，实在吃不完只好打包。还去逛了下当地唯一一家书店，买了盒港台流行歌曲带子和一套古龙小说，价钱和上海一样，奇怪当地人如何买得起。<BR>&nbsp;&nbsp;&nbsp; 有天我正玩游戏起劲呢，服务员进来告诉我那天晚上有舞会，不过我没兴趣，因为不会跳。我感兴趣的是她能否解决我房间厕所的问题，原来他们厕所的手纸用完后不能冲掉，要扔在垃圾桶里，我从来没听说过有这事，所以我的厕所就堵上，弄的房间臭气熏天，她们来捅了几次没啥用处，我还换了房，还是老样子。<BR>&nbsp;&nbsp;&nbsp; 终于在我几乎连游戏都打得没劲，马上就要靠睡觉过日子的时候，邮电局来电话告诉我工程开始了，让我每天晚上去。</P>]]></description>
</item><item>
<title><![CDATA[我的第一份工作--上海贝尔 9.北京培训]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=38455</link>
<author>zhoujianjun</author>
<pubDate>2008-8-7 13:56:49</pubDate>
<description><![CDATA[&nbsp;&nbsp;&nbsp;一天,C经理找我,我以为他要派我出差,结果是说让我和小Y还有那个胖子G去北京培训几天,主办单位是邮电部一个下属单位,一看就知道是个免费旅游工作,才几天能培训出什么东西.我添完了报名表格就开始期待,毕竟是第一次出差.<BR>&nbsp;终于到时间去北京了,去公司财务处借了钱,然后自己订了机票.贝尔出差制度是先借公司钱,然后回来再报销结帐,结果就有人问公司借了很多钱,然后就是不结帐,自己存银行收利息.<BR>&nbsp;&nbsp;&nbsp; 我们三人一行坐飞机到了北京,这是我第一次去北京,不过不是第一次坐飞机(大学里爸爸曾经把我送到广州一个客户那里玩了几天,回上海时就是坐飞机回来的).住在主办单位的招待所里,具体什么地方不记得了,大概离天安门不太远.第一天上课时发了点资料,就有从西部来的人和他们讨论起住宿费和开发票的问题.我正无聊呢,小Y就拉我出去,问我去不去天安门玩,我答应了,就去找胖子G,胖子G说他玩过了,让我们去,由他在这里顶着.<BR>&nbsp;&nbsp;&nbsp; 于是我们就出门了,那时候在北京满大街都是面的,便宜得很,我们叫了辆直奔天坛.天坛没给我什么印象,记得花了十块钱拍了张快照.接着是去天安门,好象是自己走过去的,因为记得向一个老头问路,那老头用京腔高傲地回答我们,我们发现听不大懂他在说什么,好在最后他用手指了下,我们终于到了天安门广场.当时就觉得那地方真大,比上海的人民广场大多了.上海的人民广场在89之后就给大卸八块了,北京倒没把天安门广场也拆了,大概是因为它太大了吧,不然后来的轮子们就没地方自焚了.<BR>&nbsp;&nbsp;&nbsp; 当时我们也不知道我们站的地方是几年后轮子们英勇的地方,就穿过地下隧道从伟大的挂像下面走进了皇城了.以后的东西就和清宫剧一样了,大大的清石板,宏伟的大殿以及大殿前那可以供上万人一起磕头的大操场.走到后面就有点花园的样子了,我们仿佛看到了几百年前崇真皇帝上吊的歪脖子树了,只是无法找到阿九公主被断臂的地方.忘记了最后有没有上天安门,反正上了也没啥印象(没有伟人在上面挥手的那个气氛),最后又花了十块在广场前留了影.以后我又去过汉城的皇宫,觉得和中国的差不多,只是规模小多了,不过据说韩国人号称他们皇宫的厕所比我们大.不过我认为厕所最大的皇宫应该在东京,后来我去他们御花园玩的时候曾经在那大大的厕所前面留过影,当时并不知道那是厕所,因为它实在大得美丽得不象厕所.三地的皇宫都有个特点,就是都是用城墙围起来的,泰国的皇宫就不同了,它最多是用墙(不是城墙)围起来的,给人开阔不压抑的感觉.<BR>&nbsp;&nbsp;&nbsp; 我竟然去过四个国家的皇宫了,还真把自己吓一跳.说远了,拍完照,我们就要回家了.老样子,去叫面的,可是我上去后又给司机赶下来了,说我关车门太响.这是拒载,拒载不是因为经济原因,而已因为北京人的高傲.天子脚下,宰相门前,当然可以高熬一下了,也许在北京只有当官的才有资格碰车门,不过好象北京的官实在太多了,据说掉块瓦片就可以砸到三个四品大员.<BR>&nbsp;&nbsp;&nbsp; 既然没资格坐面的,我们就只好去挤公交了.那个时候正好在下班时间,那个车堵得,上海的堵车应该算小儿科了.和上海不同,堵在车上的人全不着急,好象只要堵在车上也算上班时间一样,最后有个送报纸的人竟然把他手中的报纸免费派送,大家也坦然受之,安然得看起报纸来.<BR>&nbsp;&nbsp;&nbsp; 第二天,我们连点名都没去,早早的去万寿山锦绣湖玩了.<BR>&nbsp;&nbsp;&nbsp; 第三天,领培训证书,然后去机场回家.]]></description>
</item><item>
<title><![CDATA[我的第一份工作--上海贝尔 8.做跟班打杂]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=zhoujianjun&amp;id=37642</link>
<author>zhoujianjun</author>
<pubDate>2008-7-11 13:11:20</pubDate>
<description><![CDATA[<P>&nbsp;&nbsp;&nbsp; 第一件,那天我正好又回培训部去上两天课,上到一半时我们的C工(程师)探头进来把我叫出去,让我陪他去个地方.我们是坐公交车去的,所以一路上心里滴估,是不是又让我去做苦力啊.结果最后到了家黄埔区的高级写字楼,里面的人西装笔挺,我估计着是否他的工资有我的十倍.大家在会议事里谈(当然我没话可说),听了个大概,是他们公司遇到个工程问题,向C工要技术SUPPORT,结果是他们出钱请C工去当地解决.我心里正在想不会要我也去吧?不要我去,让我来这干嘛?让我去,我去了又能干嘛(对他们说的话我可是一点不懂).这时候对方大概和我同感,就问C工:"小Z也去吧?"C工回答:"他当然不去."那一刻真是丢脸,好在我脸皮超厚,保持着我一开始就摆出的那付茫然样.会议后,对方请我们去吃饭,我来此的目的也就明了了,对,就是让我来吃一顿饭.虽然菜不错,不过这顿饭还是我吃过的最别扭的一顿饭.不过没什么,既然干工程这一行必然要出去跑,出去跑必然要脸皮厚.他妈的,在中国吃白饭的人又不只是我一个,恐怕有几亿吧,脸皮是练出来的,又不是我要来吃白饭的.吃完白饭就回去了,和C工分手的时候他对我说:"不要紧张,没什么事,就是让你来蹭顿饭!"我自己坐车回家,一路上想破脑袋终于明白了C工为何对我独有所爱,原来几天前他派我去做苦力帮他搬书,我大概流露出不大情愿的意思了.<BR>&nbsp;&nbsp;&nbsp; 第二件,去取随声听.随声听是要做为礼物送给那些来开RASM大会的人的,是我们的C经理大力推举的.那天C经理和工程技术部L经理一起开会,我去送资料,正好听他在向L推举送随声听,他还拉我来证明这是个好主义,我只好附和他说"送随声听相当不错了."最后决定送随声听,C经理就把这单子发给他的哥们了,并派我去取货.他哥们在条小马路上开了个门市部大小的公司(和我爸爸开的电脑公司一样),他哥们当然不生产随声听,也是向哥们的哥们卖来的(这条食物链有多长就不知道了),所以我去的时候货还没备好,所以我就在那里等.等货到了后,货还没验过好坏,我只好和他们一起验.验完后把好货和坏的一起送BELL,我竟然把坏的和好的混在一起,C经理只好发动大家一起再验一便,令我气愤的是在那个时候我看到了那个中专生小Y鄙视的眼光.<BR>&nbsp;&nbsp;&nbsp; 第三件,去机场接机.RASM大会有一些大人物要来(比如邮电部部长),当然要接机,当然我没有资格去接机,我只是个跟班而已.我的任务就是早早到机场守着,待命,然后等部长出来时举着欢迎的牌子,不知道是否有记者把我也拍进去了,这是我离中共中央权力层最靠近的一次.不过我表现不好,不太积极,也不就是接个部长吗,至于那么多人跃前跳后地,其实他们都在表现给L经理看而已.不过我这付呆头呆脑的样很有老人缘,RASM的开发者,我们的J公就很照顾我,看我举牌子累了,就在身边抓了个飞来飞去通风报信的来代替我.最后我给L早早打发回去,任务是给某个司机带路,其实我根本不认识去公司的路,好在那个司机自己认识.<BR>&nbsp;</P>]]></description>
</item>
</channel>
</rss>