tag:blogger.com,1999:blog-57594986023859638852024-03-18T22:09:12.282-07:00Technical Ideas : C#.NetIam creating this blog to share my technical ideas in C# programming languages and new programming methodologies , you can see here the details of the projects and code samples that I have worked in my development career. I believe this blog may helps the guys who are looking for sample projects in C#.Net.josephjohnhttp://www.blogger.com/profile/06410348598067394478noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-5759498602385963885.post-77584920151748782112010-01-06T21:40:00.000-08:002010-02-16T03:56:20.967-08:00Introduction to LINQA simple introduction to LINQ using C#.Net.<div><br /></div>Watch it:<br /><div><br /><object height="340" width="560"><param name="movie" value="http://www.youtube.com/v/GXD4N1OPeno&hl=en_US&fs=1&"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/GXD4N1OPeno&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="340" width="560"></embed></object><br /></div>josephjohnhttp://www.blogger.com/profile/06410348598067394478noreply@blogger.com21tag:blogger.com,1999:blog-5759498602385963885.post-92053829867453760372010-01-06T21:24:00.000-08:002010-01-06T21:31:23.514-08:00Working with XMLThe video shows how to load an xml in datagrid and makes updates in the xml sheets wirting codes in C#.net.<div><br /></div><div>watch it</div><br /><div><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/_y0ndYdPlu0&hl=en_US&fs=1&"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/_y0ndYdPlu0&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br /></div>josephjohnhttp://www.blogger.com/profile/06410348598067394478noreply@blogger.com0tag:blogger.com,1999:blog-5759498602385963885.post-20524451499173101082010-01-06T21:02:00.000-08:002010-01-06T21:24:05.150-08:00Working with EXCEL sheetsThis video shows how to add a table from a database to an excel sheet and update the table contents by writing just 3 lines of codes in C#.Net.<div><br /></div><div>watch it :</div><div><br /></div><div><span class="Apple-style-span" style=" white-space: pre-wrap; font-family:-webkit-monospace;font-size:13px;"><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/qvaGCe5-IY0&hl=en_US&fs=1&"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/qvaGCe5-IY0&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></span><br /></div>josephjohnhttp://www.blogger.com/profile/06410348598067394478noreply@blogger.com8tag:blogger.com,1999:blog-5759498602385963885.post-9346126403816062562009-10-19T11:13:00.000-07:002009-10-19T11:32:02.778-07:00Retrieving inbox from mobileFor retrieving inbox details from a GSM mobile phone is not simple as the sending messages from phone using PC with the help of a AT Commands. Here we need to check whether your phone store your messages in the SIM memory or phone memory. We need to alter our messages according to the storage type of the messages.<br /><br />Here are the example in the case of storing the messages inside the inbox.<br /><br /><span style="font-weight: bold;">AT Command</span><br /><br />AT // For checking phone connected<br />AT+CMGF=1 // Setting message format<br />AT+CSCS="PCCP437" // Setting charset<br />AT+CPMS="SM" // Selecting sim message storage<br />AT+CMGL="ALL" // Reading all inbox messages<br /><br /><span style="font-weight: bold;">Function for reading message collection</span><br /><br /> public ShortMessageCollection ReadSMS(SerialPort port)<br /> {<br /><br /> // Set up the phone and read the messages<br /> ShortMessageCollection messages = null;<br /> try<br /> {<br /><br /> #region Execute Command<br /> // Check connection<br /> ExecCommand(port,"AT", 300, "No phone connected");<br /> // Use message format "Text mode"<br /> ExecCommand(port,"AT+CMGF=1", 300, "Failed to set message format.");<br /> // Use character set "PCCP437"<br /> ExecCommand(port,"AT+CSCS=\"PCCP437\"", 300, "Failed to set character set.");<br /> // Select SIM storage<br /> ExecCommand(port,"AT+CPMS=\"SM\"", 300, "Failed to select message storage.");<br /> // Read the messages<br /> string input = ExecCommand(port,"AT+CMGL=\"ALL\"", 5000, "Failed to read the messages.");<br /> #endregion<br /><br /> #region Parse messages<br /> messages = ParseMessages(input);<br /> #endregion<br /><br /> }<br /> catch (Exception ex)<br /> {<br /> throw new Exception(ex.Message);<br /> }<br /><br /> if (messages != null)<br /> return messages;<br /> else<br /> return null;<br /> <br /> }josephjohnhttp://www.blogger.com/profile/06410348598067394478noreply@blogger.com14tag:blogger.com,1999:blog-5759498602385963885.post-87111821161034032572009-09-26T05:22:00.000-07:002009-10-06T05:23:44.458-07:00Sample projects using C#.Net , Communication GSM modem with PCIn this blog I like to tell you about the communication between the PC and GSM modem in mobile phone. Iam creating this sample application in C#.Net and SQL Server , for communicating with GSM mobile phone we need to know how to execute AT commands in Windows Hyper-terminal.<br /><br /><h2><span style="font-size:130%;">Microsoft HyperTerminal</span></h2><span class="mainText">Microsoft HyperTerminal is a small program that comes with Microsoft Windows. You can use it to send AT commands to your mobile phone or GSM/GPRS modem. It can be found at <i>Start</i> -> <i>Programs</i> -> <i>Accessories</i> -> <i>Communications</i> -> <i>HyperTerminal</i>. If you cannot find it and you are using Windows 98, then probably you have not installed it. You can go to <i>Control Panel</i> -> <i>Add/Remove Programs</i> -> <i>Windows Setup</i> tab -> <i>Communications</i> list box item -> <i>Details</i> button to install MS HyperTerminal.<br />for more details follow this web site :<a href="http://www.developershome.com/sms/howToUseHyperTerminal.asp">http://www.developershome.com/sms/howToUseHyperTerminal.asp</a><br /></span><br />Hypertreminal communicates directly with the modem /mobile connected and instructs the modem. It also gives responses back as OK or error etc. But if we have a application where we need to send SMS after a specific set of actions, then hypertreminal is not useful, since it requiers manual typing. You need to select the COM port on which modem/mobile is connected.(port can be serial port for modem or USB port for mobile).<br /><br /><span style="font-weight: bold;">Sending through hyper-terminal</span><br /><br /><span style="font-style: italic;font-size:85%;" ><span class="codeText"><b>AT</b><br />OK<br /><b>AT+CMGF=1</b><br />OK<br /><b>AT+CMGW="+cell number",129</b><br />> <b>Your sms message content [</b></span></span><span style="font-size:85%;"><span class="codeText"><b> press ctrl Z</b></span></span><span style="font-style: italic;font-size:85%;" ><span class="codeText"><b> ]</b><br /></span><br /></span><br /><span style="font-size:130%;"><br />Sending SMS through GSM modem.</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNGMTf6MV8i4fxegvN7NgaQqOH1gAoKTEZJbC_g-hNjhSrbaiPF2MJe0-MTzi87nkzJTpYAQhwycLTctT7F-kvWRWc4tTAUs0z3aZ8-oecpqcknaW5a9vPuDT6hZ4yA0mvFP_YAMvpBfhC/s1600-h/smsapp.PNG"><img style="cursor: pointer; width: 320px; height: 233px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNGMTf6MV8i4fxegvN7NgaQqOH1gAoKTEZJbC_g-hNjhSrbaiPF2MJe0-MTzi87nkzJTpYAQhwycLTctT7F-kvWRWc4tTAUs0z3aZ8-oecpqcknaW5a9vPuDT6hZ4yA0mvFP_YAMvpBfhC/s320/smsapp.PNG" alt="" id="BLOGGER_PHOTO_ID_5386593321752921122" border="0" /></a><br /><br />First let us examine how to send SMS through a GSM mobile phone in C#.Net.<br /><br />1. Connect the phone to the PC and Install modem driver software , for eg Nokia pc suite<br />2. Refer the <a href="http://www.developershome.com/sms/howToUseHyperTerminal.asp">AT commands</a> for communicating with GSM Modem.<br />3. Test these commands through windows hyperterminal.<br />4. Find the port address of the COM port of the modem from device manager.<br />5. Use these port address in our application for sending SMS.<br /><br /><br /><span style="font-size:130%;">Creating code in C#</span><br /><br />Create new project and add new class SMSCOMMS.cs .<br />In the class import class library Threading, ComponentModel, IO.Ports<br /><br /><a href="http://docs.google.com/View?id=dgc3t2gt_1d9xhbwxg">Click here to view the whole class file.</a><br /><br />Iam now try to develop the receiving the list of inbox items , sent items and trash in a mobile phone.<br /><br /><br /><span style="font-size:130%;">References</span><br /><br /><cite><a href="http://www.codeproject.com/">www.<b>codeproject</b>.com</a><br /><br /><a href="http://gatling.ikk.sztaki.hu/%7Ekissg/gsm/atscan/unprocessed/Nokia6500v04_53.txt">AT Commands</a><br /><br /><a href="http://www.shefeekj.com/">www.shefeekj.com</a><br /><br /></cite><br /><br /><script type="text/javascript"><br />var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");<br />document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));<br /></script><br /><script type="text/javascript"><br />try {<br />var pageTracker = _gat._getTracker("UA-10839898-1");<br />pageTracker._trackPageview();<br />} catch(err) {}</script>josephjohnhttp://www.blogger.com/profile/06410348598067394478noreply@blogger.com12