tag:blogger.com,1999:blog-70859412024-03-07T18:53:53.180-08:00Experience in C++, C#, Java and Process : Living in Montreal* What is my technical experience as a software developer
<p>
* What I have learned in the software business
</p>
<p>
* Where I am heading to in my career
</p>
<p>
* How to process in a project
</p>Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.comBlogger31125tag:blogger.com,1999:blog-7085941.post-22224972105658911572011-05-11T14:56:00.000-07:002011-05-13T13:41:17.029-07:00ZT 评论:中国会不会有Linkedin<span class="Apple-style-span" style="font-family: 宋体, arial, sans-serif; font-size: 12px; line-height: 21px; "><div class="hd" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 22px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; width: 588px; overflow-x: visible; overflow-y: visible; zoom: 1; text-align: center; clear: both; position: relative; z-index: 3; "><h1 style="margin-top: 0px; margin-right: 0px; margin-bottom: 6px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 26px; font-weight: 800; color: rgb(0, 0, 0); font-family: 宋体, arial; font-style: normal; font-variant: normal; line-height: 30px; "><a href="http://tech.qq.com/a/20110512/000030.htm">http://tech.qq.com/a/20110512/000030.htm</a></h1><h1 style="margin-top: 0px; margin-right: 0px; margin-bottom: 6px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 26px; font-weight: 800; color: rgb(0, 0, 0); font-family: 宋体, arial; font-style: normal; font-variant: normal; line-height: 30px; ">评论:中国会不会有Linkedin</h1><div class="titBar" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; width: 578px; overflow-x: visible; overflow-y: visible; zoom: 1; position: relative; "><div class="info" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 80px; padding-bottom: 0px; padding-left: 0px; color: rgb(126, 126, 126); height: 16px; "><span class="pubTime">2011年05月12日05:02</span><span class="infoCol" style="padding-right: 19px; "><span class="where" style="padding-left: 19px; color: rgb(126, 126, 126); ">第一财经网站</span><span class="auth" style="color: rgb(126, 126, 126); padding-left: 19px; ">魏武挥</span></span><span class="infoComm"><a href="http://comment5.tech.qq.com/comment.htm?site=tech&id=28578315" id="cmt_1" target="_blank" style="color: rgb(11, 59, 140); text-decoration: none; ">我要评论<span class="num" style="color: rgb(51, 51, 51); ">(<em id="comNum" style="font-style: normal; font-weight: normal; color: rgb(204, 0, 0); ">0</em>)</span></a></span></div><div class="fontSize" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; float: right; color: rgb(126, 126, 126); position: absolute; right: 0px; top: -3px; ">字号:<span class="small" title="切换到小字体" id="fontSmall" style="font-family: 'Times New Roman', arial; cursor: pointer; font-weight: bold; font-size: 10px; color: rgb(102, 102, 102); padding-right: 3px; padding-left: 3px; ">T</span>|<span class="big" title="切换到大字体" id="fontBig" style="font-family: 'Times New Roman', arial; cursor: pointer; font-weight: bold; font-size: 13px; color: rgb(11, 59, 140); padding-left: 3px; padding-right: 3px; ">T</span></div></div></div><div class="bd" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; width: 588px; overflow-x: visible; overflow-y: visible; zoom: 1; clear: both; position: relative; z-index: 2; "><div class="Line" style="margin-top: 18px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; height: 1px; font-size: 0px; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(229, 229, 229); "></div><div id="Cnt-Main-Article-QQ" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 20px; padding-left: 0px; font-size: 14px; "><p style="margin-top: 20px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 25px; text-indent: 2em; ">本周,Linkedin已经为自己的IPO做了定价,区间在32~35美元,预期募集资金2.71亿美元,估值在30亿~33亿美元。这个所谓主打高端人群,74%会员受过高等教育,被誉为“职场SNS”的网络公司,拥有1亿用户,2010年营收2.43亿美元,利润1500多万美元。据公司声称,在Linkedin上,有200万个公司页面,73%的财富100强公司用过它的招聘解决方案,世界500强则全数成为它的会员。至于搜索各种人士:一年20亿次的搜索规模。</p><p style="margin-top: 20px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 25px; text-indent: 2em; ">Linkedin是2002年创办的,根据C2C(copy to China)的中国网络传统,2004年国内就有一个名为若邻的网站,并得到维众的投资(该公司成功投资了分众)。但这个网站的发展一度相当迟滞,甚至还出现过创始人出局的状况。今天更有了一些模仿者,比如刚刚上市的人人,就搞了一个经纬网,目标也是职场人群。</p><p style="margin-top: 20px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 25px; text-indent: 2em; ">但就笔者个人而言,相当看淡职场SNS在中国的发展。因为职场SNS的重要作用:找工作以及找人才,在中国文化土壤上,很难长出参天大树来。</p><p style="margin-top: 20px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 25px; text-indent: 2em; ">早期找工作,在网络上更多的是招聘类网站,比如前程、智联之类。这类网站的特点有二:其一相对低端化,主要供具体执行层面的岗位应聘以及应届毕业生海投使用。其二则呈现出广告化态势,很多企业并无真实招人需求,弄个logo上去当广告做了。这类网站后面还有跟随者,最近的就是百度人才。但我把百度人才更倾向于视为百度需要详细用户数据,做社交网络基础使用。</p><p style="margin-top: 20px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 25px; text-indent: 2em; ">对于很多中高端人才而言,招聘类网站的不给力,职场SNS就应运而生。但西方能亮的东西,未必在东方能亮。Linkedin的理论基石在于:弱关系理论。</p><p style="margin-top: 20px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 25px; text-indent: 2em; ">美国学者格兰诺维特在他一本名为《找工作》的书中,得出这样一个结论:弱关系在寻找职业机会中非常有用(他称之为弱纽带)。因为弱关系更能够在不同的团体间传递非重复性的信息,使得社交网络中的成员能够获得更丰富的信息资源。比如说一个搞公关的想跳槽去做程序员(假定此人会这门技术),而由于长年搞公关,走动得勤快的朋友多是同行,便很难为此人提供程序员工作的机会。</p><p style="margin-top: 20px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 25px; text-indent: 2em; ">弱关系理论,最近大有取代“六度理论”的势头,数字巨头的掌门人动辄会提到这个名词。不过,事实上这个理论是很古老的社交网络理论(1973年),也是很典型的西方理论。在1999年,华裔学者边燕杰就认为,在中国内地求职,强关系更有用。</p><p style="margin-top: 20px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 25px; text-indent: 2em; ">中国人的“关系”这个词的研究,几十年来一直没有脱离学者费孝通当年树立的一个概念:差序格局。费氏用这样一个比喻来形象地说明:中国人的社交格局就好像把一块石头丢在水面上所发生的一圈圈推出去的波纹。我们对身边的人会尽力去处理社交事务,随着关系的逐渐传递(也就是像水纹一样),会越推越薄,越远越不当回事。指望很弱的关系来帮助你完成人生那么重大的事:求职,显然有点奢望了。</p><p style="margin-top: 20px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 25px; text-indent: 2em; ">互联网世界中的职场SNS,就是一种弱关系。在西方,弱关系能生效推动了越来越多的人以及公司使用类似Linkedin的服务。但由于中国依然是个强关系发生效用的社会,中国的职场SNS所能满足人们的需要就减弱很多。而这种功利性质很强的SNS,一旦最大目的达不成,就会变得无人问津。若邻网发展数年,现在几乎快成了一个散发各种营销活动信息的网站了。</p><p style="margin-top: 20px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 25px; text-indent: 2em; ">对于长期以来的C2C传统,笔者以为,门户时代、搜索时代都没有问题,因为无论是门户还是搜索,都是处理客观的信息,与该国的文化关系并不大。而到了社交网络时代,国与国,民族与民族的文化差异就变得至关重要。到底,社交网络是处理人的关系的网络。某种意义上讲,与美国正好相反,中国为什么微博强于SNS,文化上也算一个原因吧。</p><p style="margin-top: 20px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 25px; text-indent: 2em; ">(作者执教于上海交通大学传媒与设计学院,新媒体、互联网观察者)<a href="http://www.qq.com/#pref=article" target="_blank" title="点击进入腾讯首页" id="backqqcom" style="color: rgb(11, 59, 140); text-decoration: none; "><img src="http://www.qq.com/favicon.ico" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; " /></a></p></div></div></span>Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com8tag:blogger.com,1999:blog-7085941.post-1166507505084881362006-12-18T21:51:00.000-08:002006-12-18T21:51:45.246-08:00'.NET: Introducing Generics in the CLR,'bloggerForm','scrollbars=no,width=475,height=300,top=175,left=75,status=yes,resizable=yes<a href="http://msdn.microsoft.com/msdnmag/issues/06/00/NET/default.aspx">'.NET: Introducing Generics in the CLR,'bloggerForm','scrollbars=no,width=475,height=300,top=175,left=75,status=yes,resizable=yes</a>: "Generics are an extension of the CLR type system that allow developers to define types for which certain details are left unspecified. These details are specified when the code is referenced by consumer code, making for enhanced flexibility. Jason Clark explains how."Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com11tag:blogger.com,1999:blog-7085941.post-1165516916797765162006-12-07T10:40:00.000-08:002006-12-07T10:42:29.393-08:00How do I debug a custom action/installer class?You can use one of the following methods:<br />Add a call in your code to System.Diagnostics.Debugger.Launch. This method opens Just-In-Time debugging and allows you to attach a new debugger to your code.<br />Add a call in your code to MessageBox.Show("Debug Me"). When the message box is shown, use Visual Studio to attach to the <a onclick="javascript:Track('ctl00_LibFrame_ctl18ctl00_LibFrame_ctl19',this);" href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.messagebox(VS.80).aspx">MessageBox</a> process. Then place breaks (for Visual C# projects) or stops (for Visual Basic projects) in the code.<br />Set your debugging preferences to start InstallUtil.exe (which is located in \winnt\Microsoft.net\Framework\version) and pass it your assembly as a parameter. When you press F5, you hit your breakpoint. InstallUtil.exe will run your custom actions the same way that MSI does.Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com9tag:blogger.com,1999:blog-7085941.post-1124826441930677042005-08-23T12:44:00.000-07:002005-08-23T12:47:21.936-07:00DBDate, DBTime, DBTimeStamp, DateSystem.Data.OleDb.OleDbType.DBDate = store date only in the database;<br />System.Data.OleDb.OleDbType.DBTime= store time only in the database;<br /><br />>>> The wrong one<br />System.Data.OleDb.OleDbType.DBTimeStamp= store date&time only in the database;<br /><br />>>> The right one<br />System.Data.OleDb.OleDbType.Date= store date&time only in the database;<br /><br />Example:<br /><br />this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_TradeTime", System.Data.OleDb.OleDbType.Date, 0, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "TradeTime", System.Data.DataRowVersion.Original, null));Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com9tag:blogger.com,1999:blog-7085941.post-1116532769058718632005-05-19T12:57:00.000-07:002005-05-19T12:59:29.063-07:00Change color of one cell in the DataGrid control ( C#)<a href="http://datawebcontrols.com/faqs/CustomizingAppearance/ConditionalFormatting.shtml">http://datawebcontrols.com/faqs/CustomizingAppearance/ConditionalFormatting.shtml</a><br /><br />The DataGrid provides a plethora of properties that can be set to specify the DataGrid's formatting. For example, you can have each consecutive row of a DataGrid alternate between two different colors merely by setting the DataGrid's AlternatingItemStyle's BackColor property.<br />While the AlternatingItemStyle is a great way to apply different formatting for every other DataGrid row, oftentimes developers want to perform conditional formatting based on the value(s) of a DataGrid row. For example, imagine a DataGrid that displays a list of products, including the product's name and price. Perhaps you want to draw the user's attention to products that are at "bargain-basement" prices. Namely, if a product has a price less than, say, $10.00, you want to have that row highlighted.<br />This can be accomplished by providing an event handler for the DataGrid's ItemDataBound event. The ItemDataBound fires once for each DataGridItem added to the DataGrid (that is, it fires once for each row that is added to the DataGrid). Essentially, what we need to do is in this event handler, check to see if the price is below the threshold ($10.00, or whatever lower bound you choose). If it is, then we want to set the DataGridItem's BackColor property to Yellow, thereby highlighting the row.Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com1tag:blogger.com,1999:blog-7085941.post-1116271794069904852005-05-16T12:28:00.000-07:002005-05-16T12:29:54.073-07:00Setup with Serial Key required<a name="vxgrfserialnumbertemplateproperty"></a>SerialNumberTemplate Property<br /><br /><####-????-%%%%-????-%%%%-????-%%%%><br /><br /><br /># Requires a digit that will not be included in the validation algorithm.<br />% Requires a digit that will be included in the validation algorithm.<br />? Requires an <strong>alphanumeric</strong> character that will not be included in the validation algorithmJoehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com4tag:blogger.com,1999:blog-7085941.post-1116208621314776372005-05-15T18:51:00.000-07:002005-05-15T18:57:01.320-07:00DataSet Form Problems ( As always)- When I used the Data Set Form Wizard in VS.NET 2003 to generate a dataset form, I got the error: "there were errors configuring the data adapter". My god, it happens again. I spent 1 hour to repeat the whole procedure and I spent 3o minutes on Internet to find out how other people say about it.<br /><br />Finally I recalled the problem happend before:<br /><br />- If a column name in the Access database is special (I am not clear how special it could be), it will have this problem.<br /> So I check the column name, find one is called Symbol, which looks special. I changed it to ProductSymbol, Great! the dataset form wizard worked.Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com7tag:blogger.com,1999:blog-7085941.post-1115501127042286702005-05-07T14:24:00.000-07:002005-05-07T14:25:27.046-07:00Good about Manifest<a href="http://blogs.msdn.com/junfeng/archive/2004/11/02/251318.aspx">http://blogs.msdn.com/junfeng/archive/2004/11/02/251318.aspx</a>Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com2tag:blogger.com,1999:blog-7085941.post-1114350097731740292005-04-24T06:39:00.000-07:002005-04-24T06:41:37.733-07:00Mix cin >> and cin.getline in C++ programIf the cin.getline() is used after cin >>, the getline may just get a '\0' bacause the last cin >> call left it.<br />How to fix it?<br /><br />cin.ignore(100,'\n'); <br />cin.getline(buffer1, 80, '\n');Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0tag:blogger.com,1999:blog-7085941.post-1110551885056348812005-03-11T06:22:00.000-08:002005-03-11T06:38:05.056-08:00ADO.NET Datagrid database caching in VS.NET// Add a new record to the database directlly<br />// It is very slow since it is operating to the db without caching<br />//<br />public void AddLog(string info) <br />{ <br />objDatasetLog.LogTable.AddLogTableRow( DateTime.Now, 0, "User", info);<br />}<br /><br />//<br />// Better approach:<br />//<br />// Create a cache record, then merge to the real database laterly<br />//<br />public void AddLog(string info) <br />{ <br />// Create a new dataset to hold the records returned from the call to FillDataSet. <br />// A temporary dataset is used because filling the existing dataset would <br />// require the databindings to be rebound. <br />PDFAuto.DatasetLog objDataSetTemp; <br />objDataSetTemp = new PDFAuto.DatasetLog();<br /> try <br />{ <br />// Attempt to fill the temporary dataset. <br /><br />objDataSetTemp.LogTable.AddLogTableRow( DateTime.Now, 0, "User", info); <br />} <br />catch (System.Exception eFillDataSet) <br />{ <br />// Add your error handling code here. <br />throw eFillDataSet; <br />} <br />try <br />{ <br />grdLogTable.DataSource = null; <br />// Empty the old records from the dataset. <br />objDatasetLog.Clear(); <br />// Merge the records into the main dataset. <br />objDatasetLog.Merge(objDataSetTemp); <br />grdLogTable.SetDataBinding(objDatasetLog, "LogTable"); <br />} <br />catch (System.Exception eLoadMerge) <br />{ <br />// Add your error handling code here. <br />throw eLoadMerge; <br />}<br /> <br />}Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0tag:blogger.com,1999:blog-7085941.post-1109906374329633982005-03-03T19:17:00.000-08:002005-03-03T19:19:34.330-08:00Set width and precision in iostream of STD1. Call precision and width close to cout;<br />2. fixed to enforce to show a float as 23.45 format<br /><br />int nLine = 1; for ( int i = 0; i < 100; i += 5)<br />{ <br />cout.precision( 2); cout.width( 6); <br />cout << fixed << inch2cm( i) << " ";<br />if ( nLine % 10 == 0) <br />{ cout << endl; } <br />nLine++;<br />}Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com1tag:blogger.com,1999:blog-7085941.post-1107208071951615082005-01-31T13:42:00.000-08:002005-01-31T13:47:51.953-08:00Could not access 'CDO.Message' object while using SMTP in System.Web.Mail Could not access 'CDO.Message' object:
<br />
<br />1. The SMTP server must accept your outcoming email address
<br />2. The SMTP server uses the standard port 25 for SMTP
<br />
<br />MailMessage Message = new MailMessage();
<br />
<br />Message.To = "<a href="mailto:joe@xxx.com">joe@xxx.com</a>";
<br />Message.From = "<a href="mailto:xxx@sympatico.ca">xxx@sympatico.ca</a>"; // This address must have been registered in the SMTP server you are using in SmtpMail.SmtpServer
<br />Message.Subject = "Test";
<br />Message.Body = "It is a testing message";
<br />
<br />SmtpMail.SmtpServer = "smtp8.sympatico.ca"; // The SMTP server
<br />
<br />SmtpMail.Send(Message);
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com12tag:blogger.com,1999:blog-7085941.post-1106877733072834532005-01-27T18:01:00.000-08:002005-01-30T07:08:39.056-08:00Reference places<ul><li>HTML <a href="http://www.w3schools.com/">http://www.w3schools.com/</a> </li><li>C# <a href="http://www.sloppycode.net/">http://www.sloppycode.net</a></li></ul>Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0tag:blogger.com,1999:blog-7085941.post-1106792053609405242005-01-26T18:13:00.000-08:002005-01-26T21:29:20.806-08:00Regular expression in C#It is time consuming to build a regular expression.
<br />I have a text file as below:
<br />
<br />idnameaddressemailfaxpassowrd
<br />example:
<br />000010034981Mr. Ray BabsMontreal Canada Test@glinknet.com5142842903PassWord
<br />
<br />How do I parse it? Note it is possible no value for address, email, fax, or password
<br />
<br />Here is the regular expression I built ( 2 hours work)
<br />
<br />(?<id>\d+)\(?<name>(.[^]+))\(?
<br /><address>()(.[^]+))\(?<email>(.[^]+)())\(?<fax>()(.[^]+))\(?<pdfcode>(.+()))
<br />
<br />It retrives the value to groups defined by "?<group>"
<br />(<span style="color:#ff6666;">? </span><span style="color:#993300;">()</span><span style="color:#990000;"></span><span style="color:#66cccc;">(.[^]+)</span>)
<br />
<br /><strong><span style="color:#ff6666;">Can you find better expression?</span></strong>
<br /></address><div align="left"><address>Regex regx = new Regex( @"(?<id>\d+)\(?<name>(.[^]+))\(? <address>()(.[^]+))\(?<email>(.[^]+)())\(?<fax>()(.[^]+))\(?<pdfcode>(.+()))", RegexOptions.IgnoreCase RegexOptions.Singleline RegexOptions.IgnorePatternWhitespace RegexOptions.Compiled );
<br />Match m = regx.Match( line);
<br />if ( !m.Success) </address><address>{ </address><address>System.Diagnostics.Debug.WriteLine( line, "Import Text Error"); </address><address>continue; </address><address>} </address><address> </address><address>string id = m.Result( "${id}"); </address><address>string name = m.Result( "${name}"); </address><address>string address = m.Result( "${address}"); </address><address>string email = m.Result( "${email}"); </address><address>string fax = m.Result( "${fax}"); </address><address>string pdfcode = m.Result( "${pdfcode}");
<br /></address><address>
<br /> </address></address></div>
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com1tag:blogger.com,1999:blog-7085941.post-1106680509195526042005-01-25T11:14:00.000-08:002005-02-10T09:30:23.520-08:00Data access in VS.NET demo : C#1. <a href="http://www.dotnetjunkies.com/Tutorial/92FD33CA-7528-42A0-B974-8607A04B8B56.dcik">http://www.dotnetjunkies.com/Tutorial/92FD33CA-7528-42A0-B974-8607A04B8B56.dcik</a>
<br />2. Introduction
<br />When using the Visual Studio.NET IDE to create connections to MS Access databases, the default wrapper only puts Dates into Date/Time fields. This causes only the date to be saved and on the time when a date/time is written to the data set and Update is called.
<br />How to fix it?
<br />1) This is caused by the Wizard using DBDate rather than DBTimeStamp in the OleDbParameter method generated by the wizard. Ofcourse each time you regenerate this code using the wizard you will have to do the replace again.
<br />Note: This has to be done in all OleDbParameter calls that use System.Data.OleDb.OleDbType.DBDate and replace with System.Data.OleDb.OleDbType.DBTimeStamp
<br />
<br /><span style="color:#ff0000;">Actually, this solution does not work. INSERT causes an error about type mismatch</span>
<br /><span style="color:#000000;">2) Just change to <span style="color:#ff0000;"><em><strong>System.Data.OleDb.OleDbType.Date</strong></em></span> and it will work. </span>
<br />
<br />3. Don't use 'Level' as a row name in a table, VS.NET IDE will not generate data adapter for it.
<br />
<br />4. Expend the width of a column
<br /> int nWidth = objColumnStylegrdLogTableEvent_Level.Width+objColumnStylegrdLogTableInfo.Width + objColumnStylegrdLogTableTime.Width;
<br /> objColumnStylegrdLogTableInfo.Width = grdLogTable.Width - nWidth;
<br />
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0tag:blogger.com,1999:blog-7085941.post-1106670937207294342005-01-25T08:33:00.000-08:002005-01-25T08:35:37.206-08:00Get the application start up path : C#// Gets the path for the executable file that started the application, including the executable name.
<br />string aPath1 = System.Windows.Forms.Application.ExecutablePath;
<br />
<br />// Gets the path for the executable file that started the application, not including the executable name.
<br />string aPath2 = System.Windows.Forms.Application.StartupPath;
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0tag:blogger.com,1999:blog-7085941.post-1106540977384219422005-01-23T20:28:00.000-08:002005-01-23T20:29:37.386-08:00.NET Framework Launch Condition<a name="vxtskaddingnetframeworklaunchcondition"></a>
<br />See Also
<br /><a href="ms-help://MS.VSCC.2003/MS.MSDNQTR.2004OCT.1033/vsintro7/html/vxconlaunchconditionmanagementindeployment.htm">Launch Condition Management in Deployment</a> <a href="ms-help://MS.VSCC.2003/MS.MSDNQTR.2004OCT.1033/vsintro7/html/vxgrfsupportedruntimesproperty.htm">SupportedRuntimes Property</a> <a href="ms-help://MS.VSCC.2003/MS.MSDNQTR.2004OCT.1033/vsintro7/html/vxgrfmessageproperty.htm">Message Property</a> <a href="ms-help://MS.VSCC.2003/MS.MSDNQTR.2004OCT.1033/vsintro7/html/vxgrfinstallurlproperty.htm">InstallUrl Property</a> Working With Multiple Versions of the .NET Framework Side-by-Side Execution <a href="ms-help://MS.VSCC.2003/MS.MSDNQTR.2004OCT.1033/vsintro7/html/vxconlaunchconditionproperties.htm">Properties for the Launch Conditions Editor</a>
<br />The .NET Framework launch condition is used to check for the common language runtime on a target computer during installation. This launch condition is automatically added to a deployment project when a dependency on the .NET Framework is detected; it cannot be removed.
<br />If a version of the runtime specified in the SupportedRuntimes property is not found, the installation is halted. The user is presented with a Yes / No dialog box containing the text specified in the Message property. If the user chooses Yes, he is redirected to the location specified in the InstallUrl property (the default is a Microsoft Support Web site that contains a downloadable copy of the .NET Framework redistributable file).
<br />In many cases, you will want to modify the InstallUrl property to point to your own location for the redistributable file. For example, if you are distributing your application on CD-ROM, you should include the redistributable file on the CD and change the InstallUrl property to a relative file path. If you change the InstallUrl property, you should also change the Message property to explain what is being installed and from where.
<br />In addition, any Visual Studio .NET application or component that includes data access has a dependency on Microsoft Data Access Components (MDAC) version 2.7 or later. You will also need to add a launch condition to check for MDAC if your application includes data access. For more information, see Adding a Launch Condition for Microsoft Data Access Components.
<br />
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0tag:blogger.com,1999:blog-7085941.post-1106498473496619152005-01-23T08:39:00.000-08:002005-01-23T08:41:13.496-08:00Add a taskbar tray in C#C# provides the NotifyIcon in task bar as a component. Here is some event it has to handle:
<br />
<br />private void FormMain_Resize(object sender, System.EventArgs e)
<br />{
<br /> if (FormWindowState.Minimized == WindowState) Hide();
<br />}
<br />private void notifyIconTask_DoubleClick(object sender, System.EventArgs e)
<br />{
<br /> Show();
<br /> WindowState = FormWindowState.Normal;
<br />}
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0tag:blogger.com,1999:blog-7085941.post-1106179096253996482005-01-19T15:51:00.000-08:002005-01-19T15:58:16.253-08:00Thread pool in C#There is pre-created threads pool in C#. Use this threads in the pool could make the programming easier and faster. But be noted, if all of the threads in the pool are used, you will get an exception.
<br />How does it exactly work for a threads pool? Can a application creates its own threads pool with the same design?
<br />
<br />Need to be clarified!
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0tag:blogger.com,1999:blog-7085941.post-1106085573917041302005-01-18T13:46:00.000-08:002005-01-18T13:59:50.596-08:00Broken Software Design theory It must exists a research area to break software design.
<br />A software is designed for purpose and it must run correctly following the procedure designed. In the design process, the designer may only think of how to make it works smoothly which assumes every condition is followed correctly. It is not designed for exceptions which may make the software failed.
<br />
<br />The Broken Software Design theory stduies how to break a software in the design stage.
<br />
<br />It helps the designer to look at the design from different perspectives and improve the design as well.
<br />
<br />For more information, please keep trace this blog.
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0tag:blogger.com,1999:blog-7085941.post-1105498839293096882005-01-11T18:50:00.000-08:002005-01-11T19:00:39.293-08:00XP can't boot to safemode !!!Big problem:
<br />1. I am working on a project and I installed a MIDI input device simulation driver called MIDI-YOKE.
<br />2. After computer restarted as required, it stopped just before the login screen showup
<br />3. I can not boot into safemode; I believe that the problems was in the YOKE driver.
<br />4. What I am going to do? reformatting the disk and install XP again? No way! I have a lot of work to do: a new system release is coming and my computer can's stop
<br /><span style="color:#ff0000;">5. Clam down, Joe.</span>
<br />6. Search online, didn't find something really helpful.
<br />7. I am a Microsoft believer. There must a way to let windows booting procedure ingore the YOKE driver
<br />8. I tried to boot into Safemode command
<br />9. OK, I can type dos command
<br />10. Regedit, search the drive name, delete everything related to it.
<br />11. Control.exe. Cool! the control panel shows up. Goto System->Device Management, find the YOKE device, delete it!
<br />12. Reboot, then it is working!
<br />13. I have to Ghost my disk C and back up all of my work.
<br /><span style="color:#ff0000;">14. Never try anything stupid</span>
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0tag:blogger.com,1999:blog-7085941.post-1105201318666304132005-01-08T08:18:00.000-08:002005-01-08T08:21:58.666-08:00C# : Marshal class is a bridge between managed memory and unmanaged memoryMarshal provides a collection of methods:
<br />- allocating unmanaged memory,
<br />- copying unmanaged memory blocks,
<br />- converting managed to unmanaged types,
<br />- interacting with unmanaged code.
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0tag:blogger.com,1999:blog-7085941.post-1103602915892308722004-12-20T20:20:00.000-08:002004-12-20T20:21:55.893-08:00Show a form as a dialog box in C#About about = new About();
<br />
<br />// Show it as a diaglog
<br />about.ShowDialog();
<br />
<br />// Show it as a form
<br />about.Show();
<br />
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com14tag:blogger.com,1999:blog-7085941.post-1103510048653718882004-12-19T18:11:00.000-08:002005-01-27T07:43:59.393-08:00VS.NET Setup Project : Issues and Solutions<strong>Environment:</strong>
<br />Microsoft Visual Studio.NET 2003
<br />Windows XP SP2
<br />DELL Inspiron 8200, CPU P4-M 1.6M ,512MB 15.4LCD, 40G, 3COM Wireless, DVD+CDRW, Logitech MX310
<br />
<br /><strong>Project:</strong>
<br />
<br />
<br /><ol><li>During the install process , the setup asks users to give a project name [ProjectName]. If the user select Link.NET Example, the setup will install a [defult database]; if not, the database will not be installed.</li><li>The [defult database] contains a few of folders up to 20.</li><li>Add an Uninstall menu along with the main program menu.</li></ol><p><strong>Solutions & <span style="color:#ff0000;">Problems</span>:</strong></p><ol><li>Add a new dialog Textboxes (B) in the user interface editor, press F4 to show its property window. Assign "EDIT_PROJECTNAME" as Edit1Property and "Link.NET Example" as Edit1Value, so [EDIT_PROJECTNAME] can be used anywhere to represent "Link.NET Example".</li><li>Drag/drop a database folder to the Application Folder in the File System. VS.NET will add the whole folder hiberarchy to the setup folder. <span style="color:#ff0000;">[Problem] </span><span style="color:#ff0000;">If you wnat to delete the folders from the setup project, it would be nightmare. The root folder can not be deleted if each of its subfolders contains any files. To remove the whole folder, first of all, you have to remove all files in each folder, by hands! I have tried to move the database file to a MSM file, but it never works.</span></li><li><span style="color:#ff0000;"><span style="color:#000000;">Show the database folder property, set the Condition property as "[EDIT_PROJECTNAME] == "Link.NET Example"". During the setup procedure, this Condition will be checked to determine if the database should be installed.</span></span></li><li>[More about Condition] Add a provision that allows users to create a shortcut to the FormattingApplication in their desktops. As before, you'll need to add the shortcut to the User's Desktop folder. Right-click on Primary output from the FormattingApplication (Active) item in the Application folder and select Create Shortcut to Primary output from FormattingApplication (Active) from the context menu. Rename the shortcut Formatting Application. Drag and drop it in the User's Desktop folder. However, you want this shortcut to be installed only if the user wants to install it. Therefore, set the Condition property of the User's Desktop folder to SHORTCUTDEMO. This ensures that the shortcut will be installed only if this condition is set to true. Later in this article, you will create a dialog box where this property can be set. <a href="http://www.codeguru.com/Csharp/.NET/net_vs_addins/visualstudioadd-ins/article.php/c7245/">Web like help</a></li><li>VS.NET setup project does not encourage to add a uninstallation menu along with the application invoking menu. To do that, you have to add a shortcut for <strong>"msiexec /x [productcode]". </strong><span style="color:#ff0000;">But, you have to add msiexec into your application folder first before creating the shortcut.</span></li><li>I can create a menu with static name during the setup, but I want to assign the menu name with user's own defined project name. <span style="color:#ff0000;">It is impossible to do it in VS.NET setup project.</span></li></ol>
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0tag:blogger.com,1999:blog-7085941.post-1103323307756429112004-12-17T14:40:00.001-08:002004-12-17T14:41:47.756-08:00Add a new link for Employment<a href="http://www.newworldproducts.org/Employment/">Employment</a>
<br />Joehttp://www.blogger.com/profile/04618327687649458144noreply@blogger.com0