<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>UIC BSCS '07</title>
	<atom:link href="http://uiccs07.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://uiccs07.net</link>
	<description>Code and Snippets for vb.net 2005</description>
	<pubDate>Wed, 29 Jul 2009 06:21:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Loading (.csv) file to listview</title>
		<link>http://uiccs07.net/?p=59</link>
		<comments>http://uiccs07.net/?p=59#comments</comments>
		<pubDate>Wed, 29 Jul 2009 06:21:13 +0000</pubDate>
		<dc:creator>shyguy</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://uiccs07.net/?p=59</guid>
		<description><![CDATA[Well, somebody is asking me for a code that will load up a (.csv) format to listview. In response to what he wanted, I decided to put it in here based on how I load a .csv file to listview. This article will be in relation to the previous post that I made. I hope [...]]]></description>
			<content:encoded><![CDATA[<p>Well, somebody is asking me for a code that will load up a (.csv) format to listview. In response to what he wanted, I decided to put it in here based on how I load a .csv file to listview. This article will be in relation to the previous post that I made. I hope this will help. Enjoy! </p>
<p><code><br />
Private Sub LoadData()<br />
        Dim fileLookUp As New OpenFileDialog<br />
        fileLookUp.Title = "Get File"<br />
        fileLookUp.Filter = "Files (*.csv)|*.csv|All Files (*.*)|*.*"<br />
        If fileLookUp.ShowDialog() = Windows.Forms.DialogResult.OK Then<br />
            Me.txtFile.Text = fileLookUp.FileName<br />
            mFileName = System.IO.Path.GetFileName(Me.txtFile.Text)<br />
            mFolder = System.IO.Path.GetDirectoryName(Me.txtFile.Text)<br />
        End If</p>
<p>        Dim ConnectionString, CommandText As String<br />
        Dim conn As OleDb.OleDbConnection<br />
        Dim Command As OleDbCommand<br />
           Dim myString As String = txtFile.Text<br />
        Dim myIndex As Integer = myString.LastIndexOf("\") + 1<br />
        myString = myString.Substring(myIndex, myString.Length - myIndex)</p>
<p>        Try</p>
<p>        ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &#038; mFolder &#038; "\;Extended Properties='text;HDR=Yes'"</p>
<p>            CommandText = "select * from " &#038; myString &#038; ""</p>
<p>            conn = New System.Data.OleDb.OleDbConnection(ConnectionString)<br />
            Command = New System.Data.OleDb.OleDbCommand(CommandText, conn)</p>
<p>            conn.Open()</p>
<p>            Dim t As New DataTable<br />
            ' initializing its column to complement on how many fields I want to return in my query command<br />
            t.Columns.Add("v7#3")<br />
            t.Columns.Add("F2")<br />
            t.Columns.Add("F3")</p>
<p>            ' a method to access read-only the result set.<br />
            Dim reader As OleDbDataReader = Command.ExecuteReader()<br />
            While reader.Read()<br />
                ' create new row<br />
                Dim r As DataRow = t.NewRow()<br />
                r(0) = reader("v7#3")<br />
                r(1) = reader("F2")<br />
                r(2) = reader("F3")</p>
<p>                ' add a row to a datatable<br />
                t.Rows.Add(r)<br />
            End While</p>
<p>            ' close reader<br />
            reader.Close()<br />
            ' close the connection </p>
<p>            conn.Close()</p>
<p>            For i As Integer = 0 To t.Rows.Count - 1<br />
                Dim li As ListViewItem = ListView1.Items.Add(t.Rows(i)("v7#3").ToString())<br />
                li.SubItems.Add(t.Rows(i)("F2").ToString())<br />
                li.SubItems.Add(t.Rows(i)("F3").ToString())</p>
<p>            Next</p>
<p>        Catch ex As Exception<br />
            MsgBox("Invalid Format! Please try another.")<br />
        End Try<br />
    End Sub<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://uiccs07.net/?feed=rss2&amp;p=59</wfw:commentRss>
		</item>
		<item>
		<title>Saving Listview as (.csv) file</title>
		<link>http://uiccs07.net/?p=52</link>
		<comments>http://uiccs07.net/?p=52#comments</comments>
		<pubDate>Thu, 16 Jul 2009 04:55:05 +0000</pubDate>
		<dc:creator>shyguy</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://uiccs07.net/?p=52</guid>
		<description><![CDATA[It was easy for me to save a file on the database but saving a file as a (.csv) format is another issue for me before. Until I discover saving as a (.csv) format is just as simple as saving file on a database. All you just need to do on this is that to [...]]]></description>
			<content:encoded><![CDATA[<p>It was easy for me to save a file on the database but saving a file as a (.csv) format is another issue for me before. Until I discover saving as a (.csv) format is just as simple as saving file on a database. All you just need to do on this is that to call the streamwriter to save the data as (.csv) format. I have here a sample codes below where the data the loaded on my listview was saved as (.csv) format. Hope you enjoy.</p>
<p><code>
<p>Private Sub SaveAsFile()</p>
<p>&#8216;They want to do a SaveAs, so find out what they want to name the file</p>
<p>Dim saveFileDialog As SaveFileDialog = New SaveFileDialog()</p>
<p />
<p>saveFileDialog.Title = &#8220;Save File&#8221;</ p></p>
<p>saveFileDialog.Filter = &#8220;Files (*.csv)|*.csv|All Files (*.*)|*.*&#8221;</p>
<p />
<p>saveFileDialog.DefaultExt = &#8220;csv&#8221;</p>
<p />
<p>saveFileDialog.AddExtension = True</p>
<p />
<p>If saveFileDialog.ShowDialog(Me) = Windows.Forms.DialogResult.OK Then</p>
<p>filename = saveFileDialog.FileName    </p>
<p>        End If</p>
<p>        Try<br />
            Dim csvFileContents As New System.Text.StringBuilder<br />
            Dim currentLine As String = String.Empty</p>
<p>            &#8216;Write out the column names as headers for the csv file.<br />
            For columnIndex As Int32 = 0 To 0<br />
                currentLine &#038;= (String.Format(&#8221;mycolumn_name&#8221;))<br />
            Next</p>
<p>            &#8216;Remove trailing comma</p>
<p>            csvFileContents.AppendLine(currentLine.Substring(0, currentLine.Length))<br />
            currentLine = String.Empty</p>
<p>            &#8216;Write out the data.<br />
            For Each item As ListViewItem In ListView1.Items</p>
<p>                For Each subItem As ListViewItem.ListViewSubItem In item.SubItems</p>
<p>                    currentLine &#038;= (String.Format(&#8221;"&#8221;{0}&#8221;",&#8221;, subItem.Text))</p>
<p>                Next<br />
                &#8216;Remove trailing comma</p>
<p>                csvFileContents.AppendLine(currentLine.Substring(0, currentLine.Length - 1))<br />
                currentLine = String.Empty</p>
<p>            Next</p>
<p>            &#8216;Create the file.<br />
            Dim sw As New System.IO.StreamWriter(filename)<br />
            sw.WriteLine(csvFileContents.ToString)<br />
            sw.Flush()<br />
            sw.Dispose()<br />
        Catch ex As Exception</p>
<p>        End Try</p>
<p>    End Sub</code></p>
]]></content:encoded>
			<wfw:commentRss>http://uiccs07.net/?feed=rss2&amp;p=52</wfw:commentRss>
		</item>
		<item>
		<title>Introducing Ultidev Cassini</title>
		<link>http://uiccs07.net/?p=46</link>
		<comments>http://uiccs07.net/?p=46#comments</comments>
		<pubDate>Tue, 14 Jul 2009 12:43:03 +0000</pubDate>
		<dc:creator>shyguy</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://uiccs07.net/?p=46</guid>
		<description><![CDATA[It&#8217;s been a big confusion on my mind before since I was thinking on how do I make my web application to run on cd. Well, while searching and looking around for a stand alone web server on the google I saw a Ultidev Cassini that really fits to what really I need and now [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a big confusion on my mind before since I was thinking on how do I make my web application to run on cd. Well, while searching and looking around for a stand alone web server on the google I saw a Ultidev Cassini that really fits to what really I need and now I was using it. It was really a great product and free for everyone. If you want to explore more on how to used it just visit <a href="http://ultidev.com">http://ultidev.com</a> and explore how it works. </p>
<p><img alt="" src="http://ultidev.com/images/CassiniExplorerUI.png" title="cassini" class="aligncenter" width="500" height=300" /></p>
]]></content:encoded>
			<wfw:commentRss>http://uiccs07.net/?feed=rss2&amp;p=46</wfw:commentRss>
		</item>
		<item>
		<title>How to add groups on listview</title>
		<link>http://uiccs07.net/?p=33</link>
		<comments>http://uiccs07.net/?p=33#comments</comments>
		<pubDate>Thu, 28 May 2009 20:40:18 +0000</pubDate>
		<dc:creator>shyguy</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://uiccs07.net/?p=33</guid>
		<description><![CDATA[I have here a simple sample on how to group in a listview. I hope this simple code can help to someone needed this.



Public Class Form1     
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        
Dim group1 As New ListViewGroup(&#8221;Group 123&#8243;, [...]]]></description>
			<content:encoded><![CDATA[<p>I have here a simple sample on how to group in a listview. I hope this simple code can help to someone needed this.</p>
<p></p>
<p><img src="http://uiccs07.net/wp-content/uploads/2009/05/listview1.bmp" alt="listview1" title="listview1" class="alignnone size-full wp-image-38" /></p>
<p></p>
<p>Public Class Form1     </p>
<p>Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        </p>
<p>Dim group1 As New ListViewGroup(&#8221;Group 123&#8243;, HorizontalAlignment.Left)<br />
 group1.Name = &#8220;Group 123&#8243;<br />
ListView1.Groups.Add(group1)         </p>
<p>With ListView1.Items<br />
.Add(&#8221;123&#8243;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;ABC&#8221;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;1/11/05&#8243;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;1&#8243;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;TV&#8221;)<br />
.Item(.Count - 1).Group = group1<br />
 .Add(&#8221;123&#8243;)            .Item(.Count - 1).SubItems.Add(&#8221;DEF&#8221;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;1/11/05&#8243;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;1&#8243;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;VCD&#8221;)<br />
.Item(.Count - 1).Group = group1<br />
.Add(&#8221;123&#8243;)<br />
 .Item(.Count - 1).SubItems.Add(&#8221;GHI&#8221;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;1/11/05&#8243;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;1&#8243;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;TVRACK&#8221;)<br />
.Item(.Count - 1).Group = group1             </p>
<p>Dim group2 As New ListViewGroup(&#8221;Group 234&#8243;, HorizontalAlignment.Left)<br />
group2.Name = &#8220;Group 234&#8243;  </p>
<p>ListView1.Groups.Add(group2)<br />
.Add(&#8221;234&#8243;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;KLM&#8221;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;1/12/06&#8243;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;1&#8243;)<br />
.Item(.Count - 1).SubItems.Add(&#8221;MIC&#8221;)<br />
.Item(.Count - 1).Group = group2<br />
End With<br />
End Sub </p>
<p>End Class </p>
]]></content:encoded>
			<wfw:commentRss>http://uiccs07.net/?feed=rss2&amp;p=33</wfw:commentRss>
		</item>
		<item>
		<title>How to make borderless form draggable?</title>
		<link>http://uiccs07.net/?p=22</link>
		<comments>http://uiccs07.net/?p=22#comments</comments>
		<pubDate>Thu, 07 May 2009 21:45:33 +0000</pubDate>
		<dc:creator>shyguy</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://uiccs07.net/?p=22</guid>
		<description><![CDATA[Making a form without a border is nice to see especially when the user don&#8217;t want his form to minimize and maximize. I have here the following code that will make a borderless form draggable.
 
&#8216;Declare these 2 variables with class scope
Private Const WM_NCLBUTTONDOWN As Integer = &#38;HA1S
Private Const HTCAPTION As Integer = 2
&#8216;Then handle your form.MouseDown event
Private [...]]]></description>
			<content:encoded><![CDATA[<p>Making a form without a border is nice to see especially when the user don&#8217;t want his form to minimize and maximize. I have here the following code that will make a borderless form draggable.</p>
<p> </p>
<p>&#8216;Declare these 2 variables with class scope<br />
Private Const WM_NCLBUTTONDOWN As Integer = &amp;HA1S<br />
Private Const HTCAPTION As Integer = 2</p>
<p>&#8216;Then handle your form.MouseDown event<br />
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown<br />
        Me.Capture = False<br />
        Dim msg As Message = Message.Create(Me.Handle, WM_NCLBUTTONDOWN, New IntPtr(HTCAPTION), IntPtr.Zero)<br />
        Me.DefWndProc(msg)<br />
    End Sub</p>
]]></content:encoded>
			<wfw:commentRss>http://uiccs07.net/?feed=rss2&amp;p=22</wfw:commentRss>
		</item>
		<item>
		<title>How to send email using SMTP</title>
		<link>http://uiccs07.net/?p=18</link>
		<comments>http://uiccs07.net/?p=18#comments</comments>
		<pubDate>Thu, 07 May 2009 16:40:06 +0000</pubDate>
		<dc:creator>shyguy</dc:creator>
		
		<category><![CDATA[Vb.net Code and Snippets]]></category>

		<guid isPermaLink="false">http://uiccs07.net/?p=18</guid>
		<description><![CDATA[Sending email using vb.net 2.0 framework is quite different from 1.1. The 1.1 framework is using a System.Web.Mail while 2.0 uses System.Net.Mail and it makes really different. There are some codes that are obsolete in 2.0 framework already that exist in 1.1 framework.  In my case, since I am using vb.net 2.0 framework then I will share my [...]]]></description>
			<content:encoded><![CDATA[<p>Sending email using vb.net 2.0 framework is quite different from 1.1. The 1.1 framework is using a System.Web.Mail while 2.0 uses System.Net.Mail and it makes really different. There are some codes that are obsolete in 2.0 framework already that exist in 1.1 framework.  In my case, since I am using vb.net 2.0 framework then I will share my code here  that i used in my program that will send emails.  I hope this will help to the people who are seeking codes that will send an email using vb.net 2.0 framework. As a default I am using gmail for my demo but it can be used to any email server as long as you know the configuration.</p>
<p> </p>
<p>Set iMsg = CreateObject(&#8221;CDO.Message&#8221;)<br />
Set iConf = CreateObject(&#8221;CDO.Configuration&#8221;)<br />
Set Flds = iConf.Fields</p>
<p>schema = &#8220;http://schemas.microsoft.com/cdo/configuration/&#8221;<br />
Flds.Item(schema &amp; &#8220;sendusing&#8221;) = 2<br />
Flds.Item(schema &amp; &#8220;smtpserver&#8221;) = &#8220;smtp.gmail.com&#8221;<br />
Flds.Item(schema &amp; &#8220;smtpserverport&#8221;) = 465<br />
Flds.Item(schema &amp; &#8220;smtpauthenticate&#8221;) = 1<br />
Flds.Item(schema &amp; &#8220;sendusername&#8221;) = &#8220;myemail@gmail.com&#8221;<br />
Flds.Item(schema &amp; &#8220;sendpassword&#8221;) =  &#8220;mypassword&#8221;<br />
Flds.Item(schema &amp; &#8220;smtpusessl&#8221;) = 1<br />
Flds.Update</p>
<p>With iMsg<br />
.To = &#8220;admin@uiccs07.net&#8221;<br />
.From = &#8220;admin@uiccs07.net&gt;&#8221;<br />
.Sender = &#8220;uiccs07.net&#8221;<br />
.ReplyTo = &#8220;admin@uiccs07.net&#8221;<br />
.Subject = &#8220;This is a subject&#8221;<br />
.HTMLBody = &#8220;This is sample html email.&#8221;<br />
.Organization = &#8220;uiccs07.net&#8221;<br />
Set .Configuration = iConf<br />
SendEmailGmail = .Send<br />
End With</p>
<p>set iMsg = nothing<br />
set iConf = nothing<br />
set Flds = nothing</p>
]]></content:encoded>
			<wfw:commentRss>http://uiccs07.net/?feed=rss2&amp;p=18</wfw:commentRss>
		</item>
		<item>
		<title>Welcome</title>
		<link>http://uiccs07.net/?p=1</link>
		<comments>http://uiccs07.net/?p=1#comments</comments>
		<pubDate>Sat, 02 May 2009 05:29:06 +0000</pubDate>
		<dc:creator>shyguy</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://uiccs07.net/?p=1</guid>
		<description><![CDATA[
Welcome everyone. I hope you enjoy upon visiting this site. Please leave a comment or email the administrator if there is any question regarding to this site. Have a nice day and God Bless!


]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><img class="alignleft" title="Uncle Digong" src="http://2.bp.blogspot.com/_u5vghlsBW-A/RoXMiuZMuNI/AAAAAAAAAkQ/xml6jJvaa2Q/s320/duterte1.jpg" alt="" width="93" height="103" /></p>
<p style="text-align: left;">Welcome everyone. I hope you enjoy upon visiting this site. Please leave a comment or email the administrator if there is any question regarding to this site. Have a nice day and God Bless!</p>
<p style="text-align: left;">
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://uiccs07.net/?feed=rss2&amp;p=1</wfw:commentRss>
		</item>
	</channel>
</rss>
