<?xml version="1.0" encoding="utf-8" ?><?xml-stylesheet type="text/xsl" href="http://www.daniweb.com/js/rss.xsl"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>DaniWeb IT Discussion Community
			 - VB.NET			Solved Articles
					</title>
		<link>http://www.daniweb.com/software-development/vbnet/solved/_/58</link>
		<description>Our VB.NET forum is the place for Q&amp;A-style discussions related to this language. Note that we also have a VB 6 forum within the Software Development category in addition to an ASP.NET forum within the Web Development category.</description>
		<language>en-US</language>
		<ttl>60</ttl>
		<!-- PubSubHubbub Discovery -->
		<link rel="hub" href="http://daniweb.superfeedr.com/" xmlns="http://www.w3.org/2005/Atom" />
		<link rel="self" href="http://www.daniweb.com/rss/pull/58/solved" xmlns="http://www.w3.org/2005/Atom" />
		<!-- End Of PubSubHubbub Discovery -->
				<item>
			<title>I don&#039;t know what I am doing....</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/455129/i-dont-know-what-i-am-doing</link>
			<pubDate>Wed, 22 May 2013 17:55:08 +0000</pubDate>
			<description>I am currently taking a programming class. I finished my work early one day and was bored so.. I decided to make a randomizer that will only pick a number a single time. I have been trying to make it, but I run into continous errors with it. It seems ...</description>
			<content:encoded><![CDATA[ <p>I am currently taking a programming class. I finished my work early one day and was bored so.. I decided to make a randomizer that will only pick a number a single time. I have been trying to make it, but I run into continous errors with it. It seems to work until the randomizer picks 1. I have no idea why this does not work, but if it does pick one several clicks later the program will crash. Also the program can start picking the other numbers multiple times. Eventually the option for one will go away, but only after several clicks of the button.<br />
 Button1 adds the numbers to a text file and button 2 picks the number. Button 3 is a reset.<br />
 This program was created to pick seats so I am using that as my variable.<br />
 Here is my code so far....</p>

<pre><code class="language-vb">Public Class Form1
    Public seat As Integer
    Dim r As Integer
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If My.Computer.FileSystem.FileExists("seats.txt") Then
            My.Computer.FileSystem.DeleteFile("seats.txt")
            For x = 1 To 5
                My.Computer.FileSystem.WriteAllText("seats.txt", Environment.NewLine + x.ToString, True)
            Next
            RemoveAtLine("seats.txt", 0)
        Else : For x = 1 To 5
                My.Computer.FileSystem.WriteAllText("seats.txt", Environment.NewLine + x.ToString, True)
            Next
            RemoveAtLine("seats.txt", 0)
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        r = IO.File.ReadAllLines("seats.txt").Length + 1
        Dim reader As New System.IO.StreamReader("seats.txt")
        Dim allLines As List(Of String) = New List(Of String)
        Do While Not reader.EndOfStream
            allLines.Add(reader.ReadLine())
        Loop
        reader.Close()
        If Val(TextBox1.Text) &lt;= r Then
            For x = 1 To Val(TextBox1.Text)
                Randomize()
                seat = Int(Rnd(1) * r)
                Label1.Text = Label1.Text + Environment.NewLine + ReadLine(seat, allLines)
                RemoveAtLine("seats.txt", seat - 1)
            Next x
        Else : MsgBox("Not enough seats left")
        End If
    End Sub

    Public Shared Sub RemoveAtLine(ByVal filePath As String, Optional ByVal lineRemove As Integer = -1)
        If (String.IsNullOrEmpty("seats.txt")) Then
            Return
        End If
        Dim lines As New List(Of String)(IO.File.ReadAllLines("seats.txt"))
        If (lineRemove &gt;= 0 And lineRemove &lt;= lines.Count) Then
            lines.RemoveAt(lineRemove)
        End If
        IO.File.WriteAllLines("seats.txt", lines.ToArray())
    End Sub

    Public Function ReadLine(ByVal lineNumber As Integer, ByVal lines As List(Of String)) As String
        If lineNumber = 0 Then
            Return lines(lineNumber)
        Else
            Return lines(lineNumber - 1)
        End If
    End Function

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If My.Computer.FileSystem.FileExists("seats.txt") Then My.Computer.FileSystem.DeleteFile("seats.txt")
    End Sub
End Class
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>schroaus</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/455129/i-dont-know-what-i-am-doing</guid>
		</item>
				<item>
			<title>grams conversion to tola masha and ratti</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/455083/grams-conversion-to-tola-masha-and-ratti</link>
			<pubDate>Wed, 22 May 2013 07:35:50 +0000</pubDate>
			<description>i am making a module in vb.net which will convert number of grams to number of tola masha and ratti respectively. 1 tola = 12 masha 1 masha= 8 ratti while 1 tola = 12.5 grams i can make number of tolas by number of grams \ 12.5 but can ...</description>
			<content:encoded><![CDATA[ <p>i am making a module in vb.net which will convert number of grams to number of tola masha and ratti respectively.<br />
1 tola = 12 masha<br />
1 masha= 8 ratti<br />
while<br />
1 tola = 12.5 grams<br />
i can make number of tolas by number of grams \ 12.5<br />
but can go any further.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Affable zaki</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/455083/grams-conversion-to-tola-masha-and-ratti</guid>
		</item>
				<item>
			<title>importing specific data from webpage to windows form text box</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454911/importing-specific-data-from-webpage-to-windows-form-text-box</link>
			<pubDate>Sun, 19 May 2013 11:33:57 +0000</pubDate>
			<description>well here is the problem ! i am making a desktop application using vb.net and sql server for a local jeweler. i want to fetch &quot;gold rate&quot; to text box &quot;txtbox_goldrate&quot; from http://www.goldrates.pk . the other way is to use goldrate api from a webservice but that is not free ...</description>
			<content:encoded><![CDATA[ <p>well here is the problem !<br />
i am making a desktop application using vb.net and sql server for a local jeweler. i want to fetch "gold rate"<br />
to text box "txtbox_goldrate" from <a href="http://www.goldrates.pk" rel="nofollow">http://www.goldrates.pk</a> . the other way is to use goldrate api from a webservice but that is not free so thats why i want to copy specific data from a specific website and use it in a<br />
textbox to use it in calculation. plz help and use code snippets for beginners. thanks in advance</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Affable zaki</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454911/importing-specific-data-from-webpage-to-windows-form-text-box</guid>
		</item>
				<item>
			<title>Custom Class</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454863/custom-class</link>
			<pubDate>Sat, 18 May 2013 10:32:49 +0000</pubDate>
			<description>I have created custom text box for specific purpose i.e to accept alphanumeric values only and the length of text should be 6. If the user put less than six characters the code in below block converts it to 6 characters by filling in zeros . ‘Custom Clss block Protected ...</description>
			<content:encoded><![CDATA[ <p>I have created custom text box for specific purpose i.e to accept alphanumeric values only and the length of text should be 6. If the user put less than six characters the  code in below block converts it to 6 characters by filling in zeros .</p>

<pre><code class="language-vb">‘Custom Clss block
Protected Overrides Sub OnLostFocus(ByVal e As System.EventArgs)
‘some code
End sub 
</code></pre>

<p>Also i write code for LostFocus in in form code</p>

<pre><code class="language-vb">‘Form class block
Private Sub TxtPurchasePLCode_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxtPurchasePLCode.LostFocus

‘some code
End sub
</code></pre>

<p>**<br />
Now the  problem is code written  on form class block get triggered before code in Custom Clss block<br />
How can i make Custom Clss block Trigger  before form class<br />
**</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>PM312</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454863/custom-class</guid>
		</item>
				<item>
			<title>ReadOnly Property in custom control</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454778/readonly-property-in-custom-control</link>
			<pubDate>Thu, 16 May 2013 21:41:03 +0000</pubDate>
			<description>When the readonly property of textbox is set to true then back colour turns to grey. i use below code to change the back colour to white Private Sub TextBox1_ReadOnlyChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.ReadOnlyChanged If TextBox1.ReadOnly = True Then TextBox1.BackColor = Color.White End If End ...</description>
			<content:encoded><![CDATA[ <p>When the readonly property of textbox is set to true then back colour turns to grey. i use below code to change the back colour to white</p>

<pre><code class="language-vb"> Private Sub TextBox1_ReadOnlyChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.ReadOnlyChanged
 If TextBox1.ReadOnly = True Then
 TextBox1.BackColor = Color.White
 End If
 End Sub
</code></pre>

<p>How can i make custom control for text box to handel above code so that i dont have to write above code for each and every text box.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>PM312</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454778/readonly-property-in-custom-control</guid>
		</item>
				<item>
			<title>Mouse Position</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454755/mouse-position</link>
			<pubDate>Thu, 16 May 2013 15:27:18 +0000</pubDate>
			<description> I am making a game in microoft visual basic. It is virtually finished, but I am having a problem. When you hit the start button a timer is activated making the character in the game equal mouse position. The problem is that the character is not actually going to the ...</description>
			<content:encoded><![CDATA[ <pre><code class="language-vb">I am making a game in microoft visual basic. It is virtually finished, but I am having a problem. When you hit the start button a timer is activated making the character in the game equal mouse position. The problem is that the character is not actually going to the mouse position. It appears a distance a way from the mouse usually down and to the right. The distance is not the same every time, so I can't just offset the position of the character. The character still follows the mouse as it is supposed to, but it stays the same distance away from the mouse the entire time. Any way to fix this?
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>schroaus</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454755/mouse-position</guid>
		</item>
				<item>
			<title>Mp3 player</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454653/mp3-player</link>
			<pubDate>Wed, 15 May 2013 09:58:09 +0000</pubDate>
			<description>i just want to make a mp3 player, but i got problem at my mp3 path. this is my code: Public Class Form1 Private Sub Import_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Import.Click FBD.ShowDialog() TextBox1.Text = FBD.SelectedPath Dim folderInfo As New IO.DirectoryInfo(TextBox1.Text) Dim arrFilesInFolder() As IO.FileInfo Dim fileInFolder ...</description>
			<content:encoded><![CDATA[ <p>i just want to make a mp3 player, but i got problem at my mp3 path. this is my code:</p>

<pre><code class="language-vb">Public Class Form1

    Private Sub Import_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Import.Click
        FBD.ShowDialog()
        TextBox1.Text = FBD.SelectedPath
        Dim folderInfo As New IO.DirectoryInfo(TextBox1.Text)
        Dim arrFilesInFolder() As IO.FileInfo
        Dim fileInFolder As IO.FileInfo
        arrFilesInFolder = folderInfo.GetFiles("*.mp3")
        For Each fileInFolder In arrFilesInFolder
            playlist.Items.Add(fileInFolder.Name)
        Next
    End Sub

    Private Sub Play_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Play.Click
        AxWindowsMediaPlayer1.URL = playlist.SelectedItem
    End Sub
</code></pre>

<p>my problem is on line <strong>AxWindowsMediaPlayer1.URL = playlist.SelectedItem</strong> because if you can see, my folder directory is in the textbox, but my mp3 name is in the playlis(listbox), so now i dont know how to combine this url.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Hazuan Nazri</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454653/mp3-player</guid>
		</item>
				<item>
			<title>Events Inside the form within the dll doesn&#039;t work</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454638/events-inside-the-form-within-the-dll-doesnt-work</link>
			<pubDate>Wed, 15 May 2013 07:43:43 +0000</pubDate>
			<description>I made three projects the first one is a windows form, the second one is a class library and the third one is another class library to be the reference of the second and first projects. Inside my second Project which is a class library there are two files a ...</description>
			<content:encoded><![CDATA[ <p>I made three projects the first one is a windows form, the second one is a class library and the third one is another class library to be the reference of the second and first projects. Inside my second Project which is a class library there are two files a class file and a windows form. In the windows form I have controls there are textboxes and labels. My problem is the event of the controls does not work. even there is already codes on it. Is there anything I missed or it just the dll doesn't support the events inside and by the way I am using system.reflection because i want this to be a plugin to my main program and also I already made system.windows.forms.form as a reference.</p>

<p>Your knowledge and advise on this matter is highly appreciated. thank you</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>androidz</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454638/events-inside-the-form-within-the-dll-doesnt-work</guid>
		</item>
				<item>
			<title>Getting the returned value from SQL stored Procedure in VB.net</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454617/getting-the-returned-value-from-sql-stored-procedure-in-vb.net</link>
			<pubDate>Tue, 14 May 2013 21:12:41 +0000</pubDate>
			<description>Group, I've written a short stored procedure in SQL Server 2008 to create a new Order Number. The code looks like this: INSERT INTO ORDRNUMBERREC(OrderNo,UserId,CreateDate) SELECT MAX(OrderNo)+1,'system',GETDATE() FROM ORDRNUMBERREC WITH (TABLOCKX) In VB2010, I've written the following code to execute the stored procedure: con = New SqlConnection(sConnection) cmd = New ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>I've written a short stored procedure in SQL Server 2008 to create a new Order Number.  The code looks like this:</p>

<pre><code class="language-vb">INSERT INTO ORDRNUMBERREC(OrderNo,UserId,CreateDate)
SELECT MAX(OrderNo)+1,'system',GETDATE() FROM ORDRNUMBERREC
WITH (TABLOCKX)
</code></pre>

<p>In VB2010, I've written the following code to execute the stored procedure:</p>

<pre><code class="language-vb">            con = New SqlConnection(sConnection)
            cmd = New SqlCommand
            Dim rdr As SqlDataReader
            cmd.CommandText = "Update_OrderNo"
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Connection = con
</code></pre>

<p>I now want to read this new OrderNo to insert it into a TextBox.  This code sits under the above writen code:</p>

<pre><code class="language-vb">            con.Open()
            rdr = cmd.ExecuteReader()
            Do While rdr.Read()
                ordno = rdr(0)
            Loop
            rdr.Close()
            con.Close()
</code></pre>

<p>Unfortunately this is returning a value of '0'.  I've confirmed by querying the table the procedure is running and a new order number is being assigned.  What I can't figure out is why '0' displays in the textbox.</p>

<p>Is it because I'm not querying the table correctly?  Ultimately I need to have this new order number returned before the procedure is run by another user (which is why I'm using TABLOCKX).  Can someone help me get this correctly?</p>

<p>As always, thanks!</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454617/getting-the-returned-value-from-sql-stored-procedure-in-vb.net</guid>
		</item>
				<item>
			<title>Lable names in urdu</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454441/lable-names-in-urdu</link>
			<pubDate>Sun, 12 May 2013 10:27:24 +0000</pubDate>
			<description>Need Help guys. I am beginer in vb.net. i am using vs 2008 with sqlserver 2005. my head will burt very soon :( i have completed a desktop application for a local shopkeeper but he says this is in english and i want it in URDU :@ ,,,, i WANT ...</description>
			<content:encoded><![CDATA[ <p>Need Help guys. I am beginer in vb.net. i am using vs 2008 with sqlserver 2005. my head will burt very soon :( i have completed a desktop application for a local shopkeeper but he says this is in english and i want it in URDU :@ ,,,, i WANT to name all lables in URDU, all msg box in URDU and buttons names in urdu at front end. All i want to change <strong>TEXT PROPERTY of LABLES AND BUTTONS and if possible msg boxes to URDU</strong> ... Thanks in advance.<br />
and yes !!! m using windows 7 professional.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Affable zaki</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454441/lable-names-in-urdu</guid>
		</item>
				<item>
			<title>VB not NET listboxes - Auto-select multiple lines</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454345/vb-not-net-listboxes-auto-select-multiple-lines</link>
			<pubDate>Fri, 10 May 2013 17:45:49 +0000</pubDate>
			<description>I have two questions here. First of all, how do I enable selection of multiple listbox items and select them via code? Secondly, how do I prevent the user from selecting multiple lines? Now, for some background and my thoughts. I'm working on a project for computer science in which ...</description>
			<content:encoded><![CDATA[ <p>I have two questions here. First of all, how do I enable selection of multiple listbox items and select them via code?<br />
Secondly, how do I prevent the user from selecting multiple lines?</p>

<p>Now, for some background and my thoughts. I'm working on a project for computer science in which 'movies' (a class module I created) may be borrowed, browsed or requested. Currently, I have it to the point where a user may register or login and their information is saved to a file. I also have the menu after the login screen complete and they can view each and every movie and make requests/borrow them by outputting the information into listboxes.</p>

<p>Each request/borrowed movie is stored into a multi-dimensional array which contains the date and movie's index (I declared an array of movies).  Essentially, I want to output the multiple pieces of data for each request as one single listbox item which may be selected and removed from the list as necessary. After a bit of googling and dabbling, I discovered much to my dismay that visual basic 6 list boxes --my CS class uses outdated software &gt;.&lt;-- do not support displaying one list object across multiple lines. As such, I have resorted to the following:</p>

<pre><code class="language-vb">Call lstRequests.AddItem(movStock(requested(0, i)).title)
Call lstRequests.AddItem(requested(1, i))
Call lstRequests.AddItem("")
</code></pre>

<p>In order to remove a request, I simply need to use modulo 3 (with some minor modifications) on the listIndex (selected item). This is fine and all, however, I don't want the following to happen (bold is the selection):</p>

<blockquote>
  <p>Wall-E<br /><strong>m/dd/yyyy</strong><br />
  "blank string"</p>
</blockquote>

<p>What I would like to happen is that the entire entry is automatically and instantaneously selected when the user selects one line. As soon as this selection is complete, I would like the list box to return to single line selection so that the user cannot make multiple selections however, I also want the multi-line selection to remain visible. Namely, I must know how to toggle multi-line selections and also how to choose them using code (please, no VB.NET because my CS class uses outdated VB 6).</p>

<p>Thank you very much for taking the time to read this, and hopefully you can help me surmount this obstacle. Besides this, I am absolutely certain I can figure the rest out considering that I've already surpassed the courses expectations by dealing with files and classes. Once again, thank you for your time, as I know this is a relatively trivial distraction relating to an outdated language.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Aarowaim</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454345/vb-not-net-listboxes-auto-select-multiple-lines</guid>
		</item>
				<item>
			<title>VB autocomplete in SQL 2008</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454293/vb-autocomplete-in-sql-2008</link>
			<pubDate>Fri, 10 May 2013 03:55:18 +0000</pubDate>
			<description>Greeting, Can somebody help me with this code i don't know what is the problem here Dim str As String = &quot;SELECT DISTINCT FirstName,LastName FROM SessionMembers ORDER by FirstName, LastName asc&quot; Dim cmdStr As New SqlCommand(str, con) Dim dtreader As SqlDataReader = cmdStr.ExecuteReader() While dtreader.Read stringCols.AddRange(New String() {dtreader(0).ToString}) stringCols2.AddRange(New String() ...</description>
			<content:encoded><![CDATA[ <p>Greeting,</p>

<p>Can somebody help me with this code i don't know what is the problem here</p>

<pre><code class="language-vb">Dim str As String = "SELECT DISTINCT FirstName,LastName FROM SessionMembers ORDER by FirstName, LastName asc"
        Dim cmdStr As New SqlCommand(str, con)
        Dim dtreader As SqlDataReader = cmdStr.ExecuteReader()

        While dtreader.Read
            stringCols.AddRange(New String() {dtreader(0).ToString})
            stringCols2.AddRange(New String() {dtreader(1).ToString})
        End While
        dtreader.Close()
        LastNameTF.AutoCompleteCustomSource = stringCols2
        FirstNameTF.AutoCompleteCustomSource = stringCols
        FirstNameTF.AutoCompleteMode = AutoCompleteMode.SuggestAppend
        LastNameTF.AutoCompleteMode = AutoCompleteMode.SuggestAppend
        con.Close()
</code></pre>

<p>Thank you in advance.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Aven.Seven</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454293/vb-autocomplete-in-sql-2008</guid>
		</item>
				<item>
			<title>MDI Child Form Load will Not Fire</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454281/mdi-child-form-load-will-not-fire</link>
			<pubDate>Thu, 09 May 2013 23:05:44 +0000</pubDate>
			<description>Hi all I have a Mdi Child Fom being oppened from the parent the form opens but the Load event will not fire UP. Doesn't the load event suppose to fire up every time the form is opened? Here isthe code usedto open the form from the Parent and also ...</description>
			<content:encoded><![CDATA[ <p>Hi all<br />
I have a Mdi Child Fom being oppened from the parent the form opens but the Load event will not fire UP.<br />
Doesn't the load event suppose to fire up every time the form is opened?<br />
Here isthe code usedto open the form from the Parent and also the load even of the child form.</p>

<pre><code class="language-vb"> Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim mdiChildForm As New Input_frm
        mdiChildForm.MdiParent = Me
        If Not CheckIfOpen("Input_frm") Then
            mdiChildForm.Show()
        End If
    End Sub

      Private Sub Input_frm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        MsgBox("Loaded")
    End Sub
</code></pre>

<p>Thanks In Advance</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>VIPER5646</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454281/mdi-child-form-load-will-not-fire</guid>
		</item>
				<item>
			<title>Validate the username if it is available or not</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454245/validate-the-username-if-it-is-available-or-not</link>
			<pubDate>Thu, 09 May 2013 13:22:01 +0000</pubDate>
			<description>Greetings guys can you help me with this one, i want to validate if the username is already taken or not yet but i don't have a clue on how to do it. i tried this code dtCustomer.Rows.Count &gt; 0 but it didn't work @_@.. please guys i really need ...</description>
			<content:encoded><![CDATA[ <p>Greetings guys can you help me with this one,</p>

<p>i want to validate if the username is already taken or not yet but i don't have a clue on how to do it.</p>

<p>i tried this code</p>

<p>dtCustomer.Rows.Count &gt; 0</p>

<p>but it didn't work @_@.. please guys i really need help thanks in advance :D.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Aven.Seven</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454245/validate-the-username-if-it-is-available-or-not</guid>
		</item>
				<item>
			<title>Password in visual basic</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454198/password-in-visual-basic</link>
			<pubDate>Wed, 08 May 2013 21:49:35 +0000</pubDate>
			<description>I am currently creating a game. Everything in this game works great. To reset the highscores you click on a button and an input box pops up asking for your admin number. If the number is entered correctly the text files containing the highscores are deleted and blank ones replace ...</description>
			<content:encoded><![CDATA[ <p>I am currently creating a game. Everything in this game works great. To reset the highscores you click on a button and an input box pops up asking for your admin number. If the number is entered correctly the text files containing the highscores are deleted and blank ones replace them.I was wondering if it is possible to have the text change into a dot after entering another character, just like most logins do. Any help??</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>schroaus</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454198/password-in-visual-basic</guid>
		</item>
				<item>
			<title>High Score Between Program Runs</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454101/high-score-between-program-runs</link>
			<pubDate>Tue, 07 May 2013 13:25:21 +0000</pubDate>
			<description>Recently, I have been working on games in my programming class. In this class I am farther ahead then most other students, and so, must rely on the internet for help instead of my teacher. I have been working on a highscore counter between runs that I should be able ...</description>
			<content:encoded><![CDATA[ <p>Recently, I have been working on games in my programming class. In this class I am farther ahead then most other students, and so, must rely on the internet for help instead of my teacher. I have been working on a highscore counter between runs that I should be able to use in all of my games. So far, I have it so it works the first time without any errors but the second time it says that I am outside the index in the line Return Lines(Line number - 1). I am not sure how to fix this error. In this program Button1 would be activated every time a new score is entered and button 6 is the button that is used to end the program. I do not know if I am overcomplicating my highscore system and in reality it is a really simple thing to code. If anyone can help me fix this, PLEASE HELP. Also, if anyone knows how to simplify this, that would be very much appreciated. If possible, I would like to stick to using text files, because I do not have much experience with any other kind.<br />
This is my code so far.</p>

<pre><code class="language-vb">Public Class Form1
    Dim FName() As String
    Dim Age(2) As Integer
    Dim path As String
    Dim Tb As String
    Dim x As Integer

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If My.Computer.FileSystem.FileExists("previous.txt") Then
            Do
                Label2.Text = My.Computer.FileSystem.ReadAllText("previous.txt")
            Loop Until Label2.Text = My.Computer.FileSystem.ReadAllText("previous.txt")
        Else : My.Computer.FileSystem.WriteAllText("previous.txt", "", True)
        End If
        My.Computer.FileSystem.DeleteFile("previous.txt")
        My.Computer.FileSystem.WriteAllText("x.txt", "0", True)
        My.Computer.FileSystem.WriteAllText("Numbers.txt", Environment.NewLine + "0", True)
        If Val(ReadLastLineOfFile("x.txt")) = 0 Then My.Computer.FileSystem.WriteAllText("x.txt", Environment.NewLine + "3", True)
        x = Val(ReadLastLineOfFile("x.txt"))
        Dim strLastLine As String
        strLastLine = ReadLastLineOfFile("x.txt")
    End Sub

    Function ReadLastLineOfFile(ByVal sFileName As String) As String
        Dim objFSO, TS
        Dim sTmpContents As String
        objFSO = CreateObject("Scripting.FileSystemObject")
        TS = objFSO.OpenTextFile("x.txt", 1)
        sTmpContents = TS.ReadAll
        TS.Close()
        TS = Nothing
        objFSO = Nothing
        ReadLastLineOfFile = Split(sTmpContents, vbCrLf)(UBound(Split(sTmpContents, vbCrLf)))
    End Function

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        My.Computer.FileSystem.WriteAllText("Numbers.txt", Environment.NewLine + TextBox1.Text, True)
        Dim reader As New System.IO.StreamReader("Numbers.txt")
        Dim allLines As List(Of String) = New List(Of String)
        Do While Not reader.EndOfStream
            allLines.Add(reader.ReadLine())
        Loop
        reader.Close()
        If Val(ReadLine(x, allLines)) &gt; Val(Label2.Text) Then Label2.Text = ReadLine(x, allLines)
        x = x + 1
    End Sub
    Public Function ReadLine(ByVal lineNumber As Integer, ByVal lines As List(Of String)) As String
        Return lines(lineNumber - 1)
    End Function

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        My.Computer.FileSystem.WriteAllText("x.txt", Environment.NewLine + (x.ToString), True)
        My.Computer.FileSystem.WriteAllText("previous.txt", Environment.NewLine + Label2.Text, True)
        End
    End Sub
End Class
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>schroaus</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454101/high-score-between-program-runs</guid>
		</item>
				<item>
			<title>sql stored proceedures</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454058/sql-stored-proceedures</link>
			<pubDate>Tue, 07 May 2013 02:08:36 +0000</pubDate>
			<description>Hi group, If you've seen my posts before on SQL Server stuff you know I'm a &quot;raw rookie&quot; with this. Again, I need some help. I'm going to need SQL to create an order number for me. I've created a datatable with two fields: OrderNoID (key) and OrderNumber. I've already ...</description>
			<content:encoded><![CDATA[ <p>Hi group,</p>

<p>If you've seen my posts before on SQL Server stuff you know I'm a "raw rookie" with this.  Again, I need some help.</p>

<p>I'm going to need SQL to create an order number for me.  I've created a datatable with two fields: OrderNoID (key) and OrderNumber.  I've already added the lowest order number I would use as the first line of the table (100000).  I new need to do these steps in this order:</p>

<p>1) "lock" the data table.  (I want to prevent anyone from accessing this table until the routine is completed)<br />
2) Find the highest (or top) OrderNoID.<br />
3) From this top ID number, get the OrderNumber<br />
4) Add OrderNumber plus 1 creating a new OrderNumber<br />
5) Create the next OrderNoID (and row) and insert this new OrderNumber<br />
6) Return the new OrderNoID and new OrderNumber values to be read by a variable in Visual Basic.<br />
7) Unlock the data table and close the proceedure (if that's required)</p>

<p>I've read through several articles but I'm unclear how to write such a proceedure as well as to name it and store it.  Can someone help me through this?</p>

<p>In advance, thanks for your help!</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454058/sql-stored-proceedures</guid>
		</item>
				<item>
			<title>Data validation for program</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/454054/data-validation-for-program</link>
			<pubDate>Mon, 06 May 2013 23:36:25 +0000</pubDate>
			<description>I'm trying to add in data validation for my program so it doesnt die when a user input the wrong type of data. eg. My program collects numbers and stores them against the selected name but if i input say fish instead of 2000 in the textbox my program dies. ...</description>
			<content:encoded><![CDATA[ <p>I'm trying to add in data validation for my program so it doesnt die when a user input the wrong type of data. eg. My program collects numbers and stores them against the selected name but if i input say fish instead of 2000 in the textbox my program dies.</p>

<p>Could someone let me know how to validate this.</p>

<pre><code class="language-vb">Public Class Form1
    'Declares 2 arrays with a maximum of 4 entries
    Dim strtotals(3) As String
    Dim strsales(3) As String
    Dim intPasswordCounter As Integer = 0


Private Sub btnDisplayTotals_Click(sender As System.Object, e As System.EventArgs) Handles btnDisplayTotals.Click
        'Validate the password first thing, then exit if it returns false
        If Not ValidPassword Then Exit Sub

        ' Variables for handing data        
        Dim strIncomes2(3) As String
        Dim sngSalary(3) As Single
        Dim sngMax As Single
        Dim sngSal As Single
        Dim strEmployee As String
        Dim strTotal(3) As String
        Const Commission As Decimal = 0.015
        Const Pay As Single = 400
        strEmployee = ""
        sngSal = 0
        For i = 0 To 3
            'Calculations
            If strsales(i) &lt;&gt; 0 Then
                strTotal(i) = Str(strsales(i))
                sngSalary(i) = Pay + Int(strsales(i)) * Commission
            Else
                strTotal(i) = 0
                sngSalary(i) = Pay
            End If
            strIncomes2(i) = Str(sngSalary(i))
            If sngSalary(i) &gt; sngSal Then
                sngMax = sngSalary(i)
                strEmployee = lstNames.Items(i)
            End If
            sngSal = sngSalary(i)
            strtotals(i) = "Sales Total for " + lstNames.Items(i) + " is $" + strTotal(i) + " Salary is $" + strIncomes2(i) + vbNewLine
        Next
        lblMessage1.Text = strtotals(0) + strtotals(1) + strtotals(2) + strtotals(3) + "The Highest Salary was $" + Str(sngMax) + " by " + strEmployee
    End Sub

    Private Function ValidPassword() As Boolean

        'Initialize the function to return false.  
        'The return value will only change if the correct password is entered
        ValidPassword = False

        For i = 0 To 2
            Dim strPassword As String = InputBox("Please Enter a Valid Password", "Password Input")
            If strPassword = "admin" Then
                'Got the right password force a return with a value of True
                Return True
            End If
        Next
        'function didn't return yet, so user must have taken too many tries.
        MsgBox("Exceeded maximum attempts... Ending")
        End
    End Function


    Private Sub btnSale_Click(sender As System.Object, e As System.EventArgs) Handles btnSale.Click
        'Sale(lstNames.SelectedIndex).intSales += Val(txtSales.Text)
        For i = 0 To 3
            If lstNames.SelectedIndex = i Then
                strsales(i) = txtSales.Text                   'Stores Sales data with the selected list name
                txtSales.Text = ""
            End If
        Next
    End Sub

    Private Sub btnEnd_Click(sender As System.Object, e As System.EventArgs) Handles btnEnd.Click
        End
    End Sub
End Class
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>ChargrO</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/454054/data-validation-for-program</guid>
		</item>
				<item>
			<title>Dividing by zero Message Error.</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453982/dividing-by-zero-message-error</link>
			<pubDate>Mon, 06 May 2013 06:20:02 +0000</pubDate>
			<description>I'm writing a code to build a advance calculator, I got everything BESIDES putting a message error that says: &quot;Cannot divide by zero.&quot; in the dividebutton I just have a really hard time coding a message error... Thanks!</description>
			<content:encoded><![CDATA[ <p>I'm writing a code to build a advance calculator, I got everything BESIDES putting a message error that says: "Cannot divide by zero." in the dividebutton I just have a really hard time coding a message error...</p>

<p>Thanks!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Jockster</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453982/dividing-by-zero-message-error</guid>
		</item>
				<item>
			<title>Help Needed Lunch Order</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453948/help-needed-lunch-order</link>
			<pubDate>Sun, 05 May 2013 14:08:05 +0000</pubDate>
			<description>Well at this point I think it's safe to say coding is not my thing, have another problem I am working on, have the code close to correct I believe, problem, when one of the radio buttons is selected, there should be another groupbox that shows (depending on which radio ...</description>
			<content:encoded><![CDATA[ <p>Well at this point I think it's safe to say coding is not my thing, have another problem I am working on, have the code close to correct I believe, problem, when one of the radio buttons is selected, there should be another groupbox that shows (depending on which radio button) that you can select check boxes from (items), once selections are made you select place order and it displays the correct values. For what ever reason I can not get the values, nor the groupbox with items to display to select from. What am I doing wrong? Thanks in advance!</p>

<pre><code class="language-vb">Partial Public Class frmLunchOrders
    Inherits Form
    Public Sub New()
        InitializeComponent()

    End Sub
    Private Sub radHamburger_CheckedChanged(sender As Object, e As EventArgs)

        If radHamburger.Checked = True Then
            lstOrderDetails.Visible = False

            chkLettuce.Visible = True
            chkKetchup.Visible = True
            chkFrench.Visible = True

            txtSubtotal.Text = ""
            txtTax.Text = ""
            txtOrderTotal.Text = ""
            chkLettuce.Text = "Lettuce, Tomato, and Onions"
            chkKetchup.Text = "Ketchup, Mustard, and Mayo"
            chkFrench.Text = "French Fires"
            grpAddHamburger.Text = "Add-on items ($.75/each)"

            chkLettuce.Checked = False
            chkKetchup.Checked = False

            chkFrench.Checked = False
        End If

    End Sub

    Private Sub radPizza_CheckedChanged(sender As Object, e As EventArgs)
        If radPizza.Checked = True Then
            lstOrderDetails.Visible = False

            chkPepperoni.Visible = True
            chkSausage.Visible = True
            chkOlives.Visible = True
            txtSubtotal.Text = ""
            txtTax.Text = ""
            txtOrderTotal.Text = ""
            chkPepperoni.Text = "Pepperoni"
            chkSausage.Text = "Sausage"
            chkOlives.Text = "Olives"
            grpAddPizza.Text = "Add-on items ($.50/each)"

            chkPepperoni.Checked = False
            chkSausage.Checked = False
            chkOlives.Checked = False
        End If
    End Sub


    Private Sub radSalad_CheckedChanged(sender As Object, e As EventArgs)
        If radSalad.Checked = True Then
            lstOrderDetails.Visible = False

            chkCroutons.Visible = True
            chkBacon.Visible = True
            chkBread.Visible = True

            txtSubtotal.Text = ""
            txtTax.Text = ""
            txtOrderTotal.Text = ""
            chkCroutons.Text = "Croutons"
            chkBacon.Text = "Bacon Bits"
            chkBread.Text = "Bread Sticks"
            grpAddSalad.Text = "Add-on items ($.25/each)"

            chkCroutons.Checked = False
            chkBacon.Checked = False
            chkBread.Checked = False
        End If
    End Sub

    Private Sub btnPlaceOrder_Click(sender As Object, e As EventArgs)

        lstOrderDetails.Visible = True
        btnPlace.Visible = False
        grpMain.Visible = False

        If radHamburger.Checked = True Then

            lstOrderDetails.Items.Add("Hamburger - $6.95")
            Dim subtotal As Double = 6.95

            Dim addOnItems As Double = 0
            If chkLettuce.Checked = True Then
                lstOrderDetails.Items.Add("Lettuce, Tomato, Onion - $0.75")
                addOnItems = addOnItems + 0.75
            End If
            If chkKetchup.Checked = True Then
                lstOrderDetails.Items.Add("Ketchup, Mustard, Mayo - $0.75")
                addOnItems = addOnItems + 0.75
            End If
            If chkFrench.Checked = True Then
                lstOrderDetails.Items.Add("French Fries - $0.75")
                addOnItems = addOnItems + 0.75
            End If



            subtotal = (subtotal + addOnItems)
            Dim tax As Double = subtotal * 0.0775
            Dim orderTotal As Double = subtotal + tax



            txtSubtotal.Text = subtotal.ToString("c")
            txtTax.Text = tax.ToString("c")


            txtOrderTotal.Text = orderTotal.ToString("c")

            lstOrderDetails.Items.Add("---------------------------------------------")
        End If

        If radPizza.Checked = True Then
            lstOrderDetails.Items.Add("Cheese Pizza - $5.95")

            Dim subtotal As Double = 5.95

            Dim addOnItems As Double = 0
            If chkPepperoni.Checked = True Then
                lstOrderDetails.Items.Add("Add Pepperoni - $0.50")
                addOnItems = addOnItems + 0.5
            End If
            If chkSausage.Checked = True Then
                lstOrderDetails.Items.Add("Add Sausage - $0.50")
                addOnItems = addOnItems + 0.5
            End If
            If chkOlives.Checked = True Then
                lstOrderDetails.Items.Add("Add Olives - $0.50")
                addOnItems = addOnItems + 0.5
            End If

            subtotal = (subtotal + addOnItems)

            Dim tax As Double = subtotal * 0.0775
            Dim orderTotal As Double = subtotal + tax


            txtSubtotal.Text = subtotal.ToString("c")
            txtTax.Text = tax.ToString("c")
            txtOrderTotal.Text = orderTotal.ToString("c")

            lstOrderDetails.Items.Add("---------------------------------------------")
        End If

        If radSalad.Checked = True Then
            lstOrderDetails.Items.Add("Salad - $4.95")

            Dim subtotal As Double = 4.95

            Dim addOnItems As Double = 0
            If True Then
                If chkCroutons.Checked = True Then
                    lstOrderDetails.Items.Add("Add Croutons - $0.25")
                End If
                addOnItems = addOnItems + 0.25
            End If
            If chkBacon.Checked = True Then
                lstOrderDetails.Items.Add("Add Bacon Bits - $0.25")
                addOnItems = addOnItems + 0.25
            End If
            If chkBread.Checked = True Then
                lstOrderDetails.Items.Add("Add Bread Sticks - $0.25")
                addOnItems = addOnItems + 0.25
            End If

            subtotal = (subtotal + addOnItems)

            Dim tax As Double = subtotal * 0.0775
            Dim orderTotal As Double = subtotal + tax



            txtSubtotal.Text = subtotal.ToString("c")
            txtTax.Text = tax.ToString("c")
            txtOrderTotal.Text = orderTotal.ToString("c")



            lstOrderDetails.Items.Add("---------------------------------------------")
        End If


        grpTotal.Text = "Order Details"

    End Sub
    Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
        Me.Close()
    End Sub
    Private Sub clearTotals(sender As Object, e As EventArgs)
        txtSubtotal.Text = ""
        txtTax.Text = ""
        txtOrderTotal.Text = ""
    End Sub

End Class
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Aerigon</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453948/help-needed-lunch-order</guid>
		</item>
				<item>
			<title>Creating a password function</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453940/creating-a-password-function</link>
			<pubDate>Sun, 05 May 2013 06:05:28 +0000</pubDate>
			<description>Hi guys I've been making a simple program using arrays and would like to add a function for a password instead of it being stored in one chunk of my button code. I'm not real good at functions yet and was wondering if someone could help me out. My code ...</description>
			<content:encoded><![CDATA[ <p>Hi guys<br />
I've been making a simple program using arrays and would like to add a function for a password instead of it being stored in one chunk of my button code. I'm not real good at functions yet and was wondering if someone could help me out. My code is working fine but the reason i would like it to be a function is for future development and just to teach myself more.</p>

<pre><code class="language-vb">Public Class Form1
    'Declares 2 arrays with a maximum of 4 entries
    Dim strtotals(3) As String
    Dim strsales(3) As String
    Dim intPasswordCounter As Integer = 0


    Private Sub btnDisplayTotals_Click(sender As System.Object, e As System.EventArgs) Handles btnDisplayTotals.Click
        ' Variables for handing data
        Dim strPassword As String
        Dim strIncomes2(3) As String
        Dim sngSalary(3) As Single
        Dim sngMaximum As Single
        Dim sngCurSal As Single
        Dim strEmployee As String
        Dim strTotal(3) As String
        Const Commission As Decimal = 0.015
        Const Pay As Single = 400
        strEmployee = ""

        'Code to prompt user for password 

        strPassword = InputBox("Please Enter a Valid Password", "Password Input")
        If strPassword = "admin" Then
            intPasswordCounter = 0
            sngCurSal = 0
            For i = 0 To 3

                'Calculations

                If strsales(i) &lt;&gt; 0 Then
                    strTotal(i) = Str(strsales(i))
                    sngSalary(i) = Pay + Int(strsales(i)) * Commission
                Else
                    strTotal(i) = 0
                    sngSalary(i) = Pay
                End If
                strIncomes2(i) = Str(sngSalary(i))
                If sngSalary(i) &gt; sngCurSal Then
                    sngMaximum = sngSalary(i)
                    strEmployee = lstNames.Items(i)
                End If
                sngCurSal = sngSalary(i)
                strtotals(i) = "Sales Total for " + lstNames.Items(i) + " is $" + strTotal(i) + " Salary is $" + strIncomes2(i) + vbNewLine
            Next
            lblMessage1.Text = strtotals(0) + strtotals(1) + strtotals(2) + strtotals(3) + "The Highest Salary was $" + Str(sngMaximum) + " by " + strEmployee

            'Password counter code

        Else
            intPasswordCounter += 1
            If intPasswordCounter &lt; 3 Then
                MsgBox("Incorrect Password Please Try Again")       'Message box that appears when the user inputs an incorrect password
            Else

                MsgBox("Too many attempts. Closing...")             'Message box that appears when the user inputs an incorrect password 3 times
                End
            End If
        End If


    End Sub

    Private Sub btnSale_Click(sender As System.Object, e As System.EventArgs) Handles btnSale.Click
        'Sale(lstNames.SelectedIndex).intSales += Val(txtSales.Text)
        For i = 0 To 3
            If lstNames.SelectedIndex = i Then
                strsales(i) = txtSales.Text                   'Stores Sales data with the selected list name
                txtSales.Text = ""
            End If
        Next
    End Sub

    Private Sub btnEnd_Click(sender As System.Object, e As System.EventArgs) Handles btnEnd.Click
        End
    End Sub
End Class
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>ChargrO</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453940/creating-a-password-function</guid>
		</item>
				<item>
			<title>importing date from EXCEL to sql</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453852/importing-date-from-excel-to-sql</link>
			<pubDate>Fri, 03 May 2013 14:27:00 +0000</pubDate>
			<description>Group, I'm trying to import an EXCEL table into an SQL Server Table. Although new to SQL, I've done it several times. However for the first time I'm having to import a column that is a date. I'm not sure how the EXCEL column should be formatted so that it ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>I'm trying to import an EXCEL table into an SQL Server Table.  Although new to SQL, I've done it several times.  However for the first time I'm having to import a column that is a date.  I'm not sure how the EXCEL column should be formatted so that it can be easily inserted into the sql table.  Should the EXCEL column be formated as a 'Date'?  If so, in what format ('mm/dd/yyyy', 'yyyy/mm/dd', 'mmddyyyy', 'yyyymmdd', etc.)?</p>

<p>In advance, thanks for all the help.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453852/importing-date-from-excel-to-sql</guid>
		</item>
				<item>
			<title>VB and Access and Excel</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453811/vb-and-access-and-excel</link>
			<pubDate>Fri, 03 May 2013 04:23:35 +0000</pubDate>
			<description>Today, I had a new project dropped on my desk and was informed that by the end of the week, I need to have exported the entire payroll into a new format. it exports to csv, which is then imported into access, and needs to be exported into a csv ...</description>
			<content:encoded><![CDATA[ <p>Today, I had a new project dropped on my desk and was informed that by the end of the week, I need to have exported the entire payroll into a new format.</p>

<p>it exports to csv, which is then imported into access, and needs to be exported into a csv or excel.<br />
Right now it looks like:</p>

<p><strong>|Emp Number| |Deduction1| |Deduction2| |Deduction3|</strong></p>

<p>and the format I need to turn it into:</p>

<p><strong>|Emp Number| |Deduction1|<br />
|Emp Number| |Deduction2|<br />
|Emp Number| |Deduction3|</strong></p>

<p>I've got everything loaded into datagrids in VB, but can't figure out how to get it from one format to the next. Anyone?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>404notfound</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453811/vb-and-access-and-excel</guid>
		</item>
				<item>
			<title>WPF: Doing storyboard animation before click event</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453775/wpf-doing-storyboard-animation-before-click-event</link>
			<pubDate>Thu, 02 May 2013 17:01:16 +0000</pubDate>
			<description>Hey Folks I've created a template and storyboard that applies to all buttons in my application. When you click the button, it drops to the right and down a bit, then snaps back up. The problem is, when I handle the click in code, it executes before (or during?) the ...</description>
			<content:encoded><![CDATA[ <p>Hey Folks</p>

<p>I've created a template and storyboard that applies to all buttons in my application. When you click the button, it drops to the right and down a bit, then snaps back up.</p>

<p>The problem is, when I handle the click in code, it executes before (or during?) the click event. The animation never happens in any case.</p>

<p>This is in my Application.xaml</p>

<pre><code class="language-vb">        &lt;Style TargetType="{x:Type Button}"&gt;
            &lt;Style.Resources&gt;
                &lt;Storyboard x:Key="OnClick1"&gt;
                    &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="{x:Null}"&gt;
                        &lt;EasingDoubleKeyFrame KeyTime="0" Value="2"/&gt;
                        &lt;EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0"/&gt;
                    &lt;/DoubleAnimationUsingKeyFrames&gt;
                    &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="{x:Null}"&gt;
                        &lt;EasingDoubleKeyFrame KeyTime="0" Value="2"/&gt;
                        &lt;EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0"/&gt;
                    &lt;/DoubleAnimationUsingKeyFrames&gt;
                &lt;/Storyboard&gt;
            &lt;/Style.Resources&gt;
            &lt;Style.Triggers&gt;
                &lt;EventTrigger RoutedEvent="ButtonBase.Click"&gt;
                    &lt;BeginStoryboard x:Name="OnClick1_BeginStoryboard" Storyboard="{StaticResource OnClick1}"/&gt;
                &lt;/EventTrigger&gt;
            &lt;/Style.Triggers&gt;
            &lt;Setter Property="RenderTransformOrigin" Value="0.5,0.5"/&gt;
            &lt;Setter Property="RenderTransform"&gt;
                &lt;Setter.Value&gt;
                    &lt;TransformGroup&gt;
                        &lt;ScaleTransform/&gt;
                        &lt;SkewTransform/&gt;
                        &lt;RotateTransform/&gt;
                        &lt;TranslateTransform/&gt;
                    &lt;/TransformGroup&gt;
                &lt;/Setter.Value&gt;
            &lt;/Setter&gt;
            &lt;Setter Property="SnapsToDevicePixels" Value="true"/&gt;
            &lt;Setter Property="OverridesDefaultStyle" Value="true"/&gt;
            &lt;Setter Property="MinHeight" Value="20"/&gt;
            &lt;Setter Property="MinWidth" Value="20"/&gt;
            &lt;Setter Property="Template"&gt;
                &lt;Setter.Value&gt;
                    &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
                        &lt;Border Name="Border"  
                        CornerRadius="2" 
                        BorderThickness="0"
                        Background="{TemplateBinding Background}"
                        BorderBrush="#404040"&gt;
                            &lt;ContentPresenter Margin="2" 
                                      HorizontalAlignment="Center"
                                      VerticalAlignment="Center" 
                                      RecognizesAccessKey="True"/&gt;
                        &lt;/Border&gt;
                    &lt;/ControlTemplate&gt;
                &lt;/Setter.Value&gt;
            &lt;/Setter&gt;
            &lt;Setter Property="Background"&gt;
                &lt;Setter.Value&gt;
                    &lt;ImageBrush Stretch="None"/&gt;
                &lt;/Setter.Value&gt;
            &lt;/Setter&gt;
        &lt;/Style&gt;
</code></pre>

<p>And this is in my MainServices.xaml.vb</p>

<pre><code class="language-vb">    Private Sub Button_New_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button_New.Click
        kioskConfirmIdentity.ShowMe(kioskNew_Scan)
        Me.Hide()
    End Sub
</code></pre>

<p>If I put nothing in my codebehind it works just fine, but if the Click event is fired the animation doesn't happen.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>ZeroZen</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453775/wpf-doing-storyboard-animation-before-click-event</guid>
		</item>
				<item>
			<title>Find character from the right side of a string</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453769/find-character-from-the-right-side-of-a-string</link>
			<pubDate>Thu, 02 May 2013 14:55:52 +0000</pubDate>
			<description>Group, I've learned to find the index number of a specific character within a string by writing dIndex = myText.IndexOf(&quot;|&quot;) Obviously, this start counting left to right. But I'd like to do the same but start counting from the right side of the string to the left to find the ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>I've learned to find the index number of a specific character within a string by writing</p>

<pre><code class="language-vb">dIndex = myText.IndexOf("|")
</code></pre>

<p>Obviously, this start counting left to right.  But I'd like to do the same but start counting from the right side of the string to the left to find the character.  Can this be done in VB?</p>

<p>If not, here's my delima:</p>

<p>I'm using a ComboBox that will house a list of printers to choose from.  This will be populated from info in a data table.  In the string of information in the ComboBox, I've put a "|" to indicate that the next character(s) will be the PrinterID (key) from the data table.  Preceeding this character are multiple spaces so these characters won't be seen when the user uses the ComboBox.  Since I don't know if the PrinterID will be '1' or '10' or '100', I've got to parse this number out.</p>

<p>In thinking out loud, if I can find the length of the string (lets call this 'sLength') and then the number of characters to the "|" (dIndex), I can do simple subtraction to find the number of "right" characters.</p>

<p>So, is there a "length" command to find the total number of characters in the string?</p>

<p>In advance, thanks.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453769/find-character-from-the-right-side-of-a-string</guid>
		</item>
				<item>
			<title>Database project needs to create new tables, access old tables</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453718/database-project-needs-to-create-new-tables-access-old-tables</link>
			<pubDate>Wed, 01 May 2013 20:33:27 +0000</pubDate>
			<description>I'm trying to visualize how this will be set up... I need my VB.NET application to read year 2013 values (Year, Employee, and Annual Performance Score) from a CSV file and write them to an Access DB. This DB is linked to my VB.NET project using a dataset. No problem, ...</description>
			<content:encoded><![CDATA[ <p>I'm trying to visualize how this will be set up... I need my VB.NET application to read year 2013 values (Year, Employee, and Annual Performance Score) from a CSV file and write them to an Access DB. This DB is linked to my VB.NET project using a dataset. No problem, I have done this before.</p>

<p>However, when the new performance scores are available in year 2014 and the user opens this application, I need it to create a new, identical Access DB (with no records) for 2014 and fill those values from the new CSV. Then I need the user to be able to select a year and have VB.NET connect to the appropriate DB so the user can look up historic values.</p>

<p>The key here is not the CSV read or the DB write, it is the creation of the new year's DB and the dynamic re-link of the dataset to the new DB.</p>

<p>Any thoughts on how to approach this? Thanks ahead of time!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>kindofsudden</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453718/database-project-needs-to-create-new-tables-access-old-tables</guid>
		</item>
				<item>
			<title>how to concatenate?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453693/how-to-concatenate</link>
			<pubDate>Wed, 01 May 2013 10:29:03 +0000</pubDate>
			<description>here is my code: this is my select query where I concatenated the firstname, lastname, and middle initial..(and display it on the data grid) Private Sub DisplayListOfPosition() query = &quot;SELECT profNo as 'No', CONCAT(profFName,', ', profLName, ' ', profMI,'.') as 'Name', profAddress as 'Address', gender as 'Gender' FROM tbl_professor_bs&quot; FillDBGrid(query, ...</description>
			<content:encoded><![CDATA[ <p>here is my code:</p>

<p>this is my select query where I concatenated the firstname, lastname, and middle initial..(and display it on the data grid)</p>

<pre><code class="language-vb">  Private Sub DisplayListOfPosition()
    query = "SELECT profNo as 'No', CONCAT(profFName,', ', profLName, ' ', profMI,'.') as 'Name', profAddress 
    as 'Address', gender as 'Gender' FROM tbl_professor_bs"
    FillDBGrid(query, Me.dgvProfessor_bs)
    Me.txtProfNo_bs.Enabled = False
  End Sub
</code></pre>

<p>I used cellclick on the other forms so that the data in the grid would display in textboxes.. my problem is, how would I display the concatenated columns in different textboxes?<br />
this is my code(unfinished):</p>

<pre><code class="language-vb">Private Sub dgvProfessor_bs_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvProfessor_bs.CellClick
        DefaultValue()
        Me.txtProfNo_bs.Text = Me.dgvProfessor_bs.Rows(e.RowIndex).Cells(0).Value.ToString()
        Me.txtProfFName_bs.Text = Me.dgvProfessor_bs.Rows(e.RowIndex).Cells(1).Value.ToString()
    End Sub
</code></pre>

<p>thank you in advance for your help! :)</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>ses03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453693/how-to-concatenate</guid>
		</item>
				<item>
			<title>change permissions of sql database</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453677/change-permissions-of-sql-database</link>
			<pubDate>Wed, 01 May 2013 03:53:58 +0000</pubDate>
			<description>hi, i m new to programming and i m trying to create a setup and deployment package for database application. after sucessfully creating setup, when i install it on my system, i m getting a error. i changed the permissions of the installed application folder, and it workd fine. is ...</description>
			<content:encoded><![CDATA[ <p>hi,<br />
i m new to programming and i m trying to create a setup and deployment package for database application. after sucessfully creating setup, when i install it on my system, i m getting a error.<br />
i changed the permissions of the installed application folder, and it workd fine.<br />
is there any way by which the setup will automatically change its permissions during installation</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>abrarsyed</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453677/change-permissions-of-sql-database</guid>
		</item>
				<item>
			<title>Send email error sendmail failed General mapi failure [2]</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453640/send-email-error-sendmail-failed-general-mapi-failure-2</link>
			<pubDate>Tue, 30 Apr 2013 11:08:54 +0000</pubDate>
			<description>I have an email programme that works sometimes, but mostly comes up with a general Mapi failure. I am at a loss as to the reason, but it may be a good idea to not use the mapi controls anymore if it is going to cause errors. I have looked ...</description>
			<content:encoded><![CDATA[ <p>I have an email programme that works sometimes, but mostly comes up with a general Mapi failure. I am at a loss as to the reason, but it may be a good idea to not use the mapi controls anymore if it is going to cause errors. I have looked at SMTP options using system.net.mail but I cant figure out how to send attachments, also it is nice to have a copy of the email in the default mail client which MAPI does. Anyone got any ideas as the best way to send emails using vb.net.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>UKnod</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453640/send-email-error-sendmail-failed-general-mapi-failure-2</guid>
		</item>
				<item>
			<title>csv with delimited to Mysql</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453621/csv-with-delimited-to-mysql</link>
			<pubDate>Tue, 30 Apr 2013 05:57:36 +0000</pubDate>
			<description>hello, my appreciating, if you give example code in my problem i have 1 file csv with dilimited only column A example column a name | address | phone | birthofdate deby | jersey | 123456 | 01-March-1990 my case is I want to convert to txt with delimited | ...</description>
			<content:encoded><![CDATA[ <p>hello, my appreciating, if you give example code in my problem<br />
i have 1 file csv with dilimited only column A<br />
example<br />
column a<br />
name | address | phone | birthofdate<br />
deby | jersey | 123456 | 01-March-1990</p>

<p>my case is<br />
I want to convert to txt with delimited | and then insert to Mysql table.<br />
basically I can separate delimited csv using excel and then insert to mysql by import.<br />
I hope I can create a program using vb.net and you can available to give me some code, please.</p>

<p>Thank you</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>nubie.net</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453621/csv-with-delimited-to-mysql</guid>
		</item>
				<item>
			<title>vb</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453580/vb</link>
			<pubDate>Mon, 29 Apr 2013 15:56:57 +0000</pubDate>
			<description>visualbasic assignment how to draw a multicolored worm! pliz help</description>
			<content:encoded><![CDATA[ <p>visualbasic assignment how to draw a multicolored worm! pliz help</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>arudhumbu</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453580/vb</guid>
		</item>
				<item>
			<title>DataGridView Number Detection</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453528/datagridview-number-detection</link>
			<pubDate>Sun, 28 Apr 2013 22:01:26 +0000</pubDate>
			<description>Hello. Could somebody explain why this code snippet is not working? The arrow (&lt;----) points to where it's going wrong. It goes wrong when building, with the error of: &quot;An error occurred creating the form. See Exception.InnerException for details. The error is: Index was out of range. Must be non-negative ...</description>
			<content:encoded><![CDATA[ <p>Hello.</p>

<p>Could somebody explain why this code snippet is not working?<br />
The arrow (&lt;----) points to where it's going wrong. It goes wrong when building, with the error of:<br />
"An error occurred creating the form. See Exception.InnerException for details.  The error is: Index was out of range. Must be non-negative and less than the size of the collection."</p>

<pre><code class="language-vb"> Private Sub DataTable_CellChanged(sender As Object, e As DataGridViewCellEventArgs) Handles DataTable.CellValueChanged
        If (e.ColumnIndex = 1) Then
            If (IsNumeric(DataTable.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) &lt;----) Then
                DataTable.Item(e.ColumnIndex, e.RowIndex).Value = 5
                DataTable.Item(e.ColumnIndex, e.RowIndex).Style.BackColor = Color.Red
            End If
        End If
    End Sub
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Unused Mass</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453528/datagridview-number-detection</guid>
		</item>
				<item>
			<title>Calculate reservation totals</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453519/calculate-reservation-totals</link>
			<pubDate>Sun, 28 Apr 2013 18:59:24 +0000</pubDate>
			<description>I have been working on a project that requires arrival date, departure date, number of nights, price per night and total price. I have everything working somewhat but can not seem to figure out how to get the last three items to display in the text boxes instead of a ...</description>
			<content:encoded><![CDATA[ <p>I have been working on a project that requires arrival date, departure date, number of nights, price per night and total price. I have everything working somewhat but can not seem to figure out how to get the last three items to display in the text boxes instead of a message box. What am I doing wrong? Below is what I have so far:</p>

<pre><code class="language-vb">Imports System.Text

Partial Public Class frmReservations
    Inherits Form
    Const pricePerNight As Integer = 115
    Public Sub New()
        InitializeComponent()
    End Sub
    Private Sub frmReservations_Load(sender As Object, e As EventArgs)
        txtDepart.Text = DateTime.Today.ToString("d")
        txtArrive.Text = DateTime.Today.AddDays(3).ToString("d")
    End Sub
    Private Sub btnCalculate_Click(sender As System.Object, e As System.EventArgs) Handles btnCalculate.Click

        Dim dtDepart As DateTime
        Dim dtArrive As DateTime
        If String.IsNullOrEmpty(txtDepart.Text) OrElse Not DateTime.TryParse(txtDepart.Text, dtDepart) Then
            MessageBox.Show("Invalid departure date!")
            Return
        End If
        If String.IsNullOrEmpty(txtArrive.Text) OrElse Not DateTime.TryParse(txtArrive.Text, dtArrive) Then
            MessageBox.Show("Invalid arrival date!")
            Return
        End If
        dtDepart = dtDepart.[Date]

        dtArrive = dtArrive.[Date]
        If dtDepart &lt; DateTime.Today Then
            MessageBox.Show("The departure date cannot be before today")
            Return
        End If

        If dtArrive &gt; dtDepart Then
            MessageBox.Show("The departure date cannot be before the departure date")
            Return
        End If

        Dim dtUpperBoundary As DateTime = DateTime.Today.AddDays(365 * 5)
        If dtDepart &gt; dtUpperBoundary Then
            MessageBox.Show("The departure date is more than 5 years in the future")
            Return
        End If
        If dtArrive &gt; dtUpperBoundary Then
            MessageBox.Show("The arrival date is more than 5 years in the future")
            Return
        End If

        If dtArrive = dtDepart Then
            MessageBox.Show("You cannot depart and arrive on the same date")
            Return
        End If
        'At this point the dates should be good
        Dim duration As Integer = Convert.ToInt32(Math.Ceiling(Math.Abs(dtArrive.Subtract(dtDepart).TotalDays))) + 1
        Dim price As Integer = duration * pricePerNight
        Dim sNumberOfDays As String = duration.ToString()
        Dim sArrivalDate As String = dtArrive.ToString("d")
        Dim sDeparture As String = dtDepart.ToString("d")
        Dim sTotalPrice As String = price.ToString("C2")
        Dim sb As New StringBuilder()
        sb.AppendLine("Number of days: " + sNumberOfDays)
        sb.AppendLine("Arrival Date: " + sArrivalDate)
        sb.AppendLine("Departure Date: " + sDeparture)
        sb.AppendLine("Total Price: " + sTotalPrice)
        MessageBox.Show(sb.ToString())

    End Sub
    Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
        Me.Close()
    End Sub
End Class
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Aerigon</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453519/calculate-reservation-totals</guid>
		</item>
				<item>
			<title>sql IDENTITY_INSERT</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453482/sql-identity_insert</link>
			<pubDate>Sun, 28 Apr 2013 04:28:42 +0000</pubDate>
			<description>Group, I'm trying to write the commands to update a row within a SQL table. I've written the following: USE DATADESIGNSOLUTIONS SET IDENTITY_INSERT LocationID ON INSERT INTO LOCATIONS_SETUP(LocationID, LocationNumber, LocationName, LocationAddress1, LocationAddress2, LocationAddress3, LocationCity, LocationState, LocationZipCode, LocationZipCodeExt, PhoneNumber, FaxNumber, BillToAnswer, BillToLocation) VALUES(10, 1, 'Traditions in Tile / Buford RDC', '4325 ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>I'm trying to write the commands to update a row within a SQL table.  I've written the following:</p>

<pre><code class="language-vb">USE DATADESIGNSOLUTIONS
SET IDENTITY_INSERT LocationID ON
INSERT INTO LOCATIONS_SETUP(LocationID, LocationNumber, LocationName, LocationAddress1, LocationAddress2, LocationAddress3, LocationCity, LocationState, LocationZipCode, LocationZipCodeExt, PhoneNumber, FaxNumber, BillToAnswer, BillToLocation)
VALUES(10, 1, 'Traditions in Tile / Buford RDC', '4325 Hamilton Mill Rd', '', '', 'Buford', 'GA', '30518', '', '(770) 831-5324', '(770) 831-6774', 'N', 36)
GO
</code></pre>

<p>I'm getting the following error:</p>

<p>"Cannot find the object "LocationID" because it does not exist or you do not have permissions."</p>

<p>I've confirmed the LocationID exists:</p>

<pre><code class="language-vb">LocationID  LocationNumber  LocationName                                LocationAddress1        LocationAddress2    LocationAddress3    LocationCity    LocationState   LocationZipCode LocationZipCodeExt  PhoneNumber         FaxNumber           BillToAnswer    BillToLocation
1           7               Traditions in Tile / Alpharetta Showroom    3065 Trotters Parkway                                           Alpharetta      GA              30004                               (770) 569-1883      (770) 569-9383      N               36
2           36              Traditions in Tile / Corporate              3065 Trotters Parkway                                           Alpharetta      GA              30004                               (770) 569-5232      (770) 569-9383      Y               36
10          1               Traditions in Tile / Buford RDC             4325 Hamilton Mill Rd                                           Buford          GA              30518                               (770) 831-5324      (770) 831-6774      N               36
</code></pre>

<p>Am I writing this correctly to allow the edit?  If I need "permissions", how is it that I get these?</p>

<p>In advance, thanks for your help.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453482/sql-identity_insert</guid>
		</item>
				<item>
			<title>Error when using ShowDialog()</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453476/error-when-using-showdialog</link>
			<pubDate>Sun, 28 Apr 2013 01:31:29 +0000</pubDate>
			<description>Group, I'm working to use a second for to do task that will be populate texts boxes in the first form. However I'm getting an error that says, &quot;An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>I'm working to use a second for to do task that will be populate texts boxes in the first form.  However I'm getting an error that says, "An error occurred creating the form. See Exception.InnerException for details.  The error is: Object reference not set to an instance of an object.</p>

<p>In Form1, where the code starts, the code looks like this:</p>

<pre><code class="language-vb">Public Sub cbxEditLocation_Click(sender As Object, e As System.EventArgs) Handles cbxEditLocation.Click
        cbxDeleteLocation.Checked = False
        cbxNewEntry.Checked = False
        cbxEditLocation.Checked = True
        sTask = 1
        Popup_LocationEdit.ShowDialog()
    End Sub
</code></pre>

<p>Form2 never opens, but it looks like this:</p>

<pre><code class="language-vb">Private Sub Popup_LocationEdit_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        If sTask = 1 Then
            txbFormType.Text = "Enter the Location to Edit"
        End If
        If sTask = 2 Then
            txbFormType.Text = "Enter the Location to Delete"
        End If
    End Sub
</code></pre>

<p>I've tried using "Popup_LocationEdit.Show()" with the same error message.  Can someone tell me what's going on here and how to fix it?  I know I've done this before.  But I don't recall having this kind of error.</p>

<p>Thanks for your help.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453476/error-when-using-showdialog</guid>
		</item>
				<item>
			<title>Array boundry and list box reset issues</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453473/array-boundry-and-list-box-reset-issues</link>
			<pubDate>Sat, 27 Apr 2013 23:21:28 +0000</pubDate>
			<description>Using Visual Basic 10, and I am trying to identify min/max statistics and display the results. My calculations are working, but the display is not (line 68 &amp; 80). With the way the code is written now, I don't get the error but my results are displayed as &quot;The minimum ...</description>
			<content:encoded><![CDATA[ <p>Using Visual Basic 10, and I am trying to identify min/max statistics and display the results. My calculations are working, but the display is not (line 68 &amp; 80). With the way the code is written now, I don't get the error but my results are displayed as "The minimum monthly rainfall was <em>correct result</em> ("<em>g</em>"). "g" should be the month that corresponds to the minimum monthly rainfall. The same issue occurs on the maximum display.</p>

<p>The line was initially written as   <em>lblMinMonthly.Text = ("The minimum monthly rainfall was " &amp; intMinRainfall.ToString() &amp; "(" &amp; strMonths(Me.intCount) &amp; ")")</em>   but received an index out of range exception error. Any suggestions on how to correct?</p>

<p>My second issue is that the btnClear_Click event clears my list box and labels (begins line 84), but the array does not reset itself. In order to enter a new set of monthly statistics I have to exit and rerun. Is there a simple fix?</p>

<p>Thanks</p>

<pre><code class="language-vb">Public Class Form1
    'Class level declarations
    Const intMAX_SUBSCRIPT As Integer = 11              'Upper subscript
    Dim intRainfall(intMAX_SUBSCRIPT) As Integer        'Holds rainfall array
    Dim strMonths() As String = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
    Dim intCount As Integer                             'Loop Counter

    Private Sub btnInput_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInput.Click
        'Prepare use for data entry
        MessageBox.Show("Please enter rainfall by month as an integer beginning with January.")

        Do While intCount &lt;= intMAX_SUBSCRIPT
            Try
                'Get monthly rainfall from user and store in an array
                intRainfall(intCount) = CInt(InputBox("Enter the rainfall for " &amp; strMonths(intCount)))

                'Increment intCount
                intCount += 1

            Catch ex As Exception
                'Error message for invalid input
                MessageBox.Show("Enter monthly rainfall as in integer.")
            End Try
        Loop

        'Clear the list box of its current contents
        lstRainfall.Items.Clear()

        'Display the rainfall listbox header
        lstRainfall.Items.Add("Monthly Rainfall Input")
        lstRainfall.Items.Add("--------------------------------")

        'Display each months rainfall
        For Me.intCount = 0 To strMonths.Length - 1
            lstRainfall.Items.Add(intRainfall(intCount).ToString() &amp; " for " &amp; strMonths(intCount))
        Next
    End Sub

    Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
        Dim intTotalRainfall As Integer                     'Total annual rainfall
        Dim dblAverageRainfall As Double                    'Average annual rainfall
        Dim intMinRainfall As Integer                       'Mininum monthly rainfall
        Dim intMaxRainfall As Integer                       'Maximum monthly rainfall


        'Calculate and display the total annual rainfall
        For Me.intCount = 0 To (intRainfall.Length - 1)
            intTotalRainfall += intRainfall(intCount)
        Next

        lblTotalAnnual.Text = ("The total annual rainfall was " &amp; intTotalRainfall.ToString())

        'Calculate and display the average annual rainfall
        dblAverageRainfall = intTotalRainfall / intRainfall.Length
        lblAveMonthly.Text = ("The average monthly rainfall was " &amp; dblAverageRainfall.ToString())

        'Calculate and display the minimum  monthly rainfalls
        'Get first month's rainfall
        intMinRainfall = intRainfall(0)

        'Search for lowest monthly rainfall
        For Me.intCount = 1 To (intRainfall.Length - 1)
            If intRainfall(Me.intCount) &lt; intMinRainfall Then
                intMinRainfall = intRainfall(Me.intCount)
            End If
        Next

        lblMinMonthly.Text = ("The minimum monthly rainfall was " &amp; intMinRainfall.ToString() &amp; " (" &amp; strMonths.ToString(intCount) &amp; ")")

        'Calculate and display the maximum monthly rainfalls
        'Get first month's rainfall
        intMaxRainfall = intRainfall(0)

        'Search for highest monthly rainfall
        For Me.intCount = 1 To (intRainfall.Length - 1)
            If intRainfall(Me.intCount) &gt; intMaxRainfall Then
                intMaxRainfall = intRainfall(Me.intCount)
            End If
        Next
        lblMaxMonthly.Text = ("The maximum monthly rainfall was " &amp; intMaxRainfall.ToString() &amp; " (" &amp; strMonths.ToString(intCount) &amp; ")")

    End Sub

    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        'Clear the list box and statistics
        lstRainfall.Items.Clear()
        lblTotalAnnual.Text = String.Empty
        lblAveMonthly.Text = String.Empty
        lblMinMonthly.Text = String.Empty
        lblMaxMonthly.Text = String.Empty
    End Sub

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
        'Close the form
        Me.Close()
    End Sub
End Class
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>SLMQC</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453473/array-boundry-and-list-box-reset-issues</guid>
		</item>
				<item>
			<title>Merge two CSV files, column wise</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453349/merge-two-csv-files-column-wise</link>
			<pubDate>Fri, 26 Apr 2013 03:23:06 +0000</pubDate>
			<description>Hi, All, I am just wondering is this is doable. I've tried searching it in google but still no luck. I want to merge my 2 CSV files by column. For example: File: coded.csv &quot;Header A&quot;,&quot;Header B&quot;,&quot;Header C&quot; &quot;Data A&quot;,&quot;Data B&quot;,&quot;Data C&quot; &quot;Data A&quot;,&quot;Data B&quot;,&quot;Data C&quot; &quot;Data A&quot;,&quot;Data B&quot;,&quot;Data C&quot; ...</description>
			<content:encoded><![CDATA[ <p>Hi, All,</p>

<p>I am just wondering is this is doable. I've tried searching it in google but still no luck. I want to merge my 2 CSV files by column. For example:</p>

<p>File: coded.csv</p>

<pre><code class="language-vb">"Header A","Header B","Header C"
"Data A","Data B","Data C"
"Data A","Data B","Data C"
"Data A","Data B","Data C"
"Data A","Data B","Data C"
</code></pre>

<p>File: truth.csv</p>

<pre><code class="language-vb">"Header D","Header E","Header F"
"Data D","Data E","Data F"
"Data D","Data E","Data F"
"Data D","Data E","Data F"
"Data D","Data E","Data F"
</code></pre>

<p>Output should be: Final.csv</p>

<pre><code class="language-vb">"Header A","Header B""Header C","Header D","Header E","Header F"
"Data A","Data B","Data C","Data D","Data E","Data F"
"Data A","Data B","Data C","Data D","Data E","Data F"
"Data A","Data B","Data C","Data D","Data E","Data F"
"Data A","Data B","Data C","Data D","Data E","Data F"
</code></pre>

<p>Thanks in advance.</p>

<p>-renzlo</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>renzlo</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453349/merge-two-csv-files-column-wise</guid>
		</item>
				<item>
			<title>Getting the total amount</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453347/getting-the-total-amount</link>
			<pubDate>Fri, 26 Apr 2013 02:27:23 +0000</pubDate>
			<description>I want to get the total sum of the amount column. How can I display the total sum to the textbox total? Any possible way to do it? Please help. Thanks!</description>
			<content:encoded><![CDATA[ <p>I want to get the total sum of the amount column. How can I display the total sum to the textbox total? Any possible way to do it? Please help. Thanks!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Ann95</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453347/getting-the-total-amount</guid>
		</item>
				<item>
			<title>Using images located IN the application in picturebor</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453322/using-images-located-in-the-application-in-picturebor</link>
			<pubDate>Thu, 25 Apr 2013 17:02:58 +0000</pubDate>
			<description>I have trouble accesing images that are located IN the application (in solution explorer) What I want to do is theme options in one of my programs If TreeView1.SelectedNode.Name = &quot;wood&quot; Then main.background*.BackgroundImage= End If *PictureBox</description>
			<content:encoded><![CDATA[ <p>I have trouble accesing images that are located IN the application (in solution explorer)<br />
What I want to do is theme options in one of my programs</p>

<pre><code class="language-vb">If TreeView1.SelectedNode.Name = "wood" Then
            main.background*.BackgroundImage=
        End If
</code></pre>

<p>*PictureBox</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>DyO1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453322/using-images-located-in-the-application-in-picturebor</guid>
		</item>
				<item>
			<title>Printing DataGridView</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453289/printing-datagridview</link>
			<pubDate>Thu, 25 Apr 2013 08:27:00 +0000</pubDate>
			<description>I have a datagridview and I want to print my datagrid but the problem is I want to remove the horizontal line of the table. How can I do it? Here is my code Module DataGridViewPrinter Public DataGridViewToPrint As New DataGridView Public DefaultPageSettings As PageSettings = New PageSettings() Public WithEvents ...</description>
			<content:encoded><![CDATA[ <p>I have a datagridview and I want to print my datagrid but the problem is I want to remove the horizontal line of the table. How can I do it? Here is my code</p>

<pre><code class="language-vb">Module DataGridViewPrinter

    Public DataGridViewToPrint As New DataGridView

    Public DefaultPageSettings As PageSettings = New PageSettings()

    Public WithEvents DocToPrint As New PrintDocument

    Private lPageNo As String = ""
    Private sPageNo As String = ""
    Private oStringFormat As StringFormat
    Private oStringFormatComboBox As StringFormat
    Private oButton As Button
    Private oCheckbox As CheckBox
    Private oComboBox As ComboBox
    Private nTotalWidth As Int16
    Private nRowPos As Int16
    Private NewPage As Boolean
    Private nPageNo As Int16
    Private Header As String
    Private FooterComment As String = ""

    Public Sub StartPrint(ByVal GridToPrint As DataGridView, ByVal PrintAsLandscape As Boolean, ByVal ShowPrintPreview As Boolean, ByVal HeaderToPrint As String, ByVal CommentToPrint As String)

        DataGridViewToPrint = GridToPrint
        Header = HeaderToPrint
        FooterComment = CommentToPrint

        'DataGridViewToPrint.Columns(2).Visible = False ' Use to hide a col. (index no.)

        ' Set up Default Page Settings
        DocToPrint.DefaultPageSettings.Landscape = PrintAsLandscape

        DocToPrint.DefaultPageSettings.Margins.Left = 25
        DocToPrint.DefaultPageSettings.Margins.Right = 75
        DocToPrint.DefaultPageSettings.Margins.Top = 25
        DocToPrint.DefaultPageSettings.Margins.Bottom = 75

        DocToPrint.OriginAtMargins = True ' takes margins into account 

        If ShowPrintPreview = True Then

            Dim dlgPrintPreview As New EnhancedPrintPreviewDialog

            dlgPrintPreview.ClientSize = New System.Drawing.Size(600, 600)
            dlgPrintPreview.Document = DocToPrint ' Previews print
            dlgPrintPreview.ShowDialog()

        Else

            '  Allow the user to choose a printer and specify other settings.
            Dim dlgPrint As New PrintDialog

            With dlgPrint
                .AllowSelection = False
                .ShowNetwork = False
                .AllowCurrentPage = True
                .AllowSomePages = True
                .Document = DocToPrint
            End With

            '  If the user clicked OK, print the document.
            If dlgPrint.ShowDialog = Windows.Forms.DialogResult.OK Then
                DocToPrint.Print()
            End If

        End If

    End Sub

    Public Sub DocToPrint_BeginPrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles DocToPrint.BeginPrint

        oStringFormat = New StringFormat
        oStringFormat.Alignment = StringAlignment.Near
        oStringFormat.LineAlignment = StringAlignment.Center
        oStringFormat.Trimming = StringTrimming.EllipsisCharacter

        oStringFormatComboBox = New StringFormat
        oStringFormatComboBox.LineAlignment = StringAlignment.Center
        oStringFormatComboBox.FormatFlags = StringFormatFlags.NoWrap
        oStringFormatComboBox.Trimming = StringTrimming.EllipsisCharacter

        oButton = New Button
        oCheckbox = New CheckBox
        oComboBox = New ComboBox

        nTotalWidth = 0

        For Each oColumn As DataGridViewColumn In DataGridViewToPrint.Columns
            If oColumn.Visible = True Then ' Prints only Visible columns
                nTotalWidth += oColumn.Width
            End If
        Next

        nPageNo = 1
        NewPage = True
        nRowPos = 0

    End Sub

    Public Sub DocToPrint_EndPrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles DocToPrint.EndPrint
        'Not currently used
    End Sub

    Public Sub DocToPrint_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles DocToPrint.PrintPage

        Static oColumnLefts As New ArrayList
        Static oColumnWidths As New ArrayList
        Static oColumnTypes As New ArrayList
        Static nHeight As Int16

        Dim nWidth, i, nRowsPerPage As Int16
        Dim nTop As Int16 = e.MarginBounds.Top
        Dim nLeft As Int16 = e.MarginBounds.Left

        If nPageNo = 1 Then

            oColumnLefts.Clear()
            oColumnWidths.Clear()
            oColumnTypes.Clear()

            For Each oColumn As DataGridViewColumn In DataGridViewToPrint.Columns
                If oColumn.Visible = True Then
                    nWidth = CType(Math.Floor(oColumn.Width / nTotalWidth * nTotalWidth * (e.MarginBounds.Width / nTotalWidth)), Int16)

                    nHeight = e.Graphics.MeasureString(oColumn.HeaderText, oColumn.InheritedStyle.Font, nWidth).Height + 11

                    oColumnLefts.Add(nLeft)
                    oColumnWidths.Add(nWidth)
                    oColumnTypes.Add(oColumn.GetType)
                    nLeft += nWidth
                End If
            Next

        End If

        Do While nRowPos &lt; DataGridViewToPrint.Rows.Count - 1

            Dim oRow As DataGridViewRow = DataGridViewToPrint.Rows(nRowPos)

            If nTop + nHeight &gt;= e.MarginBounds.Height + e.MarginBounds.Top Then

                DrawFooter(e, nRowsPerPage)

                NewPage = True
                nPageNo += 1
                e.HasMorePages = True
                Exit Sub

            Else

                If NewPage Then

                    ' Draw Header
                    e.Graphics.DrawString(Header, New Font(DataGridViewToPrint.Font, FontStyle.Bold), Brushes.Black, e.MarginBounds.Left, e.MarginBounds.Top - e.Graphics.MeasureString(Header, New Font(DataGridViewToPrint.Font, FontStyle.Bold), e.MarginBounds.Width).Height - 13)

                    ' Draw Columns
                    nTop = e.MarginBounds.Top
                    i = 0
                    For Each oColumn As DataGridViewColumn In DataGridViewToPrint.Columns
                        If oColumn.Visible = True Then
                            e.Graphics.FillRectangle(New SolidBrush(Drawing.Color.LightGray), New Rectangle(oColumnLefts(i), nTop, oColumnWidths(i), nHeight))
                            e.Graphics.DrawRectangle(Pens.Black, New Rectangle(oColumnLefts(i), nTop, oColumnWidths(i), nHeight))
                            e.Graphics.DrawString(oColumn.HeaderText, oColumn.InheritedStyle.Font, New SolidBrush(oColumn.InheritedStyle.ForeColor), New RectangleF(oColumnLefts(i), nTop, oColumnWidths(i), nHeight), oStringFormat)
                            i += 1
                        End If

                    Next
                    NewPage = False

                End If

                nTop += nHeight
                i = 0
                For Each oCell As DataGridViewCell In oRow.Cells
                    If oCell.Visible = True Then
                        If oColumnTypes(i) Is GetType(DataGridViewTextBoxColumn) OrElse oColumnTypes(i) Is GetType(DataGridViewLinkColumn) Then

                            e.Graphics.DrawString(oCell.Value.ToString, oCell.InheritedStyle.Font, New SolidBrush(oCell.InheritedStyle.ForeColor), New RectangleF(oColumnLefts(i), nTop, oColumnWidths(i), nHeight), oStringFormat)

                        ElseIf oColumnTypes(i) Is GetType(DataGridViewButtonColumn) Then

                            oButton.Text = oCell.Value.ToString
                            oButton.Size = New Size(oColumnWidths(i), nHeight)
                            Dim oBitmap As New Bitmap(oButton.Width, oButton.Height)
                            oButton.DrawToBitmap(oBitmap, New Rectangle(0, 0, oBitmap.Width, oBitmap.Height))
                            e.Graphics.DrawImage(oBitmap, New Point(oColumnLefts(i), nTop))

                        ElseIf oColumnTypes(i) Is GetType(DataGridViewCheckBoxColumn) Then

                            oCheckbox.Size = New Size(14, 14)
                            oCheckbox.Checked = CType(oCell.Value, Boolean)
                            Dim oBitmap As New Bitmap(oColumnWidths(i), nHeight)
                            Dim oTempGraphics As Graphics = Graphics.FromImage(oBitmap)
                            oTempGraphics.FillRectangle(Brushes.White, New Rectangle(0, 0, oBitmap.Width, oBitmap.Height))
                            oCheckbox.DrawToBitmap(oBitmap, New Rectangle(CType((oBitmap.Width - oCheckbox.Width) / 2, Int32), CType((oBitmap.Height - oCheckbox.Height) / 2, Int32), oCheckbox.Width, oCheckbox.Height))
                            e.Graphics.DrawImage(oBitmap, New Point(oColumnLefts(i), nTop))

                        ElseIf oColumnTypes(i) Is GetType(DataGridViewComboBoxColumn) Then

                            oComboBox.Size = New Size(oColumnWidths(i), nHeight)
                            Dim oBitmap As New Bitmap(oComboBox.Width, oComboBox.Height)
                            oComboBox.DrawToBitmap(oBitmap, New Rectangle(0, 0, oBitmap.Width, oBitmap.Height))
                            e.Graphics.DrawImage(oBitmap, New Point(oColumnLefts(i), nTop))
                            e.Graphics.DrawString(oCell.Value.ToString, oCell.InheritedStyle.Font, New SolidBrush(oCell.InheritedStyle.ForeColor), New RectangleF(oColumnLefts(i) + 1, nTop, oColumnWidths(i) - 16, nHeight), oStringFormatComboBox)

                        ElseIf oColumnTypes(i) Is GetType(DataGridViewImageColumn) Then

                            Dim oCellSize As Rectangle = New Rectangle(oColumnLefts(i), nTop, oColumnWidths(i), nHeight)
                            Dim oImageSize As Size = CType(oCell.Value, Image).Size
                            e.Graphics.DrawImage(oCell.Value, New Rectangle(oColumnLefts(i) + CType(((oCellSize.Width - oImageSize.Width) / 2), Int32), nTop + CType(((oCellSize.Height - oImageSize.Height) / 2), Int32), CType(oCell.Value, Image).Width, CType(oCell.Value, Image).Height))

                        End If

                        e.Graphics.DrawRectangle(Pens.Black, New Rectangle(oColumnLefts(i), nTop, oColumnWidths(i), nHeight))

                        i += 1
                    End If
                Next

            End If

            nRowPos += 1
            nRowsPerPage += 1

        Loop

        DrawFooter(e, nRowsPerPage)

        e.HasMorePages = False

    End Sub

    Public Sub DrawFooter(ByVal e As System.Drawing.Printing.PrintPageEventArgs, ByVal RowsPerPage As Int32)

        Dim sPageNo As String = nPageNo.ToString + " of "

        If nPageNo = "1" Then

            lPageNo = Math.Ceiling((DataGridViewToPrint.Rows.Count - 1) / RowsPerPage).ToString()
            sPageNo = nPageNo.ToString + " of " + lPageNo

        Else

            sPageNo = nPageNo.ToString + " of " + lPageNo

        End If

        ' Right Align - User Name
        e.Graphics.DrawString(FooterComment, DataGridViewToPrint.Font, Brushes.Black, e.MarginBounds.Left + (e.MarginBounds.Width - e.Graphics.MeasureString(FooterComment, DataGridViewToPrint.Font, e.MarginBounds.Width).Width), e.MarginBounds.Top + e.MarginBounds.Height + 7)

        ' Left Align - Date/Time
        e.Graphics.DrawString(Now.ToLongDateString + " " + Now.ToShortTimeString, DataGridViewToPrint.Font, Brushes.Black, e.MarginBounds.Left, e.MarginBounds.Top + e.MarginBounds.Height + 7)

        ' Center - Page No. Info
        e.Graphics.DrawString(sPageNo, DataGridViewToPrint.Font, Brushes.Black, e.MarginBounds.Left + (e.MarginBounds.Width - e.Graphics.MeasureString(sPageNo, DataGridViewToPrint.Font, e.MarginBounds.Width).Width) / 2, e.MarginBounds.Top + e.MarginBounds.Height + 7)

    End Sub

End Module
</code></pre>

<p>Anyone who can help me?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Ann95</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453289/printing-datagridview</guid>
		</item>
				<item>
			<title>inserting character in between string</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453187/inserting-character-in-between-string</link>
			<pubDate>Wed, 24 Apr 2013 09:51:12 +0000</pubDate>
			<description> Dim Data1 As String Dim Data2 As String Dim sFinal As String Dim sLeft As String Dim sRight As String Dim quote As String quote = &quot;&quot;&quot;&quot; Data1 = rtb.SelectedText 'original string Data2 = &quot;&lt;font color=&quot; + quote + codenumber + quote + &quot;&gt;&quot; 'string to insert sLeft = Microsoft.VisualBasic.Left(Data1, ...</description>
			<content:encoded><![CDATA[ <pre><code class="language-vb">Dim Data1 As String
        Dim Data2 As String
        Dim sFinal As String
        Dim sLeft As String
        Dim sRight As String
        Dim quote As String
        quote = """"

        Data1 = rtb.SelectedText 'original string
        Data2 = "&lt;font color=" + quote + codenumber + quote + "&gt;" 'string to insert

        sLeft = Microsoft.VisualBasic.Left(Data1, Len(Data1) - rtb.SelectionStart + rtb.SelectionLength) 'get the left section before insert
        sRight = Microsoft.VisualBasic.Right(Data1, rtb.SelectionLength) 'get right section after insert

        sFinal = sLeft &amp; Data2 &amp; sRight 'make new string of left &amp; middle &amp; right
        rtb.SelectedText = sFinal + "&lt;/font&gt;"
</code></pre>

<p>I want to insert &lt;font color="#fontcode"&gt; before the selected text in rtb(richtextbox) and &lt;/font&gt; at the end of the selected text. This code adds the &lt;font....&gt; for only 3 characters from right. Please let me know what mistake i am making. Thank you</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>ppstyle</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453187/inserting-character-in-between-string</guid>
		</item>
				<item>
			<title>array by way of Split not working?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453164/array-by-way-of-split-not-working</link>
			<pubDate>Wed, 24 Apr 2013 03:35:07 +0000</pubDate>
			<description>Ok, me again. When I add the records into the database, I am getting the aryFields(#) instead the called index in the array. I look at everything and can't see why I'm not getting the desired data instead of the aryFields() written into the database. Uugh. Private Sub btnLoadFromText_Click(ByVal sender ...</description>
			<content:encoded><![CDATA[ <p>Ok, me again.  When I add the records into the database, I am getting the aryFields(#) instead the called index in the array.  I look at everything and can't see why I'm not getting the desired data instead of the aryFields() written into the database.  Uugh.</p>

<pre><code class="language-vb">Private Sub btnLoadFromText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoadFromText.Click
        'declare the database
        Dim db As New dbUpdt
        Dim strRecord As String    ' for each line (record) from the CSV file
        Dim aryFields() As String ' array to contain fields
        Dim strID As String       ' for the station ID
        'declare the source of the database file

        'create connection to the database
        db.openConnection("weather.mdb")
        'open &amp; read text
        Dim stationsFile As StreamReader = File.OpenText("stationsIn.csv")
        ' continue processing until I hit the end of CSV file
        Do Until stationsFile.EndOfStream

            ' read a record and split into fields
            strRecord = stationsFile.ReadLine
            aryFields = Split(strRecord, ",")

            ' Determine the value of the key field
            strID = aryFields(0)
            db.addRecord("stations", "StationID", "aryFields(0)")
            db.setField("stations", "StationID", "aryFields(0)", "StationName", "aryFields(1)")
            db.setField("stations", "StationID", "aryFields(0)", "State", "aryFields(2)")
        Loop
        ' read one line and store in database
    End Sub
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>dusto</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453164/array-by-way-of-split-not-working</guid>
		</item>
				<item>
			<title>sum up column trouble</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453151/sum-up-column-trouble</link>
			<pubDate>Tue, 23 Apr 2013 20:46:53 +0000</pubDate>
			<description>Hi guys, im having trouble summing up the column in my (unbound) datagridview, i can add to the DGV fine, but when trying to sum up a column it says &quot;Input string was not in a correct format.&quot; heres my code Private Sub btn_Add_Click(sender As System.Object, e As System.EventArgs) Handles ...</description>
			<content:encoded><![CDATA[ <p>Hi guys,<br />
im having trouble summing up the column in my (unbound) datagridview, i can add to the DGV fine, but when trying to sum up a column it says "Input string was not in a correct format."</p>

<p>heres my code</p>

<pre><code class="language-vb">  Private Sub btn_Add_Click(sender As System.Object, e As System.EventArgs) Handles btn_Add.Click
        DataGridView1.Rows.Add(cbox_Product.Text, tbox_Sale_Price.Text, tbox_Qty.Text, tbox_Discount.Text, tbox_SubTotal.Text)

        If DataGridView1.Rows.Count &gt; 0 Then
            tbox_Gross.Text = total().ToString("c")
        End If


    End Sub


Private Function Total() As Double
        Dim tot As Double = 0
        Dim i As Integer = 0
        For i = 0 To DataGridView1.Rows.Count - 1
            tot += Convert.ToDouble(DataGridView1.Rows(i).Cells(4).Value)
        Next i
        Return tot
    End Function
</code></pre>

<p>any ideas guys?<br />
cheers :)</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Sammys.Man</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453151/sum-up-column-trouble</guid>
		</item>
				<item>
			<title>Datagridview row color</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453079/datagridview-row-color</link>
			<pubDate>Tue, 23 Apr 2013 06:19:18 +0000</pubDate>
			<description>Hello Friend, i hope someone can help me to solve my problem, i already put my database on datagridview, but my boss dont want it in standard color, so now i dont now how to change it, can i change the color using datagridview or i need to use another ...</description>
			<content:encoded><![CDATA[ <p>Hello Friend,</p>

<p>i hope someone can help me to solve my problem, i already put my database on datagridview, but my boss dont want it in standard color, so now i dont now how to change it, can i change the color using datagridview or i need to use another tools like listview?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Hazuan Nazri</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453079/datagridview-row-color</guid>
		</item>
				<item>
			<title>Pulling from database, display in label</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453070/pulling-from-database-display-in-label</link>
			<pubDate>Tue, 23 Apr 2013 03:43:55 +0000</pubDate>
			<description>Ok, so this will be longwinded, but I'll try and explain what I'm trying to accomplish. Our form has 3 buttons. 1. Clear Database (Working) 2. Load database from Text File 3. Load listbox from database (I have this working) Our project has 2 forms, one being the form which ...</description>
			<content:encoded><![CDATA[ <p>Ok, so this will be longwinded, but I'll try and explain what I'm trying to accomplish.</p>

<p>Our form has 3 buttons.</p>

<ol><li>Clear Database (Working)</li>
<li>Load database from Text File</li>
<li>Load listbox from database (I have this working)</li>
</ol>

<p>Our project has 2 forms, one being the form which handles the button click events as well as the listbox selection event.  We made a template (dbUpdt) that will process a text file using the functions and subs.</p>

<p>My question:  In the selectindexchanged event directly below, what do I have to do to get the label text properties to display the field contents of the record?  I know "_dbDR" is not right, but I'm killing myself and I cant figure it out.</p>

<pre><code class="language-vb">       Private Sub lstStations_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstStations.SelectedIndexChanged
        Dim db As New dbUpdt
        ' setup Variables

        Dim strSQL As String      ' for the SQL command
        ' establish a connection to the DB and open it
        db.openConnection("weather.mdb")
        ' establish a connection to the DB
        ' set up the SQL statement and execute it
        strSQL = "SELECT * FROM stations " &amp; _
           "WHERE StationName='" &amp; lstStations.SelectedItem.ToString &amp; "'"
        ' feed the database the SQL command and execute it
        db.query(strSQL)
        ' if the record is found, display it in the text boxes
        If _dbDR.Read Then
            lblStationID.Text = _dbDR.Item("StationID").ToString
            lblStationName.Text = _dbDR.Item("StationName").ToString
            lblState.Text = _dbDR.Item("State").ToString
        Else
            MessageBox.Show("Record not found " &amp; lstStations.SelectedItem.ToString)
        End If

        ' close the database
        db.close()
    End Sub
</code></pre>

<p><strong>dbUpdt class</strong></p>

<pre><code class="language-vb">Imports System.Data.OleDb
''' &lt;summary&gt;
''' the dbUpdt class that we implement the Trmplate we created in order to process the text files and to add, create orr append a database
''' &lt;/summary&gt;
Public Class dbUpdt



    'Declare the necessary class level variables
    Dim _strSrc As String
    Dim _strConn As String
    Dim _dbConn As New OleDbConnection
    Dim _dbCmd As New OleDbCommand
    Dim _dbDR As OleDbDataReader

    ''' &lt;summary&gt;
    ''' This event opens the connection to the database.
    ''' &lt;/summary&gt;
    ''' &lt;param name="strVar"&gt;the source of the database file&lt;/param&gt;
    ''' &lt;remarks&gt;&lt;/remarks&gt;
    Public Sub openConnection(ByVal strVar As String)
        'initializes strSrc to the database file
        _strSrc = strVar

        _strConn = "Provider=Microsoft.Jet.OLEDB.4.0" &amp; _
            ";Data Source=" &amp; _strSrc &amp; _
            ";User ID=admin;Password="
        'opens the database
        _dbConn.ConnectionString = _strConn
        _dbConn.Open()
        _dbCmd.Connection = _dbConn
    End Sub

    ''' &lt;summary&gt;
    ''' closes the database
    ''' &lt;/summary&gt;
    Public Sub close()
        'close database
        _dbConn.Close()
    End Sub


    ''' &lt;summary&gt;
    ''' This method will clear the database
    ''' &lt;/summary&gt;
    ''' &lt;param name="strTable"&gt;the string of the table&lt;/param&gt;
    ''' &lt;remarks&gt;&lt;/remarks&gt;
    Public Sub deleteAll(ByVal strTable As String)
        'create a variable for the SQL statement
        Dim strSQL As String
        ' set up the SQL statement and execute it
        strSQL = "DELETE FROM stations"
        _dbCmd.CommandText = strSQL
        _dbCmd.ExecuteNonQuery()
        'close the database
        _dbConn.Close()
    End Sub

    ''' &lt;summary&gt;
    ''' This method will query the database base of the SQL string that is used
    ''' &lt;/summary&gt;
    ''' &lt;param name="strSQL"&gt;a string that will be used to execute a SQL statement&lt;/param&gt;
    Public Sub query(ByVal strSQL As String)
        'use SQL statement to retrieve desired records
        _dbCmd.CommandText = strSQL
        'reads the database
        _dbDR = _dbCmd.ExecuteReader()
    End Sub

    ''' &lt;summary&gt;
    ''' This function checks to see if there are more records to add to the database.
    ''' &lt;/summary&gt;
    ''' &lt;returns&gt;_dbDR.Read&lt;/returns&gt;
    ''' &lt;remarks&gt;&lt;/remarks&gt;
    Public Function moreRecords() As Boolean
        Return _dbDR.Read
    End Function

    ''' &lt;summary&gt;
    ''' this method will return the contents of a specific field in the curtrent record
    ''' &lt;/summary&gt;
    ''' &lt;param name="strFieldName"&gt;&lt;/param&gt;
    ''' &lt;returns&gt;StrRet: the field contents &lt;/returns&gt;
    ''' &lt;remarks&gt;&lt;/remarks&gt;
    Public Function getField(ByVal strFieldName As String) As String
        'declare the tempory variable
        Dim strRet As String
        'if there is no record to read
        If IsDBNull(_dbDR.Item(strFieldName)) Then
            'strRet will be empty
            strRet = ""
        Else
            'otherwise the strRet will be initialized with the derired field from the record
            strRet = CStr(_dbDR.Item(strFieldName))
        End If
        'returns the field contents
        Return strRet
    End Function

    ''' &lt;summary&gt;
    ''' This method will execute a SQL command that will add a record into the database
    ''' &lt;/summary&gt;
    ''' &lt;param name="strTable"&gt;the name of a table&lt;/param&gt;
    ''' &lt;param name="strKeyName"&gt;the value that we are using as a key&lt;/param&gt;
    ''' &lt;param name="strKeyContents"&gt;the value that we used as a key&lt;/param&gt;
    ''' &lt;remarks&gt;&lt;/remarks&gt;
    Public Sub addRecord(ByVal strTable As String, _
     ByVal strKeyName As String, _
     ByVal strKeyContents As String)
        'declare the SQL string
        Dim strSQL As String
        'insert the record
        strSQL = "INSERT INTO " &amp; strTable &amp; _
           " (" &amp; strKeyName &amp; ") VALUES ('" &amp; strKeyContents &amp; "')"
        'execute the SQL string
        _dbCmd.CommandText = strSQL
        'write to the database
        _dbCmd.ExecuteNonQuery()
    End Sub

    ''' &lt;summary&gt;
    ''' This method is used to write to a specific field in a specific record
    ''' &lt;/summary&gt;
    ''' &lt;param name="strTable"&gt;name of the table&lt;/param&gt;
    ''' &lt;param name="strKeyName"&gt;The name of the field that is used as a key&lt;/param&gt;
    ''' &lt;param name="strKeyContents"&gt;The value that you are looking for in the key&lt;/param&gt;
    ''' &lt;param name="strFieldName"&gt;The name of the field to be updated&lt;/param&gt;
    ''' &lt;param name="strFieldContents"&gt;The new value of the field to be updated&lt;/param&gt;
    Public Sub setField(ByVal strTable As String, _
     ByVal strKeyName As String, _
     ByVal strKeyContents As String, _
     ByVal strFieldName As String, _
     ByVal strFieldContents As String)
        'declare the SQL string
        Dim strSQL As String
        ' get rid of any stray quote marks
        strFieldContents = strFieldContents.Replace("'", "")
        'the SQL string that will write the field
        strSQL = "UPDATE " &amp; strTable &amp; " SET " &amp; _
           strFieldName &amp; "='" &amp; strFieldContents &amp; "' " &amp; _
           "WHERE " &amp; strKeyName &amp; "='" &amp; strKeyContents &amp; "'"
        'execute the SQL string
        _dbCmd.CommandText = strSQL
        'write to the database
        _dbCmd.ExecuteNonQuery()
    End Sub


End Class
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>dusto</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453070/pulling-from-database-display-in-label</guid>
		</item>
				<item>
			<title>programming an artistic warm</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/453025/programming-an-artistic-warm</link>
			<pubDate>Mon, 22 Apr 2013 13:01:24 +0000</pubDate>
			<description>drawing multi-colored warms on a vb form.an individual warm will consist of number of segments and segment will be a line of certain width and colour</description>
			<content:encoded><![CDATA[ <p>drawing multi-colored warms on a vb form.an individual warm will consist<br />
of number of segments and segment will be a line of certain width and colour</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>lucky banda</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/453025/programming-an-artistic-warm</guid>
		</item>
				<item>
			<title>Working with Buttons</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452970/working-with-buttons</link>
			<pubDate>Sun, 21 Apr 2013 16:58:01 +0000</pubDate>
			<description> Public Class Close Inherits Windows.Forms.Button Public Sub New() Me.Size = New System.Drawing.Point(25, 25) Me.FlatStyle = Windows.Forms.FlatStyle.Flat Me.BackgroundImage = My.Resources.CloseNormal Me.BackgroundImageLayout = Windows.Forms.ImageLayout.Stretch Me.BackColor = Drawing.Color.Transparent Me.Font = New System.Drawing.Font(&quot;Calibri&quot;, 10, Drawing.FontStyle.Regular, Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.ForeColor = Drawing.Color.Black Me.FlatAppearance.BorderColor = Drawing.Color.DeepSkyBlue Me.FlatAppearance.MouseDownBackColor = Drawing.Color.Transparent Me.FlatAppearance.MouseOverBackColor = Drawing.Color.Transparent Me.FlatAppearance.BorderSize = 0 End ...</description>
			<content:encoded><![CDATA[ <pre><code class="language-vb">Public Class Close
    Inherits Windows.Forms.Button

    Public Sub New()
        Me.Size = New System.Drawing.Point(25, 25)
        Me.FlatStyle = Windows.Forms.FlatStyle.Flat
        Me.BackgroundImage = My.Resources.CloseNormal
        Me.BackgroundImageLayout = Windows.Forms.ImageLayout.Stretch
        Me.BackColor = Drawing.Color.Transparent
        Me.Font = New System.Drawing.Font("Calibri", 10, Drawing.FontStyle.Regular, Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ForeColor = Drawing.Color.Black
        Me.FlatAppearance.BorderColor = Drawing.Color.DeepSkyBlue
        Me.FlatAppearance.MouseDownBackColor = Drawing.Color.Transparent
        Me.FlatAppearance.MouseOverBackColor = Drawing.Color.Transparent
        Me.FlatAppearance.BorderSize = 0
    End Sub

    Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
        Me.BackgroundImage = My.Resources.ClosePress
    End Sub

    Private Sub Button1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseEnter
        Me.BackgroundImage = My.Resources.CloseNormal
    End Sub

    Private Sub Button1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseHover
        Me.BackgroundImage = My.Resources.CloseHigh
    End Sub

    Private Sub Button1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseLeave
        Me.BackgroundImage = My.Resources.CloseNormal
    End Sub
End Class
</code></pre>

<p>I want to replace a button with another yet different button (eg. Maximise with RestoreDown). How can I do this?<br />
The code above is for making a custom button.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>IsaacMessi10</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452970/working-with-buttons</guid>
		</item>
				<item>
			<title>Skipping first line reading file</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452951/skipping-first-line-reading-file</link>
			<pubDate>Sun, 21 Apr 2013 05:23:43 +0000</pubDate>
			<description>Ok, I'm not sure how to format the readline to skip the header columns of the file that is being read in the code that I wrote/spliced in my class. I was wondering if anyone can point me in the right direction here. Thanks in advance! Private Sub btnLoadFromText_Click(ByVal sender ...</description>
			<content:encoded><![CDATA[ <p>Ok, I'm not sure how to format the readline to skip the header columns of the file that is being read in the code that I wrote/spliced in my class.  I was wondering if anyone can point me in the right direction here.</p>

<p>Thanks in advance!</p>

<pre><code class="language-vb">Private Sub btnLoadFromText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoadFromText.Click
        ' setup Variables
        Dim myRecord As String    ' for each line (record) from the CSV file
        Dim aryFields() As String ' array to contain fields
        Dim strID As String       ' for the station ID
        Dim strSQL As String      ' for the SQL command

        ' Open the CSV File
        Dim myFile As New StreamReader(_strFilePath)

        ' establish a connection to the DB and open it
        _dbConn.ConnectionString = _strConn
        _dbConn.Open()
        _dbCmd.Connection = _dbConn

        ' continue processing until I hit the end of CSV file
        Do Until myFile.EndOfStream

            ' read a record and split into fields
            myRecord = myFile.ReadLine

            aryFields = Split(myRecord, ",")

            ' Determine the value of the key field
            strID = aryFields(0)

            ' add a blank record into the database with a key field
            strSQL = "INSERT INTO stations (stationID) VALUES ('" &amp; strID &amp; "')"
            _dbCmd.CommandText = strSQL
            _dbCmd.ExecuteNonQuery()

            ' update the StationName
            strSQL = "UPDATE stations SET stationName='" &amp; aryFields(1) &amp; "' WHERE stationID='" &amp; strID &amp; "'"
            _dbCmd.CommandText = strSQL
            _dbCmd.ExecuteNonQuery()

            ' update the State
            strSQL = "UPDATE stations SET state='" &amp; aryFields(2) &amp; "' WHERE stationID='" &amp; strID &amp; "'"
            _dbCmd.CommandText = strSQL
            _dbCmd.ExecuteNonQuery()

        Loop

        ' Close the database
        _dbConn.Close()
    End Sub
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>dusto</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452951/skipping-first-line-reading-file</guid>
		</item>
				<item>
			<title>Rtb to html help</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452890/rtb-to-html-help</link>
			<pubDate>Sat, 20 Apr 2013 07:04:26 +0000</pubDate>
			<description>Hi, I am making a richtextbox to html convertor, I have added features like bold italic underline left align right align center align etc. I found a code to convert richtextbox to html but i am not sure how to use that function. Public Shared Function FromRtf(ByVal rtf As RichTextBox) ...</description>
			<content:encoded><![CDATA[ <p>Hi, I am making a richtextbox to html convertor, I have added features like bold italic underline left align right align center align etc. I found a code to convert richtextbox to html but i am not sure how to use that function.</p>

<pre><code class="language-vb">Public Shared Function FromRtf(ByVal rtf As RichTextBox) As String
        Dim b, i, u As Boolean
        b = False : i = False : u = False
        Dim fontfamily As String = "Arial"
        Dim fontsize As Integer = 12
        Dim htmlstr As String = String.Format("&lt;html&gt;{0}&lt;body&gt;{0}&lt;div style=""text-align: left;""&gt;&lt;span style=""font-family: Arial; font-size: 12pt;""&gt;", vbCrLf)
        Dim x As Integer = 0
        While x &lt; rtf.Text.Length
            rtf.Select(x, 1)
            If rtf.SelectionFont.Bold AndAlso (Not b) Then
                htmlstr &amp;= "&lt;b&gt;"
                b = True
            ElseIf (Not rtf.SelectionFont.Bold) AndAlso b Then
                htmlstr &amp;= "&lt;/b&gt;"
                b = False
            End If
            If rtf.SelectionFont.Italic AndAlso (Not i) Then
                htmlstr &amp;= "&lt;i&gt;"
                i = True
            ElseIf (Not rtf.SelectionFont.Italic) AndAlso i Then
                htmlstr &amp;= "&lt;/i&gt;"
                i = False
            End If
            If rtf.SelectionFont.Underline AndAlso (Not u) Then
                htmlstr &amp;= "&lt;u&gt;"
                u = True
            ElseIf (Not rtf.SelectionFont.Underline) AndAlso u Then
                htmlstr &amp;= "&lt;/u&gt;"
                u = False
            End If
            If fontfamily &lt;&gt; rtf.SelectionFont.FontFamily.Name Then
                htmlstr &amp;= String.Format("&lt;/span&gt;&lt;span style=""font-family: {0}; font-size: {0}pt;""&gt;", rtf.SelectionFont.FontFamily.Name, fontsize)
                fontfamily = rtf.SelectionFont.FontFamily.Name
            End If
            If fontsize &lt;&gt; rtf.SelectionFont.SizeInPoints Then
                htmlstr &amp;= String.Format("&lt;/span&gt;&lt;span style=""font-family: {0}; font-size: {0}pt;""&gt;", fontfamily, rtf.SelectionFont.SizeInPoints)
                fontsize = rtf.SelectionFont.SizeInPoints
            End If
            Dim curchar As String = rtf.SelectedText
            Select Case curchar
                Case vbCr, vbLf : curchar = "&lt;br /&gt;"
                Case "&amp;" : curchar = "&amp;amp;" : x += "&amp;amp;".Length - 1
                Case "&lt;" : curchar = "&amp;lt;" : x += "&amp;lt;".Length - 1
                Case "&gt;" : curchar = "&amp;gt;" : x += "&amp;gt;".Length - 1
                Case " " : curchar = "&amp;nbsp;" : x += "&amp;nbsp;".Length - 1
            End Select
            rtf.SelectedText = curchar
            x += 1
        End While
        Return htmlstr &amp; String.Format("&lt;/span&gt;{0}&lt;/body&gt;{0}&lt;/html&gt;", vbCrLf)
    End Function
</code></pre>

<p>Where do I call this function? How do use this function? Please help,its urgent!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>ppstyle</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452890/rtb-to-html-help</guid>
		</item>
				<item>
			<title>Namespace Error</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452848/namespace-error</link>
			<pubDate>Fri, 19 Apr 2013 14:24:55 +0000</pubDate>
			<description>Hello, I tried to use the textbox validation snippet available here - http://www.daniweb.com/software-development/vbnet/code/414248/textbox-validation# and Im getting this error. Please help :\ [IMG]http://i45.tinypic.com/9zxbvt.png[/IMG] Thank You</description>
			<content:encoded><![CDATA[ <p>Hello,<br />
I tried to use the textbox validation snippet available here - <a href="http://www.daniweb.com/software-development/vbnet/code/414248/textbox-validation#" rel="nofollow">http://www.daniweb.com/software-development/vbnet/code/414248/textbox-validation#</a><br />
and Im getting this error. Please help :\</p>

<p>[IMG]<a href="http://i45.tinypic.com/9zxbvt.png%5B/IMG%5D" rel="nofollow">http://i45.tinypic.com/9zxbvt.png[/IMG]</a></p>

<p>Thank You</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>san.ssj</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452848/namespace-error</guid>
		</item>
				<item>
			<title>Navigating between controls within a form</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452827/navigating-between-controls-within-a-form</link>
			<pubDate>Fri, 19 Apr 2013 07:54:33 +0000</pubDate>
			<description>Hi group, I recognize the today, most people navigate from control to control within a form with their mouse. However some old school people may want to use a &quot;enter&quot; key or a up, down, left or right arrow. I'm curious to know if these kinds of events (if that's ...</description>
			<content:encoded><![CDATA[ <p>Hi group,</p>

<p>I recognize the today, most people navigate from control to control within a form with their mouse.  However some old school people may want to use a "enter" key or a up, down, left or right arrow.  I'm curious to know if these kinds of events (if that's the right word to describe the use of these keys) can realistically used in Visual Basic.</p>

<p>As an example, I (or the user) can use the tab key to move from one box to the next.  But I have no way of going back one box (or two or three....) except by using the mouse to point and click.  What options are available within VB to do such?  Is this something that can be set in the properties on the controls?  Is this a "keydown" event that I'll need to write code for?</p>

<p>I'm interested in your thoughts and ideas as well as ways to to easily accomplish (if such exists) using these various keys to navigate with.</p>

<p>In advance, thanks for helping this newbie!</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452827/navigating-between-controls-within-a-form</guid>
		</item>
				<item>
			<title>Click 1 line of ListView to Populate 5 TextBoxes</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452818/click-1-line-of-listview-to-populate-5-textboxes</link>
			<pubDate>Fri, 19 Apr 2013 04:30:30 +0000</pubDate>
			<description>Group, I'm working with a ListView box for the first time. I've figured out how to populate it with data from a database. I now want to click one line of that ListView and have it return each of the five cells from that line into 5 textboxes. I've written ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>I'm working with a ListView box for the first time. I've figured out how to populate it with data from a database. I now want to click one line of that ListView and have it return each of the five cells from that line into 5 textboxes. I've written the following code that is failing:</p>

<pre><code class="language-vb">Private Sub lvPrinterSetup_Click(sender As Object, e As System.EventArgs) Handles lvPrinterSetup.Click
        Dim values As New List(Of String)
        If lvPrinterSetup.SelectedItems.Count &gt; 0 Then
            For Each item As ListViewItem.ListViewSubItem In lvPrinterSetup.SelectedItems(0).SubItems
                values.Add(item.Text)
                txbRow.Text = Convert.ToString(lvPrinterSetup.SelectedItems(0))
                txbPrinterName.Text = Convert.ToString(lvPrinterSetup.SelectedItems(1))
                txbPrinterName.Text = Convert.ToString(lvPrinterSetup.SelectedItems(2))
                txbPrinterNo.Text = Convert.ToString(lvPrinterSetup.SelectedItems(3))
                txbPrinterAddress.Text = Convert.ToString(lvPrinterSetup.SelectedItems(4))
            Next

        End If
End Sub
</code></pre>

<p>This is failing with error notes saying the .SelectedItems(1) "InvalidArgument=Value of '1' is not valid for 'index'. Parameter name: index"</p>

<p>I'm sure that 2 - 4 will fail as well too. Clearly I've written this incorrectly.  This is where my lack of programming knowledge and experience is showing up!!</p>

<p>So how do I get these 5 items from one line that I've clicked into the various textboxes?</p>

<p>In advance, thanks for your assistance</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452818/click-1-line-of-listview-to-populate-5-textboxes</guid>
		</item>
				<item>
			<title>Can&#039;t insert data into the database</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452765/cant-insert-data-into-the-database</link>
			<pubDate>Thu, 18 Apr 2013 13:30:52 +0000</pubDate>
			<description>Greetings guys i'm stuck in this problem for 2 days now can you guy tell me the problem? here's the code If errorMsgLbl.Text = &quot;Password match&quot; Then sqlCmd = New SqlCommand(&quot;INSERT INTO registered_cust_tbl([customer_fname], [customer_lname], [customer_DoB], [customer_Contact], [customer_Email], &quot; &amp; _ &quot; [customer_Address], [customer_Gender], [customer_Ailments], [customer_Username], [customer_Password], &quot; &amp; _ &quot; ...</description>
			<content:encoded><![CDATA[ <p>Greetings guys i'm stuck in this problem for 2 days now can you guy tell me the problem?</p>

<p>here's the code</p>

<pre><code class="language-vb">If errorMsgLbl.Text = "Password match" Then
                sqlCmd = New SqlCommand("INSERT INTO registered_cust_tbl([customer_fname], [customer_lname], [customer_DoB], [customer_Contact], [customer_Email], " &amp; _
                " [customer_Address], [customer_Gender], [customer_Ailments], [customer_Username], [customer_Password], " &amp; _
                " [customer_Secret_Question], [customer_Secret_Answer], [customer_Purpose], [customer_weightRcnt], [customer_heightRcnt], [customer_bmi], [customer_weightLossGain], [customer_weightUpdt]) " &amp; _
                " VALUES ('" &amp; firstNameTb.Text.Trim &amp; "', '" &amp; lastNameTb.Text.Trim &amp; "', '" &amp; DoBdtp.Text &amp; "', '" &amp; customerMPNo.Text &amp; "', '" &amp; _
                               emailTb.Text.Trim &amp; "', '" &amp; addressRtb.Text.Trim &amp; "', '" &amp; gender &amp; "', '" &amp; ailmentstxtBx.Text.Trim &amp; "', '" &amp; _
                               usernameTF.Text.Trim &amp; "', '" &amp; passwordTF.Text &amp; "', '" &amp; SecQuesBox.Text &amp; "', '" &amp; SecAnsBox.Text.Trim &amp; "', '" &amp; _
                               purpose &amp; "', '" &amp; numWeight.Text &amp; " " &amp; TypeOfWeight.Text &amp; "', '" &amp; numHeight.Text &amp; " " &amp; TypeOfHeight.Text &amp; "', '" &amp; TotalBmi.Text &amp; "', '" &amp; "0" &amp; "' , '" &amp; "0" &amp; "' )", getConnect())

                errorMsgLbl.Text = "Password match"
                msgLbl.Text = "Password match"
                msgLbl.ForeColor = Color.DarkGreen
                errorMsgLbl.ForeColor = Color.DarkGreen

                'sqlCmd.ExecuteNonQuery()
                MsgBox("You have successfully registered.")
                getConnect.Close()
            Else
            End If
</code></pre>

<p>I don't know the problem here.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Aven.Seven</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452765/cant-insert-data-into-the-database</guid>
		</item>
				<item>
			<title>Null Reference Expression was Unhandled</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452749/null-reference-expression-was-unhandled</link>
			<pubDate>Thu, 18 Apr 2013 09:58:54 +0000</pubDate>
			<description>hi .... im tring to insert a picture with some information to the database when i run the progaram it will display the bellow message NullRefaranceExprasion was Unhandle Object reference not set to an instance of an object. this is my full code is there is any mistake? Imports System.IO ...</description>
			<content:encoded><![CDATA[ <p>hi ....</p>

<p>im tring to insert a picture with some information to the database<br />
when i run the progaram it will display the bellow message</p>

<p>NullRefaranceExprasion was Unhandle<br />
Object reference not set to an instance of an object.</p>

<p>this is my full code<br />
is there is any mistake?</p>

<pre><code class="language-vb">Imports System.IO
Imports System.Configuration
Public Class Form8
    Dim A As String = ConfigurationSettings.AppSettings("Datapath")
    Dim con1 As New OleDb.OleDbConnection(A)
    Dim com111 As OleDb.OleDbCommand
    Dim dar As OleDb.OleDbDataReader
    Dim sqlrt As String




    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        TabControl1.SelectTab(TabPage1)
        Me.Hide()
        Form3.Show()

    End Sub

    Private Sub Form8_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Module1.connrtol()
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        Dim fsreader As New FileStream(OpenFileDialog1.FileName, FileMode.Open, FileAccess.Read)
        Dim breader As New BinaryReader(fsreader)

        Dim imgbuffer(fsreader.Length) As Byte
        breader.Read(imgbuffer, 0, fsreader.Length)
        fsreader.Close()


        sqlrt = "INSERT INTO Employee(EId,DNo,FName,MName,LName,Address_Line1,Address_Line2,Address_Line3,NIC,DOB,Gender,Telephone,E_mail,Emp_Photo)VALUES(@dtaEId,@dtaDNo,@dtaFname,@dtaMName,@dtaLName,@dtaAddress1,@dtaAddress2,@dtaAddress3,@dtaNIC,@dataDOB,@dtaGender,@datTele,@dtaEmail,@dtaPhoto) "
        com1.CommandText = sqlrt
        com1.Connection = con1
        com1.Parameters.AddWithValue("@dtaEId", ECODEMasked1.Text)
        com1.Parameters.AddWithValue("@dtaDNo", DEPcodeMasked.Text)
        com1.Parameters.AddWithValue("@dtaFname", TextBox3.Text)
        com1.Parameters.AddWithValue("@dtaMName", TextBox4.Text)
        com1.Parameters.AddWithValue("@dtaLName", TextBox5.Text)
        com1.Parameters.AddWithValue("@dtaAddress1", TextBox6.Text)
        com1.Parameters.AddWithValue("@dtaAddress2", TextBox7.Text)
        com1.Parameters.AddWithValue("@dtaAddress3", TextBox8.Text)
        com1.Parameters.AddWithValue("@dtaNIC", EMasked2.Text)
        com1.Parameters.AddWithValue("@dataDOB", EDOBPicker1.Value.Date)
        com1.Parameters.AddWithValue("@dtaGender", ComboBox3.SelectedItem)
        com1.Parameters.AddWithValue("@datTele", ETELEMasked3.Text)
        com1.Parameters.AddWithValue("@dtaEmail", TextBox10.Text)
        com1.Parameters.AddWithValue("@dtaPhoto", imgbuffer)
        com1.ExecuteNonQuery()
        MsgBox("Successsfuly Inserted", MsgBoxStyle.Information)
        con.Close()


        'com1 = New OleDb.OleDbCommand("INSERT INTO Employee(EId,DNo,FName,MName,LName,Address_Line1,Address_Line2,Address_Line3,NIC,DOB,Gender,Telephone,E_mail,Emp_Photo)VALUES('" + ECODEMasked1.Text + "','" + DEPcodeMasked.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','" + TextBox8.Text + "','" + EMasked2.Text + "' ,'" + EDOBPicker1.Value.Date + "','" + ComboBox3.SelectedItem + "','" + ETELEMasked3.Text + "','" + TextBox10.Text + "'," + imgbuffer. + ")", con1)

        ''Dim com4 As New OleDb.OleDbCommand("INSERT INTO Employee(E-mail)VALUES('" + TextBox9.Text + "')", con1)
        'Debug.WriteLine(com1)
        'com1.ExecuteNonQuery()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OpenFileDialog1.Filter = "Image File (* .jpg, *.bmp, *.png) | *.jpg; *.bmp; *.png| all files (*.*) | *.* "
        If OpenFileDialog1.ShowDialog &lt;&gt; Windows.Forms.DialogResult.Cancel Then
            PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
        End If
    End Sub

    Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk

    End Sub
End Class
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>dinesh012</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452749/null-reference-expression-was-unhandled</guid>
		</item>
				<item>
			<title>Count rows betwen two numbers and add below - VB</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452724/count-rows-betwen-two-numbers-and-add-below-vb</link>
			<pubDate>Wed, 17 Apr 2013 20:51:01 +0000</pubDate>
			<description>I have two colums. Both include 8 digits numbers with shorter numbers between. I want to calculate how many rows between two 8 digits numbers have first one and the second one and then I need to add second column next to the first one but with adding missing rows ...</description>
			<content:encoded><![CDATA[ <p>I have two colums. Both include 8 digits numbers with shorter numbers between. I want to calculate how many rows between two 8 digits numbers have first one and the second one and then I need to add second column next to the first one but with adding missing rows (difference beetwen first one and second one). For example - fist column has 9 rows and second one has 12, so I need to paste second column next to the first with adding 3 extra rows below last row in first column.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Tarwit</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452724/count-rows-betwen-two-numbers-and-add-below-vb</guid>
		</item>
				<item>
			<title>how to set a database path in vb.net</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452694/how-to-set-a-database-path-in-vb.net</link>
			<pubDate>Wed, 17 Apr 2013 12:24:00 +0000</pubDate>
			<description>Hi guys, i'm having a difficulty to set the path in vb.net.i put the code in the module and every time i run the code it throws error &quot;Could not find file 'C:\Users\Abdueie\Desktop\BMS\Bridge Asset Management\Bridge Asset Management\bin\Debug\Adigrat.accdb'.&quot; here's the code Public conn As OleDbConnection = New OleDbConnection(&quot;Provider=Microsoft.ACE.OLEDB.12.0; Data Source= .\\Adigrat.accdb;Persist ...</description>
			<content:encoded><![CDATA[ <p>Hi guys,<br />
i'm having a difficulty to set the path in vb.net.i put the code in the module<br />
and every time i run the code it throws error<br />
"Could not find file 'C:\Users\Abdueie\Desktop\BMS\Bridge Asset Management\Bridge Asset Management\bin\Debug\Adigrat.accdb'."<br />
here's the code</p>

<p>Public conn As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source= .\Adigrat.accdb;Persist Security Info=False")</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Nebil</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452694/how-to-set-a-database-path-in-vb.net</guid>
		</item>
				<item>
			<title>Populating Listview from SQL Database</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452669/populating-listview-from-sql-database</link>
			<pubDate>Wed, 17 Apr 2013 06:08:00 +0000</pubDate>
			<description>Hi group, I've been playing with a ListView and I'm struggling to get it to populated with info in a database. I'm hoping you may see something in my code that is creating the error. Dim con As New SqlConnection Dim cmd As New SqlCommand Dim rdr As SqlDataReader = ...</description>
			<content:encoded><![CDATA[ <p>Hi group,</p>

<p>I've been playing with a ListView and I'm struggling to get it to populated with info in a database.  I'm hoping you may see something in my code that is creating the error.</p>

<pre><code class="language-vb">        Dim con As New SqlConnection
        Dim cmd As New SqlCommand
        Dim rdr As SqlDataReader = cmd.ExecuteReader

        con.ConnectionString = ("Data Source=DON-PC;Initial Catalog=DataDesignSolutions;Integrated Security=True;User ID=DON-PC;Password=be67011;")
        Dim command As New SqlCommand("", con)
        command.CommandText = "SELECT * FROM PRINTERMAINT"
        lvPrinterSetup.Items.Clear()
        con.Open()
        rdr = cmd.ExecuteReader
        Do While rdr.Read()
            lvPrinterSetup.Items.Add(New ListViewItem({rdr(0), rdr(1), rdr(2), rdr(3), rdr(4)}))
        Loop
        rdr.Close()
        con.Close()
</code></pre>

<p>To clarify, there are 5 columns in this data table (PRINTERMAINT).  They are "PrinterID", "PrinterName", "PrinterNumber", "PrinterLocation" and "PrinterAddress".</p>

<p>Currently, I've attempted to push up at least 3 records.  While I've not confirmed they are there, I believe they are.</p>

<p>If you see something that may be creating the failure, please speak up.  I'm not getting any kind of error message.  I'm just not getting any data to display in the ListView.</p>

<p>Thanks for your help.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452669/populating-listview-from-sql-database</guid>
		</item>
				<item>
			<title>sql invalid columns</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452644/sql-invalid-columns</link>
			<pubDate>Tue, 16 Apr 2013 21:20:50 +0000</pubDate>
			<description>Group, I've been working for several hours trying to correctly write to a database file. Here are the parameters: Database Name: DATADESIGNSOLUTIONS Table Name: PRINTERMAINT Column Names: PrinterID (primary Key), PrinterName, PrinterNumber, PrinterLocation, PrinterAddress I've been working at this two ways: through the Visual Basic code and through SQL Server ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>I've been working for several hours trying to correctly write to a database file.  Here are the parameters:</p>

<p>Database Name: DATADESIGNSOLUTIONS<br />
Table Name: PRINTERMAINT<br />
Column Names: PrinterID (primary Key), PrinterName, PrinterNumber, PrinterLocation, PrinterAddress</p>

<p>I've been working at this two ways: through the Visual Basic code and through SQL Server Management.  I'm getting the same errors in both places.  The error reads:</p>

<p>Invalid column name 'printName'.<br />
Invalid column name 'printNo'.<br />
Invalid column name 'printLoc'.<br />
Invalid column name 'printAdd'.</p>

<p>Here's the code I've written"</p>

<pre><code class="language-vb">Try
                con.ConnectionString = "Data Source=DON-PC;Initial Catalog=DATADESIGNSOLUTIONS;Integrated Security = True;User ID=DON-PC;Password=be67011;"
                con.Open()
                cmd.Connection = con
                cmd.CommandText = "INSERT INTO PRINTERMAINT(PrinterName, PrinterNumber, PrinterLocation, PrinterAddress) " &amp; _
                "VALUES (printName, printNo, printLoc, printAdd)"
                cmd.ExecuteNonQuery()

            Catch ex As Exception
                MessageBox.Show("Error while inserting record on table..." &amp; ex.Message, "Insert Records")
            Finally
                con.Close()
            End Try
</code></pre>

<p>By the way,</p>

<p>INSERT INTO PRINTERMAINT(PrinterName, PrinterNumber, PrinterLocation, PrinterAddress)</p>

<p>doesn't work in SQL Server Management either.  It keeps telling me these are invalid column names.</p>

<p>Can someone point out to me what I'm doing wrong?</p>

<p>In advance, thanks for the help.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452644/sql-invalid-columns</guid>
		</item>
				<item>
			<title>Registry key enum?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452578/registry-key-enum</link>
			<pubDate>Tue, 16 Apr 2013 05:55:02 +0000</pubDate>
			<description>Hello all, I am trying to get a bunch of sub-keys and values from the registry in vb 2010 and i remember in vb6 this was quite easy. Can anyone share code to help? Or a link where I can go? I've been searching for nearly 8 hours on line ...</description>
			<content:encoded><![CDATA[ <p>Hello all,</p>

<p>I am trying to get a bunch of sub-keys and values from the registry in vb 2010 and i remember in vb6 this was quite easy. Can anyone share code to help? Or a link where I can go? I've been searching for nearly 8 hours on line and can't find anything I can use. The microsoft sites don't really help and most of the articles I find are for vb 7, or vb 6. Any help would be appreciated.</p>

<p>./x86</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>amvx86</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452578/registry-key-enum</guid>
		</item>
				<item>
			<title>Sub-routines</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452484/sub-routines</link>
			<pubDate>Mon, 15 Apr 2013 03:37:22 +0000</pubDate>
			<description>Hi group, Within one form, I need to run a routine twice. Obviously, I can write the code twice in the two places it needs to run. Isn't there a way to write the routine one time and the call it in two places within the form? Would this be ...</description>
			<content:encoded><![CDATA[ <p>Hi group,</p>

<p>Within one form, I need to run a routine twice.  Obviously, I can write the code twice in the two places it needs to run.  Isn't there a way to write the routine one time and the call it in two places within the form?  Would this be a "Function"?</p>

<p>What I need to write is a fairly large datareader routine. Assuming it is a Function, I'm not sure how to write the event correctly.  I can use some help.</p>

<p>In advance, thanks.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452484/sub-routines</guid>
		</item>
				<item>
			<title>form validation</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452461/form-validation</link>
			<pubDate>Sun, 14 Apr 2013 21:01:57 +0000</pubDate>
			<description>I am trying to validate two text boxes in VB 10 Express. The first validation (parts) is working as desired, and the form will not proceed to the next step until zero or a positve number is entered. The second validation (labor) is not working as I would like. If ...</description>
			<content:encoded><![CDATA[ <p>I am trying to validate two text boxes in VB 10 Express. The first validation (parts) is working as desired, and the form will not proceed to the next step until zero or a positve number is entered. The second validation (labor) is not working as I would like. If left blank or a negative number or text is entered, the message box displays "Labor must be zero or a positive number", but when you click ok, the remainder of the form executes. I would like to force the user to enter zero or a positive number before moving on. I can't figure out why the two validations are behaving differently. Any advice?</p>

<pre><code class="language-vb">        'Get the parts cost from user.
        If Decimal.TryParse(txtParts.Text, decParts) Then
            'Validate the parts costs.
            If decParts &gt;= 0 Then
                'display parts
                lblParts.Text = decParts.ToString("c")


                'Get the labor cost from user
                If Decimal.TryParse(txtLabor.Text, decLabor) Then
                    'Validate the labor cost.
                    If decLabor &gt;= 0 Then
                        'add labor to the hidden service label
                        lblLabor.Text = decLabor.ToString("c")
                    Else
                        'Error:  labor prices are missing or negative
                        MessageBox.Show("Labor must be 0 or a positive number.")
                    End If
                Else
                    'Error: labor prices are missing or negative.
                    MessageBox.Show("Labor must be 0 or a positive number.")
                End If

                'Get the parts tax
                decTax = decParts * decTAX_RATE

                decServiceLabor = OilLube() + Flushes() + Misc() + decParts + decLabor
                decTotal = decServiceLabor + decParts + decTax

                lblServiceLabor.Text = decServiceLabor.ToString("c")
                lblTax.Text = decTax.ToString("c")
                lblTotal.Text = decTotal.ToString("c")

            Else
                'Error: parts prices are missing or negative
                MessageBox.Show("Parts must be 0 or a positive number.")
            End If
        Else
            'Error: parts prices are missing or negative.
            MessageBox.Show("Parts must be 0 or a positive number.")
        End If
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>SLMQC</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452461/form-validation</guid>
		</item>
				<item>
			<title>Variable not assigned, but why?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452414/variable-not-assigned-but-why</link>
			<pubDate>Sun, 14 Apr 2013 05:01:44 +0000</pubDate>
			<description>I'm getting an error for using a variable before it's assigned a value, but, I'm not sure why. Imports System.IO Public Class Form1 Dim colWeather As New Collection Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Add listbox items upon form load. With lstAltitudes.Items .Add(&quot;03000&quot;) .Add(&quot;06000&quot;) ...</description>
			<content:encoded><![CDATA[ <p>I'm getting an error for using a variable before it's assigned a value, but, I'm not sure why.</p>

<pre><code class="language-vb">Imports System.IO

Public Class Form1


    Dim colWeather As New Collection
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    'Add listbox items upon form load.
    With lstAltitudes.Items
        .Add("03000")
        .Add("06000")
        .Add("09000")
        .Add("12000")
        .Add("18000")
        .Add("24000")
        .Add("30000")
        .Add("34000")
        .Add("39000")
    End With
End Sub

Private Sub ReadStationsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReadStationsToolStripMenuItem.Click
    With ofdOpenFile
        .Title = "Open Stations File"
        .InitialDirectory = Application.StartupPath
        .Filter = "Text Files (*.txt)|*.txt"
        .ShowDialog()
    End With
    If ofdOpenFile.ShowDialog() = Windows.Forms.DialogResult.OK Then
        cboLocations.Items.Clear()
        Dim stationsFile As StreamReader = File.OpenText("stations.txt")
        Dim strStations As String = stationsFile.ReadLine()
        Do While stationsFile.Peek &gt;= 0
            cboLocations.Items.Add(stationsFile.ReadLine)
        Loop
    cboLocations.Enabled = True
    End If
End Sub

Private Sub ReadWeatherToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReadWeatherToolStripMenuItem.Click
    Dim inputFile As StreamReader 'Object Variable
    Dim strWeather As String 'Station line
    Dim strFileName As String = "weather.txt"
    Dim intCount As Integer 'Loop counter
    Dim key As Integer 'Key

    'OpenFileDialog
    With ofdOpenFile
        .Filter = "Text Files (*.txt)|*.txt" ' Opens text files only
        .InitialDirectory = Application.StartupPath() 'Initial directory
        .Title = "Open Weather File"
        .FileName = strFileName


        If .ShowDialog() = Windows.Forms.DialogResult.OK Then
            Try
                'Clears collection
                colWeather.Clear()

                'Opens the weather File
                inputFile = File.OpenText(strFileName)

                'Read each line after first seven lines
                For intCount = 8 To CInt(inputFile.Peek = -1)
                    strWeather = inputFile.ReadLine()
                Next
                inputFile.Close()

                '********ERROR IS IN THIS LINE BELOW**********
                'extract the first three characters as a key
                key = CInt((*strWeather*.Substring(1, 3)))

                'store the entire line in the collection
                colWeather.Add(inputFile.ReadLine(), CStr(key))


                'Enables listbox
                lstAltitudes.Enabled = True


            Catch
                MessageBox.Show("File Does not exist")
            End Try

        End If
    End With

End Sub
</code></pre>

<p>End Class</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>dusto</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452414/variable-not-assigned-but-why</guid>
		</item>
				<item>
			<title>WPF: Custom button can&#039;t set image</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452309/wpf-custom-button-cant-set-image</link>
			<pubDate>Fri, 12 Apr 2013 16:53:18 +0000</pubDate>
			<description>Hey folks I've finally figured out how in WPF to template all my buttons so they all behave they way I want. Basically, I want all my buttons, when clicked, to drop down and to the right a few pixels then pop back up. The problem is, I can't set ...</description>
			<content:encoded><![CDATA[ <p>Hey folks</p>

<p>I've finally figured out how in WPF to template all my buttons so they all behave they way I want. Basically, I want all my buttons, when clicked, to drop down and to the right a few pixels then pop back up.</p>

<p>The problem is, I can't set the image on the buttons. I created this in Blend, but I can only seem to set the image inside Blend causing all the buttons to have the same image.</p>

<pre><code class="language-vb">&lt;Application x:Class="Application"
    xmlns="<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation" rel="nofollow">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>"
    xmlns:x="<a href="http://schemas.microsoft.com/winfx/2006/xaml" rel="nofollow">http://schemas.microsoft.com/winfx/2006/xaml</a>"
    StartupUri="Splash.xaml"&gt;
    &lt;Application.Resources&gt;
        &lt;!-- Resources scoped at the Application level should be defined here. --&gt;
        &lt;Style TargetType="{x:Type Button}"&gt;
            &lt;Setter Property="Template"&gt;
                &lt;Setter.Value&gt;
                    &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
                        &lt;ControlTemplate.Resources&gt;
                            &lt;Storyboard x:Key="WhenClicked"&gt;
                                &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle"&gt;
                                    &lt;EasingDoubleKeyFrame KeyTime="0" Value="2"/&gt;
                                    &lt;EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/&gt;
                                &lt;/DoubleAnimationUsingKeyFrames&gt;
                                &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle"&gt;
                                    &lt;EasingDoubleKeyFrame KeyTime="0" Value="2"/&gt;
                                    &lt;EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/&gt;
                                &lt;/DoubleAnimationUsingKeyFrames&gt;
                            &lt;/Storyboard&gt;
                        &lt;/ControlTemplate.Resources&gt;
                        &lt;Grid&gt;
                            &lt;Rectangle x:Name="rectangle" RenderTransformOrigin="0.5,0.5"&gt;
                                &lt;Rectangle.RenderTransform&gt;
                                    &lt;TransformGroup&gt;
                                        &lt;ScaleTransform/&gt;
                                        &lt;SkewTransform/&gt;
                                        &lt;RotateTransform/&gt;
                                        &lt;TranslateTransform X="1" Y="1"/&gt;
                                    &lt;/TransformGroup&gt;
                                &lt;/Rectangle.RenderTransform&gt;
                            &lt;/Rectangle&gt;
                            &lt;ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/&gt;
                        &lt;/Grid&gt;
                        &lt;ControlTemplate.Triggers&gt;
                            &lt;EventTrigger RoutedEvent="Mouse.MouseDown" SourceName="rectangle"&gt;
                                &lt;BeginStoryboard Storyboard="{StaticResource WhenClicked}"/&gt;
                            &lt;/EventTrigger&gt;
                            &lt;Trigger Property="IsFocused" Value="True"/&gt;
                            &lt;Trigger Property="IsDefaulted" Value="True"/&gt;
                            &lt;Trigger Property="IsMouseOver" Value="True"/&gt;
                            &lt;Trigger Property="IsEnabled" Value="False"/&gt;
                        &lt;/ControlTemplate.Triggers&gt;
                    &lt;/ControlTemplate&gt;
                &lt;/Setter.Value&gt;
            &lt;/Setter&gt;
        &lt;/Style&gt;
    &lt;/Application.Resources&gt;
&lt;/Application&gt;
</code></pre>

<p>This is my Application.XML which changes all the buttons to a rectangle. The click events work great, but when I'm in the VS designer I cant set the image. Any hints?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>ZeroZen</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452309/wpf-custom-button-cant-set-image</guid>
		</item>
				<item>
			<title>Can&#039;t update a record in a database in vb.net using textbox</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452210/cant-update-a-record-in-a-database-in-vb.net-using-textbox</link>
			<pubDate>Thu, 11 Apr 2013 13:51:03 +0000</pubDate>
			<description>Hi guys,i was having this problem with inserting a record into access database in visualstudio 2010. here's the problem,here's the code bridgenumber = TextBox1.Text.ToString() bridgename = TextBox2.Text districtname = ComboBox1.Text sectionname = ComboBox2.Text roadsegmentname = ComboBox3.Text bridgetype = ComboBox4.Text bridgespan1 = TextBox3.Text bridgecondition = ComboBox5.Text acquisitionyear1 = ComboBox6.Text evaluationyear1 = ...</description>
			<content:encoded><![CDATA[ <p>Hi guys,i was having this problem with inserting a record into access database in visualstudio 2010.<br />
here's the problem,here's the code</p>

<pre><code class="language-vb">bridgenumber = TextBox1.Text.ToString()
            bridgename = TextBox2.Text
            districtname = ComboBox1.Text
            sectionname = ComboBox2.Text
            roadsegmentname = ComboBox3.Text
            bridgetype = ComboBox4.Text
            bridgespan1 = TextBox3.Text
            bridgecondition = ComboBox5.Text
            acquisitionyear1 = ComboBox6.Text
            evaluationyear1 = ComboBox7.Text
            endofdesign1 = ComboBox8.Text
            bridgeasset1 = Label12.Text
            Dim str As String
            Dim conn As OleDbConnection = GetDbConnection()
            Dim cmd As OleDbCommand
            str = "INSERT INTO AdigratT (Bridge_Number,Bridge_Name,District_Name,Section_Name,Road_Segment_Name,Bridge_Type,Bridge_Span,Bridge_Condition,Acquisition_Year,Evaluation_Year,End_of_Design_Life_Year,Bridge_Asset_Value) VALUES (" &amp;
                "'" &amp; bridgenumber &amp; "','" &amp; bridgename &amp; "','" &amp; districtname &amp; "','" &amp; sectionname &amp; "','" &amp; _
                    roadsegmentname &amp; "','" &amp; bridgetype &amp; "','" &amp; bridgespan1 &amp; "','" &amp; bridgecondition &amp; "','" &amp; acquisitionyear1 &amp; "','" &amp; _
                    evaluationyear1 &amp; "','" &amp; endofdesign1 &amp; "','" &amp; bridgeasset1 &amp; "')"
            'and CInt is used to convert number, to string
            cmd = New OleDbCommand(str, conn)
            Dim obj As Object = cmd.ExecuteNonQuery()
            If Not (obj Is Nothing) Then
                MsgBox("Record has been inserted sucessfully", vbInformation, "Bridge Asset Management")
            End If
            conn.Close()
            conn.Dispose()
            conn = Nothing
        End If
        filllistview()
</code></pre>

<p>When i omitted the fields(Bridge_Number,Bridge_Name...)it works perfect but when i tried to insert the fields an exption is thrown.<br />
"The INSERT INTO statement contains the following unknown field name: 'Bridge_Number'.  Make sure you have typed the name correctly, and try the operation again."<br />
Do i just simply not write the field names?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Nebil</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452210/cant-update-a-record-in-a-database-in-vb.net-using-textbox</guid>
		</item>
				<item>
			<title>want to practice sql : which version of SQL server do i need?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452196/want-to-practice-sql-which-version-of-sql-server-do-i-need</link>
			<pubDate>Thu, 11 Apr 2013 11:19:41 +0000</pubDate>
			<description>i was thinking of downloading some database software that would help me learn sql. so far i have only *read* sql , ie havent done any practical sort of thing. i made a post earlier in this forum , where i was told that sql server express will be a ...</description>
			<content:encoded><![CDATA[ <p>i was thinking of downloading some database software that would help me learn sql. so far i have only <em>read</em> sql , ie havent done any practical sort of thing.  i made a post earlier in this forum , where i was told that sql server express will be a good option. but when i went to <a href="http://www.microsoft.com/en-in/download/details.aspx?id=29062" rel="nofollow">this</a> download page , there are so many options and im not sure which one to download... can anyone help me in this regard?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>somjit{}</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452196/want-to-practice-sql-which-version-of-sql-server-do-i-need</guid>
		</item>
				<item>
			<title>Mysql, why do I get 0kb after database backup?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452127/mysql-why-do-i-get-0kb-after-database-backup</link>
			<pubDate>Wed, 10 Apr 2013 14:26:27 +0000</pubDate>
			<description>Hi all! I'm trying to perform a mysql database from vb.net. I use this code: Process.Start(&quot;C:\Program Files (x86)\MySQL\MySQL Workbench CE 5.2.44\mysqldump.exe&quot;, &quot;--user=root --password=mypassword &quot; _ &amp; &quot;--host=127.0.0.1 --databases MySQL databasename -r &quot;&quot;C:\GreatestHR Backup\BackUpDataBase.sql&quot;&quot;&quot;) When this code runs, a command prompt window opens and goes away immediately that i can't even ...</description>
			<content:encoded><![CDATA[ <p>Hi all!</p>

<p>I'm trying to perform a mysql database from vb.net. I use this code:</p>

<pre><code class="language-vb"> Process.Start("C:\Program Files (x86)\MySQL\MySQL Workbench CE 5.2.44\mysqldump.exe", "--user=root --password=mypassword " _
                      &amp; "--host=127.0.0.1 --databases MySQL databasename -r ""C:\GreatestHR Backup\BackUpDataBase.sql""")
</code></pre>

<p>When this code runs, a command prompt window opens and goes away immediately that i can't even read what it says. When I go to the output folder specified in the code, there is really BackupDatabase.sql but with only 0Kb, while the actual database has data in it. What could be the problem?</p>

<p>I repeat, I use mysql database in Mysql Workbenc 5.2.</p>

<p>F1 please.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>savedlema</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452127/mysql-why-do-i-get-0kb-after-database-backup</guid>
		</item>
				<item>
			<title>&quot;Syntax error in INSERT INTO statement&quot; when trying to save a record!</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452032/syntax-error-in-insert-into-statement-when-trying-to-save-a-record</link>
			<pubDate>Tue, 09 Apr 2013 12:57:45 +0000</pubDate>
			<description>Hello there, I face this error message when I try to save a new record in Table: viruses_analysis, I would like to use the same way in the code below, but where is the error? please be informed that I used the same way in other applications and worked very ...</description>
			<content:encoded><![CDATA[ <p>Hello there,<br />
I face this error message when I try to save a new record in Table: viruses_analysis, I would like to use the same way in the code below, but where is the error?</p>

<p>please be informed that I used the same way in other applications and worked very fine.<br />
I'm confused.</p>

<p>Thanks in advance.</p>

<pre><code class="language-vb">        Dim SSQl As String = "select * from viruses_analysis"
        Dim SAdapter As New OleDbDataAdapter(SSQl, Con)
        Dim SDataSet As New DataSet
        Dim RowsCount As Integer
        Dim dsNewRow As DataRow

        If Con.State = ConnectionState.Closed Then
            Con.Open()
            SAdapter.Fill(SDataSet, "SavingSalaryDetails")
            RowsCount = SDataSet.Tables("SavingSalaryDetails").Rows.Count
            dsNewRow = SDataSet.Tables("SavingSalaryDetails").NewRow()

            dsNewRow.Item("VirDate") = dtDate.Value.Date
            dsNewRow.Item("VirDay") = dtDate.Value.Day
            dsNewRow.Item("VirMonth") = dtDate.Value.Month
            dsNewRow.Item("VirYear") = dtDate.Value.Year
            dsNewRow.Item("PatID") = PatID
            dsNewRow.Item("PatName") = PatName
            dsNewRow.Item("HIV") = cmbHIV.Text
            dsNewRow.Item("HBSAG") = cmbHBSAG.Text
            dsNewRow.Item("HCV") = cmbHCV.Text
            dsNewRow.Item("VDRL") = cmbVDRL.Text
            dsNewRow.Item("COST") = Val(txtCost.Text)
            dsNewRow.Item("PAID") = Val(txtPaidValue.Text)
            dsNewRow.Item("user") = "Admin"

            ' Apply the new row
            Dim cb As New OleDb.OleDbCommandBuilder(SAdapter)
            SDataSet.Tables("SavingSalaryDetails").Rows.Add(dsNewRow)
            SAdapter.Update(SDataSet, "SavingSalaryDetails")
            Con.Close()
            SDataSet.Reset()
            ClearControls()

        Else
            SAdapter.Fill(SDataSet, "SavingSalaryDetails")
            RowsCount = SDataSet.Tables("SavingSalaryDetails").Rows.Count
            dsNewRow = SDataSet.Tables("SavingSalaryDetails").NewRow()

            dsNewRow.Item("VirDate") = dtDate.Value.Date
            dsNewRow.Item("VirDay") = dtDate.Value.Day
            dsNewRow.Item("VirMonth") = dtDate.Value.Month
            dsNewRow.Item("VirYear") = dtDate.Value.Year
            dsNewRow.Item("PatID") = PatID
            dsNewRow.Item("PatName") = PatName
            dsNewRow.Item("HIV") = cmbHIV.Text
            dsNewRow.Item("HBSAG") = cmbHBSAG.Text
            dsNewRow.Item("HCV") = cmbHCV.Text
            dsNewRow.Item("VDRL") = cmbVDRL.Text
            dsNewRow.Item("COST") = Val(txtCost.Text)
            dsNewRow.Item("PAID") = Val(txtPaidValue.Text)
            dsNewRow.Item("user") = "Admin"

            ' Apply the new row
            Dim cb As New OleDb.OleDbCommandBuilder(SAdapter)
            SDataSet.Tables("SavingSalaryDetails").Rows.Add(dsNewRow)
            SAdapter.Update(SDataSet, "SavingSalaryDetails")
            Con.Close()
            SDataSet.Reset()
            ClearControls()
        End If
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>ASWEDAN</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452032/syntax-error-in-insert-into-statement-when-trying-to-save-a-record</guid>
		</item>
				<item>
			<title>deleting a record from a database using a listview</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/452009/deleting-a-record-from-a-database-using-a-listview</link>
			<pubDate>Tue, 09 Apr 2013 08:57:29 +0000</pubDate>
			<description>Hi all, I was having a huge problem,i mean i spent days trying to fix it but i get the same exception everytime when i run the app. here's the thing i have a record that is loaded from the database using the listview.it works perfect for the insertion part.but ...</description>
			<content:encoded><![CDATA[ <p>Hi all,<br />
I was having a huge problem,i mean i spent days trying to fix it but i get the same exception everytime when i run the app.<br />
here's the thing i have a record that is loaded from the database using the listview.it works perfect for the insertion part.but when i try to delete a certain row it gives me the previous exception.<br />
so please if one of you could give me a precious solution<br />
thankyou all</p>

<pre><code class="language-vb">Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim str As String
        Dim conn As OleDbConnection = GetDbConnection()
        Dim cmd As OleDbCommand
        Dim selectedItem As Integer = ListView1.SelectedIndices(0)
        str = "DELETE FROM AdigratT WHERE Bridge_Number = '" &amp; ListView1.Items(selectedItem).SubItems(0).Text &amp; "'"
        cmd = New OleDbCommand(str, conn)
        cmd.ExecuteNonQuery()
        MsgBox("Record Removed Successfully")
        conn.Close()
    End Sub
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Nebil</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/452009/deleting-a-record-from-a-database-using-a-listview</guid>
		</item>
				<item>
			<title>Importing DBF file into DataGridView</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451981/importing-dbf-file-into-datagridview</link>
			<pubDate>Tue, 09 Apr 2013 01:07:11 +0000</pubDate>
			<description>Hi fellow members of Daniweb. I've been working on project for the past few days now, and have come across a bump, that i am unable to pass. The project, when finished, will do the following: 1. Select DBF file from computer location (Default C:) 2. Import the database file ...</description>
			<content:encoded><![CDATA[ <p>Hi fellow members of Daniweb.</p>

<p>I've been working on project for the past few days now, and have come across a bump, that i am unable to pass.<br />
The project, when finished, will do the following:</p>

<ol><li>Select DBF file from computer location (Default C:)</li>
<li>Import the database file into a DataGridView</li>
<li>Export the Datagridview into a file type of choice (For the meantime it will be an .XSLX file)</li>
</ol>

<p>Now i know there are many software out there that do this already, however i require this one for unique capabilities within my workplace.</p>

<p>Currently, i can open a OpenFileDialog, select the file i need, and import it. However the Datagridview stays empty. and i recieve no error.</p>

<p>Im very interested to see why/how this happens - and hoping somebody can point out where i have gone wrong.</p>

<p>The following code executes when the file has been chosen and the user hits 'btnNext':</p>

<pre><code class="language-vb">    If txtFileName.Text = "" Then
         MsgBox("Error! You must choose a file!")
         Return
    End If
    dbfiledir = ofdFileSearch.FileName.ToString()
    dbfilename = ofdFileSearch.SafeFileName.ToString().Split(".")(0)
    dbfilefolder = dbfiledir.Substring(0, 3)
    Me.Hide()
    MsgBox(dbfilefolder) 'The 3 messagebox's are a part of my testing.
    MsgBox(dbfilename)
    MsgBox(dbfiledir)
    frmStepTwo.visible = True
</code></pre>

<p>Now when frmStepTwo appears the following gets executed:</p>

<pre><code class="language-vb">    Dim cnn As New System.Data.OleDb.OleDbConnection
    Dim da As New System.Data.OleDb.OleDbDataAdapter
    Dim theDataSet As New DataSet

    cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &amp; dbfilefolder &amp; ";Extended Properties=dBASE IV;User ID=Admin;Password=;"
    Try
        cnn.Open()
        da.SelectCommand = New System.Data.OleDb.OleDbCommand("select * from [" &amp; dbfilename &amp; "]", cnn)
        da.Fill(theDataSet)
        DataGridView1.DataSource = theDataSet
        DataGridView1.Refresh()
    Catch ex As Exception
        MsgBox("Error while connecting to databse." &amp; vbNewLine &amp; ex.Message &amp; vbNewLine &amp; ex.ToString)
    End Try
</code></pre>

<p>This is all well and good, however no results in the database. I did some research to see if it had anything to do with the connectionstring. And i beleive this is the correct statement.</p>

<p>Any help with this issue, is greatly appreciated.</p>

<p>Regards</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Gobble45</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451981/importing-dbf-file-into-datagridview</guid>
		</item>
				<item>
			<title>Excel 2007 works, but not 2010</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451950/excel-2007-works-but-not-2010</link>
			<pubDate>Mon, 08 Apr 2013 13:23:22 +0000</pubDate>
			<description>I have a program I wrote a few years ago that interfaces largely with MS Excel. At the time my company used Office 2007. We have since upgraded to 2010 with no problems. However, I had to make some adjustments, and now I can not compile. The error is Error ...</description>
			<content:encoded><![CDATA[ <p>I have a program I wrote a few years ago that interfaces largely with MS Excel. At the time my company used Office 2007. We have since upgraded to 2010 with no problems. However, I had to make some adjustments, and now I can not compile. The error is</p>

<p>Error   3   Type 'Microsoft.Office.InteropExcel.Application' is not defined.    P:\ASG\VB Backup\Current Programs\ALL SUS TRAINING\WindowsApplication2\Form1.vb 5   23  WindowsApplication2</p>

<p>My code below is the header I've used since first release.</p>

<pre><code class="language-vb">Imports Microsoft.Office.Interop
Imports Microsoft.Office.Interop.Excel

Public Class frmImportDoc
    Dim trFile As New Microsoft.Office.InteropExcel.Application
    Dim trSheet As New Microsoft.Office.InteropExcel.Worksheet
</code></pre>

<p>So far, I have tried deleting and re-importing all of the office references (both Office and Excel Object Libraries).</p>

<p>If anyone has any ideas on this, I would greatly appreciate the help!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>bklynman01</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451950/excel-2007-works-but-not-2010</guid>
		</item>
				<item>
			<title>Choosing the correct Event</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451913/choosing-the-correct-event</link>
			<pubDate>Mon, 08 Apr 2013 03:36:56 +0000</pubDate>
			<description>Group, I need to use Function keys within a form I've created. The problem I'm having is determing the correct routine to fire it off. Here's what I'm attempting to do: In Form1 (actually called &quot;OrderEntry2&quot;), I want to give the user the option of keying in a part number ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>I need to use Function keys within a form I've created.  The problem I'm having is determing the correct routine to fire it off.  Here's what I'm attempting to do:</p>

<p>In Form1 (actually called "OrderEntry2"), I want to give the user the option of keying in a part number into the "txbPartNo" textbox.  Or, if they don't know the part number, I want to allow them to hit 'F5' to bring up Form2 (called "Popup_PartNo) to find that part number based on the beginning characters that they will enter on that form.</p>

<p>Likewise, should the user not know the beginning characters of the part number, I'd want to give them the option of finding the part number based on a word within the part description.  Again I want to allow them to hit 'F5' to bring up Form2 (called "Popup_PartNo) to perform the routine.</p>

<p>My first inclination was to allow the user to give FOCUS to either "txbPartNo" textbox or "txbDescription" textbox to choose which way they want to search.  So I wrote the following:</p>

<pre><code class="language-vb">Public Sub txbPartNo_GotFocus(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txbPartNo.GotFocus
        If e.KeyValue = Keys.F5 Then
            FuncKeysModule(e.KeyValue)
            e.Handled = True
        End If

    End Sub

    Public Sub txbDesc_GotFocus(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txbDesc.GotFocus
        If e.KeyValue = Keys.F5 Then
            FuncKeysModule(e.KeyValue)
            e.Handled = True
        End If

    End Sub

    Public Sub FuncKeysModule(ByVal value As Keys)


        'Check what function key is in a pressed state, and then perform the corresponding action.
        Select Case value
            Case Keys.F5
                Dim searchtype As Integer
                If txbPartNo.Focused = True Then
                    Popup_PartNumbers.Label1.Text = "Enter the beginning characters of the Part Number to search"
                    searchtype = 1
                    txbSearchType.Text = searchtype
                End If
                If txbDesc.Focused = True Then
                    Popup_PartNumbers.Label1.Text = "Enter a word from the Part Number Description to search"
                    searchtype = 2
                    txbSearchType.Text = searchtype
                End If
                Popup_PartNumbers.ShowDialog()
        End Select

    End Sub
</code></pre>

<p>As it stands right now, 'F5' doesn't bring up the Popup_PartNumbers form.</p>

<p>So, several questions:</p>

<p>1) Can I use this one function key ('F5') for both routines (albeit I'm trying to choose one or the other)?<br />
2) Am I using the correct event (GotFocus) to fire this of?<br />
3) Is the code "If txbDesc.Focused = True Then" being correctly used (see above)?<br />
4) If I'm using the wrong events, can you suggest what would be better to use?</p>

<p>In advance, thanks for your help.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451913/choosing-the-correct-event</guid>
		</item>
				<item>
			<title>Declaring a variable in Form and &quot;sending it&quot; to another Form</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451903/declaring-a-variable-in-form-and-sending-it-to-another-form</link>
			<pubDate>Mon, 08 Apr 2013 02:16:11 +0000</pubDate>
			<description>Group, I'm declaring a variable in one form that I need to make available in a second form. My code in Form1 looks like this: Public Sub FuncKeysModule(ByVal value As Keys) Select Case value Case Keys.F5 Dim searchtype As Integer If txbPartNo.Focused = True Then Popup_PartNumbers.Label1.Text = &quot;Enter the beginning ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>I'm declaring a variable in one form that I need to make available in a second form.  My code in Form1 looks like this:</p>

<pre><code class="language-vb">Public Sub FuncKeysModule(ByVal value As Keys)

        Select Case value
            Case Keys.F5
                Dim searchtype As Integer
                If txbPartNo.Focused = True Then
                    Popup_PartNumbers.Label1.Text = "Enter the beginning characters of the Part Number to search"
                    searchtype = 1
                End If
                If txbDesc.Focused = True Then
                    Popup_PartNumbers.Label1.Text = "Enter a word from the Part Number Description to search"
                    searchtype = 2
                End If
                Popup_PartNumbers.ShowDialog()
        End Select

    End Sub
</code></pre>

<p>The variable "searchtype" (1 or 2) needs to be read in Form2 to run either one of two routines.  How should this be written in Form1 and then how do I read it in Form2.</p>

<p>In advance, thanks for your help.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451903/declaring-a-variable-in-form-and-sending-it-to-another-form</guid>
		</item>
				<item>
			<title>&quot;Second Database&quot; showing up in SQL Server</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451855/second-database-showing-up-in-sql-server</link>
			<pubDate>Sun, 07 Apr 2013 01:34:01 +0000</pubDate>
			<description>Group, I'm having an issue with SQL Server that has me baffled. I need help. When I originally loaded SQL Server 2008 Express and created my database, I called it &quot;DataDesignSolutions&quot;. The tables were created through VB Studio 2010 Express. It's path was &quot;C:\User\Don\Documents\DataDesignSolutions.mdf&quot;. I'm not sure how, but somewhere ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>I'm having an issue with SQL Server that has me baffled.  I need help.</p>

<p>When I originally loaded SQL Server 2008 Express and created my database, I called it "DataDesignSolutions".  The tables were created through VB Studio 2010 Express.  It's path was "C:\User\Don\Documents\DataDesignSolutions.mdf".  I'm not sure how, but somewhere along the way that path name stuck.</p>

<p>I assumed that was an easy fix.  So through SQL Server Manager 2008 Express, I changed the name to "DataDesignSolutions".</p>

<p>Now here's the problem: When testing my program that has a link to this database, it's failing saying the password is incorrect.  Assuming the password had somehow been changed, I opened SQL Server manager and find there is a "second" database.  The interesting thing is, this "database" is empty.  There is absolutely nothing in it.  Further, it's name is "DataDesignSolutions".  The database that has all the tables is now called "C:\User\Don\Documents\DataDesignSolutions.mdf".  Can someone tell me what's going on?  How do I fix this?</p>

<p>In advance, thanks for you help.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451855/second-database-showing-up-in-sql-server</guid>
		</item>
				<item>
			<title>SQL Server Date Data Type</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451802/sql-server-date-data-type</link>
			<pubDate>Sat, 06 Apr 2013 01:31:43 +0000</pubDate>
			<description>Group, I'm thinking I may want to use the Date data type in SQL Server. However I'm still very unclear how to read, write and compare using this kind of data type. I realize this has a time component which is of no importance right now (it will be later ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>I'm thinking I may want to use the Date data type in SQL Server.  However I'm still very unclear how to read, write and compare using this kind of data type.  I realize this has a time component which is of no importance right now (it will be later though).  Can someone help me understand how to use this?  Here are some of my question:</p>

<p>1) is there a way to create a "null" or blank date?<br />
2) Visual Basic has the Today.Date commands.  I'll need to compare a date created by the user to what will be in the date field of the data table (formated as a date data type).  How is this done?<br />
3) If I have the user enter the date manually, in what format does it need to be in? yyyymmdd?</p>

<p>Feel free to elaborate.  I clearly don't understand enough about this kind of data type to really ask good questions.</p>

<p>Thanks,</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451802/sql-server-date-data-type</guid>
		</item>
				<item>
			<title>SELECT some values from one table and some from another table (with WHERE)?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451782/select-some-values-from-one-table-and-some-from-another-table-with-where</link>
			<pubDate>Fri, 05 Apr 2013 16:43:19 +0000</pubDate>
			<description>Hi all! I use VB.NET + Mysql. I have two tables (tblstudents &amp; tblpayments). I want to view payments details of a selected student. Thus, I'd like to select some values (firstname,middlename,surname) from tblstudents and (all values from tblpayments WHERE class = @class -I know how to deal with @class, ...</description>
			<content:encoded><![CDATA[ <p>Hi all!<br />
I use VB.NET + Mysql.<br />
I have two tables (tblstudents &amp; tblpayments). I want to view payments details of a selected student. Thus, I'd like to select some values (firstname,middlename,surname) from tblstudents and (all values from tblpayments WHERE class = @class -I know how to deal with @class, its a value in a textbox and present as a column in tblpayments) I want to INNER JOIN the tables with condition that (tblstudents.studentid = tblpayments.studentid).</p>

<p>The table tblpayments has columns (studentid,class and some contributions/payments names) I want to filter these contirbution/payments because some are valid for some classes only.</p>

<p>I have tried the following codes:</p>

<pre><code class="language-vb">        SQL = "SELECT ( SELECT tblstudents.FirstName,tblstudents.MiddleName,tblstudents.Surname, tblpayments.* " _
                &amp; "FROM tblstudents INNER JOIN tblpayments ON " _
                &amp; "tblpayments.studentid = tblstudents.studentid " _
                &amp; "WHERE tblpayments.class = @class AND tblpayments.studentid= @studentid"
</code></pre>

<p>but this did not deal with the first WHERE condition (tblpayments.class = @class), it brought results regardless of the @class.<br />
I tried this code:</p>

<pre><code class="language-vb">       SQL = "SELECT (SELECT tblstudents.FirstName,tblstudents.MiddleName,tblstudents.Surname " _
                &amp; "FROM tblstudents WHERE tblpayments.studentid= @studentid) " _
                &amp; "(SELECT tblpayments.* " _
                &amp; "WHERE tblpayments.class = @class)"
</code></pre>

<p>but VB said there was an error with the code.<br />
I tried <a href="http://www.daniweb.com/web-development/php/threads/451697/multiple-mysql-querys" rel="nofollow">this solution</a> from Daniweb to no avail.</p>

<p>I will appreciate any help please.<br />
Thanks.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>savedlema</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451782/select-some-values-from-one-table-and-some-from-another-table-with-where</guid>
		</item>
				<item>
			<title>SQL query on CSV</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451776/sql-query-on-csv</link>
			<pubDate>Fri, 05 Apr 2013 15:06:28 +0000</pubDate>
			<description>Hi all, I'm trying to bring up a table of data using a select query to create a DataSet that I'm displaying in a datagrid. When I use SELECT * FROM myTable it works fine, but when I only want the specific columns SELECT URN, 'CanX Reason', 'Date to take ...</description>
			<content:encoded><![CDATA[ <p>Hi all,</p>

<p>I'm trying to bring up a table of data using a select query to create a DataSet that I'm displaying in a datagrid. When I use</p>

<pre><code class="language-vb">SELECT * FROM myTable
</code></pre>

<p>it works fine, but when I only want the specific columns</p>

<pre><code class="language-vb">SELECT URN, 'CanX Reason', 'Date to take effect?' FROM myTable
</code></pre>

<p>it doesn't.</p>

<p>The URNs are displaying fine but the other columns are not</p>

<pre><code class="language-vb">    URN         Expr1001        Expr1002
    221203      CanX Reason     Date to take effect?
    224774      CanX Reason     Date to take effect?
    225311      CanX Reason     Date to take effect?
    221184      CanX Reason     Date to take effect?
    222699      CanX Reason     Date to take effect?
    223932      CanX Reason     Date to take effect?
</code></pre>

<p>Is there a way to correct this behaviour?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Tinnin</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451776/sql-query-on-csv</guid>
		</item>
				<item>
			<title>Debug/Build Error Unable to write to output file (Resources)</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451772/debugbuild-error-unable-to-write-to-output-file-resources</link>
			<pubDate>Fri, 05 Apr 2013 14:46:22 +0000</pubDate>
			<description>Hi the problem I am faced with is after adding around 35 video files of both .avi and .mpg with a total file size of around half a gig to the resources of my project, I get an error message on debug telling me &quot;Error 1 Unable to write to ...</description>
			<content:encoded><![CDATA[ <p>Hi the problem I am faced with is after adding around 35 video files of both .avi and .mpg with a total file size of around half a gig to the resources of my project, I get an error message on debug telling me "Error 1 Unable to write to output file".<br />
I am guessing this is because the total file size may be too large. I have tried to change the properties of the folder it writes to the file from read only, however it switches right back as soon as. Also I cannot see any .exe in the output directory where the file would be normally be written.<br />
"C:\Users\Bill\Documents\Visual Studio 2010\Projects\resources test 2\resources test 2\obj\x86\Debug"<br />
Resources test 2 being the project name.<br />
I am trying to create a program which plays a number of short video clips without streaming them from the internet. If I could source them from a folder on the HDD then fine however I am then faced with the problem of adding the videos to the instaler package which I dont seem to be able to find a way to do. Does anyone know why the output file will not write in these circumstances? Thank you.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>jakewebb</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451772/debugbuild-error-unable-to-write-to-output-file-resources</guid>
		</item>
				<item>
			<title>Using Background Worker got Exception Invocation</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451755/using-background-worker-got-exception-invocation</link>
			<pubDate>Fri, 05 Apr 2013 08:26:35 +0000</pubDate>
			<description>Hi danibians, wonder where i got this error. it got error after it reads the runcompleted process. here is my code Hi Everyone, Hope you could help me with this. I got an exception error saying &quot;Exception has been thrown by the target of an invocation.&quot; here is my code: ...</description>
			<content:encoded><![CDATA[ <p>Hi danibians,</p>

<p>wonder where i got this error. it got error after it reads the runcompleted process. here is my code</p>

<p>Hi Everyone,</p>

<p>Hope you could help me with this. I got an exception error saying "Exception has been thrown by the target of an invocation."</p>

<p>here is my code:</p>

<pre><code class="language-vb">Imports System.Data.SqlClient
Imports System.Data
Imports System.ComponentModel
Public Class Form1

    Dim m_countTo As Integer = 0
    Dim bolUpc As Boolean
    Dim cn As SqlConnection

    Private WithEvents m_bg As New BackgroundWorker

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Label3.Text = ""
    End Sub
    Private Sub txtcode_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtcode.TextChanged
        bolUpc = False
        If bolUpc = False Then
            Me.dgv1.DataSource = Nothing
            Me.btnSelectAll.Text = "Select All"
            Me.btnSelectAll.Enabled = False
            Label3.Text = ""
        End If
    End Sub

    Private Sub txtcode_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtcode.KeyDown


        If e.KeyCode = 13 Then

            Try

                cn = New SqlConnection(GetConnectionString)
                Dim SQL As String = "Select vp.upc from vendor_products vp join vendor_profile v on vp.vendor_id = v.id where vp.id not in (Select id from [192.168.180.104].Store.dbo.Vendor_products) and v.code = '" &amp; txtcode.Text &amp; "'order by vp.upc "


                m_bg.RunWorkerAsync(SQL)




            Catch ex As Exception
                Me.m_bg.CancelAsync()
                MsgBox(ex.Message)
            End Try
            btnSelectAll.Enabled = True

        End If
    End Sub

    Private Sub OpenSqlConnection()

        Dim connectionstring As String = GetConnectionString()

        Using connection As New SqlConnection(connectionstring)
            connection.Open()
        End Using

    End Sub

    Private Function GetConnectionString() As String

        Return "Data Source = (local);Database=Store;User Id=sa;Asynchronous processing = true;"
    End Function

    Private Sub btnSelectAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectAll.Click
        Dim intI As Integer
        Dim ctl As New Control

        intI = 0

        If btnSelectAll.Text = "Select All" Then
            For Each row As DataGridViewRow In dgv1.Rows
                If row.Cells("check").Value = False Then
                    dgv1.Rows(intI).Cells(0).Value = True
                    intI += 1
                End If
            Next
            btnSelectAll.Text = "Unselect All"
            Exit Sub
        Else
            For Each row As DataGridViewRow In dgv1.Rows
                If row.Cells("check").Value = True Then
                    dgv1.Rows(intI).Cells(0).Value = False
                    intI += 1
                End If
            Next
            btnSelectAll.Text = "Select All"
        End If
    End Sub

    Private Sub m_bg_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles m_bg.DoWork

        Dim SQL As String = e.Argument.ToString

        OpenSqlConnection()

        Dim dt As New DataTable


        Using da As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(SQL, cn)


            Dim count As Integer = da.Fill(dt)

            For i As Integer = 0 To count

                If Me.m_bg.CancellationPending Then
                    e.Cancel = True
                    Exit For
                End If

                System.Threading.Thread.Sleep(250)
                Me.m_bg.ReportProgress(CInt((i / count) * 100))
                SetLabeltext_Threadsafe(Me.Label2, FormatPercent(i / count, 2))

            Next

        End Using
        e.Result = dt

    End Sub

    Private Sub m_bg_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles m_bg.ProgressChanged
        Me.ProgressBar1.Value = e.ProgressPercentage
    End Sub

    Private Sub m_bg_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles m_bg.RunWorkerCompleted
        'If e.Cancelled Then
        '    Me.Label2.Text = "Cancelled"
        'Else

        Dim dt As DataTable = e.Result

        dgv1.DataSource = dt

        'Me.Label2.Text = "Completed"
        'End If

    End Sub

    Delegate Sub SetLabeltext_Delegate(ByVal [Label] As Label, ByVal [text] As String)

    Private Sub SetLabeltext_Threadsafe(ByVal [Label] As Label, ByVal [text] As String)

        If [Label].InvokeRequired Then
            Dim MyDelegate As New SetLabeltext_Delegate(AddressOf SetLabeltext_Threadsafe)
            Me.Invoke(MyDelegate, New Object() {[Label], [text]})
        Else
            [Label].Text = [text]
        End If

    End Sub

End Class
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>androidz</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451755/using-background-worker-got-exception-invocation</guid>
		</item>
				<item>
			<title>Moving a Form with no border</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451751/moving-a-form-with-no-border</link>
			<pubDate>Fri, 05 Apr 2013 07:05:02 +0000</pubDate>
			<description>It sort of works - the thing is without clicking the picturebox or anything, the form, whenever I move the mouse, it moves any help? Thanks Public Class Form1 Dim drag As Boolean Dim mousex As Integer Dim mousey As Integer Private Sub CloseButton1_Click(sender As Object, e As EventArgs) Handles ...</description>
			<content:encoded><![CDATA[ <p>It sort of works - the thing is without clicking the picturebox or anything, the form, whenever I move the mouse, it moves any help?<br />
Thanks</p>

<pre><code class="language-vb">Public Class Form1

    Dim drag As Boolean
    Dim mousex As Integer
    Dim mousey As Integer

    Private Sub CloseButton1_Click(sender As Object, e As EventArgs) Handles CloseButton1.Click
        System.Environment.Exit(1)
    End Sub

    Private Sub MaximiseButton1_Click(sender As Object, e As EventArgs) Handles MaximiseButton1.Click
        If Me.WindowState = FormWindowState.Normal Then
            Me.Height = Screen.PrimaryScreen.WorkingArea.Height
            Me.Width = Screen.PrimaryScreen.WorkingArea.Width
            Me.Left = (Screen.PrimaryScreen.WorkingArea.Width - Me.Width) / 2
            Me.Top = (Screen.PrimaryScreen.WorkingArea.Height - Me.Height) / 2
        Else
            Me.WindowState = FormWindowState.Normal
        End If
    End Sub

    Private Sub MinimiseButton1_Click(sender As Object, e As EventArgs) Handles MinimiseButton1.Click
        Me.WindowState = FormWindowState.Minimized
    End Sub

    Private Sub DesireWB1_Click(sender As Object, e As EventArgs) Handles DesireWB1.Click
        Form2.Show()
    End Sub

    Private Sub PictureBox1_MouseDown() Handles PictureBox1.MouseDown
        drag = True
        mousex = Windows.Forms.Cursor.Position.X - Me.Left
        mousey = Windows.Forms.Cursor.Position.Y - Me.Top
    End Sub

    Private Sub PictureBox1_MouseMove() Handles PictureBox1.MouseMove
        Me.Top = Windows.Forms.Cursor.Position.Y - mousey
        Me.Left = Windows.Forms.Cursor.Position.X - mousex
    End Sub

    Private Sub PictureBox1_MouseUp() Handles PictureBox1.MouseUp
        drag = False
    End Sub
End Class
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>IsaacMessi10</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451751/moving-a-form-with-no-border</guid>
		</item>
				<item>
			<title>Online Learning</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451719/online-learning</link>
			<pubDate>Fri, 05 Apr 2013 00:21:43 +0000</pubDate>
			<description>Group, After asking what seems to be a thousand questions, clearly there is so much more to learn about Visual Basic. So this prompts my &quot;Today's Question&quot;: Are there some good online courses or classes at a local college that I can take? By the way..... I live in the ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>After asking what seems to be a thousand questions, clearly there is so much more to learn about Visual Basic.  So this prompts my "Today's Question":</p>

<p>Are there some good online courses or classes at a local college that I can take?</p>

<p>By the way..... I live in the north metro area of Atlanta.</p>

<p>I have taken 2 continuing education courses online through the local college here.  Both were very good at introducing Visual Basic programming and gave me a reasonable understanding of how things work.  What it didn't do is explain the "how to's" and "why's" of things such as what a user control is and what a module does, and how to write the "background" code that can be used in every form of the program.</p>

<p>To put my question another way, I want greatly to learn more. I've tried to look online for such courses or colleges.  But I'm not sure what exactly to look for.  Consequently, I'll appreciate greatly your input.</p>

<p>Thanks again for all ya'll do.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451719/online-learning</guid>
		</item>
				<item>
			<title>How to convert textbox input to an integer? </title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451711/how-to-convert-textbox-input-to-an-integer-</link>
			<pubDate>Thu, 04 Apr 2013 21:04:02 +0000</pubDate>
			<description>Hi everyone, I need to use integer that is typed into textbox to do some math functions. here is what i have: Private Sub btnDivide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click dim x as integer dim y as integer dim tbox as integer tbox = (Textbox1.Text) x ...</description>
			<content:encoded><![CDATA[ <p>Hi everyone,<br />
I need to use integer that is typed into textbox to do some math functions.<br />
here is what i have:</p>

<p>Private Sub btnDivide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click<br />
dim x as integer<br />
dim y as integer<br />
dim tbox as integer</p>

<p>tbox = (Textbox1.Text)<br />
x = (y / tbox) * 100</p>

<p>if (x &gt;= 50) then<br />
'do something</p>

<p>end if<br />
End Sub</p>

<p>when i press button it keeps saying that conversion from string "" to type 'Integer' is not valid!<br />
how do i fix it?<br />
i've tried<br />
tbox = CInt(Textbox1.Text)<br />
and<br />
tbox = Ctype(Textbox1.Text, Integer)<br />
but its not working :(</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Taras20</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451711/how-to-convert-textbox-input-to-an-integer-</guid>
		</item>
				<item>
			<title>Changing filetype</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451691/changing-filetype</link>
			<pubDate>Thu, 04 Apr 2013 15:36:21 +0000</pubDate>
			<description>I'm trying to change an excel file to csv but the methods I've used so far have corrupted the file. I've tried renaming the file and using saveas from excel. Dim importsFileList As New ArrayList Dim sFile As String Dim extension As String Dim newExtension As String Dim file As ...</description>
			<content:encoded><![CDATA[ <p>I'm trying to change an excel file to csv but the methods I've used so far have corrupted the file.<br />
I've tried renaming the file and using saveas from excel.</p>

<pre><code class="language-vb">        Dim importsFileList As New ArrayList
        Dim sFile As String
        Dim extension As String
        Dim newExtension As String
        Dim file As IO.FileStream
        Dim oXL As Excel.Application
        Dim oWB As Excel.Workbook

        sFile = Dir$("C:\Users\filePath" &amp; "\*.*", vbDirectory)
        Do Until sFile = vbNullString
            If sFile &lt;&gt; "." Then ' relative path meaning this directory
                If sFile &lt;&gt; ".." Then ' relative path meaning parent directory 
                    extension = IO.Path.GetExtension(sFile)
                    If extension = ".xls" Or extension = ".xlsx" Then
                        newExtension = IO.Path.ChangeExtension(sFile, ".csv")
                        oXL = CreateObject("Excel.Application")
                        oXL.Visible = False
                        oXL.UserControl = False
                        oWB = oXL.Workbooks.Open("C:\Users\filePath\" &amp; sFile)
                        oWB.SaveAs("C:\Users\filePath\" &amp; newExtension)
                        oWB.Close()
                        oXL.Quit()
                        oWB = Nothing
                        oXL = Nothing
                        'file = IO.File.Create("C:\Users\filePath\" &amp; newExtension)
                        'file.Close()
                        'IO.File.Delete("C:\Users\filePath\" &amp; sFile)
                        'My.Computer.FileSystem.RenameFile("C:\Users\filePath\" &amp; sFile, newExtension)
                    End If
                End If
            End If
            sFile = Dir$()
        Loop

        sFile = Dir$("C:\Users\filePath" &amp; "\*.*", vbDirectory)
        Do Until sFile = vbNullString
            If sFile &lt;&gt; "." Then ' relative path meaning this directory
                If sFile &lt;&gt; ".." Then ' relative path meaning parent directory 
                    extension = IO.Path.GetExtension(sFile)
                    If extension = ".csv" Then
                        importsFileList.Add(sFile)
                    End If
                End If
            End If
            sFile = Dir$()
        Loop

        For Each importedFile In importsFileList
            ImportFiles.Items.Add(importedFile)
        Next
</code></pre>

<p>Does anyone have any other suggestions?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Tinnin</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451691/changing-filetype</guid>
		</item>
				<item>
			<title>Trying to Update record into access db</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451672/trying-to-update-record-into-access-db</link>
			<pubDate>Thu, 04 Apr 2013 12:53:09 +0000</pubDate>
			<description>Hi Guys, wondered if someone could help please? in my customer form i have managed to pull in the data from the table to the right txtboxes, and i can move forwards and backwards (&quot;happy days&quot;) but now im trying to update a record, this one has seem to thrown ...</description>
			<content:encoded><![CDATA[ <p>Hi Guys,</p>

<p>wondered if someone could help please?<br />
in my customer form i have managed to pull in the data from the table to the right txtboxes, and i can move forwards and backwards ("happy days") but now im trying to update a record, this one has seem to thrown me, because in a different form (login) i managed to pull data from lbls and insert it into the database, i thought it would be similar, but im guessing im wrong lol<br />
here's my code<br />
i did try and follow another users problem (INSERT ERROR) but i couldnt follow his code clearly<br />
any ideas?</p>

<pre><code class="language-vb"> Private Sub btn_Update_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Update.Click
        Dim con As New OleDb.OleDbConnection                     '"con" variable holds the Connection Object
        Dim dbProvider As String                                 'creates provider variable
        Dim dbSource As String

        dbProvider = "Provider = Microsoft.ACE.OLEDB.12.0;"      'specifies the provider technology
        dbSource = "Data Source = C:\Users\ComputerFirstAde\Desktop\Computer First Ade VB.net\Computer First Ade\Computer First Ade\CFA_DB.mdb" 'specifies the path to the Database

        con.ConnectionString = dbProvider &amp; dbSource             'creates the connection string

        'ds.Tables.Add(dt)

        con.Open()

        Dim Connection As New OleDb.OleDbConnection("Provider = Microsoft.ACE.OLEDB.12.0" &amp; _
        "Data Source = C:\Users\ComputerFirstAde\Desktop\Computer First Ade VB.net\Computer First Ade\Computer First Ade\CFA_DB.mdb")

        'Connection.Open()

        Dim InsertCommand As New OleDb.OleDbCommand("UPDATE INTO tbl_Customers(cust_Company)" &amp; _
                "VALUES(@custCompany)", con)

        InsertCommand.Parameters.Add(New OleDb.OleDbParameter("@cust_Company", Cust_CompanyTextBox.Text))

        InsertCommand.ExecuteNonQuery()
        con.Close()

        lbl_Cust_Form.Text = "Updated Record"

    End Sub
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Sammys.Man</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451672/trying-to-update-record-into-access-db</guid>
		</item>
				<item>
			<title>Which Sql Express Version am I using?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451668/which-sql-express-version-am-i-using</link>
			<pubDate>Thu, 04 Apr 2013 11:42:12 +0000</pubDate>
			<description>How to know which version 1.Microsoft SQL Server 2008.(Express) 2.Microsoft SQL Server 2012.(Express) Both installed on my machine,am I running(using)?</description>
			<content:encoded><![CDATA[ <p>How to know which version<br />
1.Microsoft SQL Server 2008.(Express)<br />
2.Microsoft SQL Server 2012.(Express)<br />
Both installed on my machine,am I running(using)?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>chdboy</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451668/which-sql-express-version-am-i-using</guid>
		</item>
				<item>
			<title>CSV to Dataset</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451667/csv-to-dataset</link>
			<pubDate>Thu, 04 Apr 2013 11:31:03 +0000</pubDate>
			<description>Hi All, I'm taking a different approach to importing the csv to access and trying to import the csv to the dataset. I've found the following code but it's giving me an error Dim fileToOpen As String Dim da As New OleDbDataAdapter() Dim ds As New DataSet() fileToOpen = ImportFiles.SelectedItem ...</description>
			<content:encoded><![CDATA[ <p>Hi All,</p>

<p>I'm taking a different approach to importing the csv to access and trying to import the csv to the dataset.</p>

<p>I've found the following code but it's giving me an error</p>

<pre><code class="language-vb">Dim fileToOpen As String
        Dim da As New OleDbDataAdapter()
        Dim ds As New DataSet()

        fileToOpen = ImportFiles.SelectedItem

        If fileToOpen &lt;&gt; "" Then
            Dim cn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\myFilePath\;Extended Properties=" &amp; _
            ControlChars.Quote &amp; "Text;HDR=YES;FMT=Delimited" &amp; ControlChars.Quote)
            Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM C:\Users\myFilePath\" &amp; fileToOpen, cn)

            cn.Open()

            da.SelectCommand = cmd
            da.Fill(ds)

            cn.Close()

            Me.DataGridView1.DataSource = ds.Tables(0)
        Else
            MsgBox("Please choose a file to open from the list below!")
        End If
</code></pre>

<p>The error: Syntax error in FROM clause</p>

<p>I can't figure out why it is producing this error.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Tinnin</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451667/csv-to-dataset</guid>
		</item>
				<item>
			<title>INSERT INTO Syntax error</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451603/insert-into-syntax-error</link>
			<pubDate>Wed, 03 Apr 2013 17:07:38 +0000</pubDate>
			<description> con1.Open() Dim com2 As New OleDb.OleDbCommand(&quot;insert into Department(DNo,DName,Manager,AddressL1,AddressL2,City,Telephone,E-mail)values('&quot; + TextBox1.Text + &quot;','&quot; + TextBox2.Text + &quot;','&quot; + TextBox3.Text + &quot;','&quot; + TextBox4.Text + &quot;','&quot; + TextBox5.Text + &quot;','&quot; + TextBox6.Text + &quot;','&quot; + TextBox7.Text + &quot;','&quot; + TextBox8.Text + &quot;')&quot;, con1) com2.ExecuteNonQuery() MessageBox.Show(&quot;Succsessfuly Inserted&quot;, &quot;Insert&quot;, MessageBoxButtons.OK) con1.Close() Me.Hide() Form2.Show() it ...</description>
			<content:encoded><![CDATA[ <pre><code class="language-vb">con1.Open()
Dim com2 As New OleDb.OleDbCommand("insert into Department(DNo,DName,Manager,AddressL1,AddressL2,City,Telephone,E-mail)values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','" + TextBox8.Text + "')", con1)
com2.ExecuteNonQuery()
MessageBox.Show("Succsessfuly Inserted", "Insert", MessageBoxButtons.OK)
con1.Close()
Me.Hide()
Form2.Show()
</code></pre>

<p>it will display the INSERT INTO Syntax error messaage<br />
any one can help me....</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>dinesh012</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451603/insert-into-syntax-error</guid>
		</item>
				<item>
			<title>Array help</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451562/array-help</link>
			<pubDate>Wed, 03 Apr 2013 09:30:32 +0000</pubDate>
			<description>Hi Guys, wondering if someone could help me please, this is probably easy for most, but im a beginner :) i want to make an array from my dataset dataset is from (tbl_Employees) i want the array to hold 3 columns/items = item 1 (Username), item 2 (password) item 3 ...</description>
			<content:encoded><![CDATA[ <p>Hi Guys,</p>

<p>wondering if someone could help me please, this is probably easy for most, but im a beginner :)</p>

<p>i want to make an array from my dataset</p>

<p>dataset is from (tbl_Employees)</p>

<p>i want the array to hold 3 columns/items = item 1 (Username), item 2 (password) item 3 (Position)</p>

<p>i think i pretty much have the loop figgered out in my head, but i cant seem to fathom on how to build the array, any ideas?</p>

<p>many thanks guys</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Sammys.Man</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451562/array-help</guid>
		</item>
				<item>
			<title>MoveTo</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451500/moveto</link>
			<pubDate>Tue, 02 Apr 2013 12:38:12 +0000</pubDate>
			<description>Hi all, I'm trying to change the file extensions of some excel files to csv and add the file names to a list box. The box is coming up blank however. My code is as follows: Private Sub Project_Load(sender As Object, e As EventArgs) Handles Me.Load Dim importsFileList As New ...</description>
			<content:encoded><![CDATA[ <p>Hi all,</p>

<p>I'm trying to change the file extensions of some excel files to csv and add the file names to a list box. The box is coming up blank however.</p>

<p>My code is as follows:</p>

<pre><code class="language-vb">Private Sub Project_Load(sender As Object, e As EventArgs) Handles Me.Load

        Dim importsFileList As New ArrayList
        Dim sFile As String
        Dim extension As String
        Dim newExtension As String

        sFile = Dir$("C:\Users\filepath" &amp; "\*.*", vbDirectory)
        Do Until sFile = vbNullString
            If sFile &lt;&gt; "." Then ' relative path meaning this directory
                If sFile &lt;&gt; ".." Then ' relative path meaning parent directory 
                    extension = IO.Path.GetExtension(sFile)
                    If extension = ".xls" Or extension = ".xlsx" Then
                        Dim fInfo As IO.FileInfo = New IO.FileInfo(sFile)
                        newExtension = IO.Path.ChangeExtension(sFile, ".csv")
                        fInfo.MoveTo(newExtension)
                    End If
                End If
            End If
            sFile = Dir$()
        Loop

        sFile = Dir$("C:\Users\filepath" &amp; "\*.*", vbDirectory)
        Do Until sFile = vbNullString
            If sFile &lt;&gt; "." Then ' relative path meaning this directory
                If sFile &lt;&gt; ".." Then ' relative path meaning parent directory 
                    extension = IO.Path.GetExtension(sFile)
                    If extension = ".csv" Then
                        importsFileList.Add(sFile)
                    End If
                End If
            End If
            sFile = Dir$()
        Loop

        For Each importedFile In importsFileList
            ImportFiles.Items.Add(importedFile)
        Next
</code></pre>

<p>Where am I going wrong?</p>

<p>Thanks in advance for any suggestions offered.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Tinnin</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451500/moveto</guid>
		</item>
				<item>
			<title>Query Error</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451486/query-error</link>
			<pubDate>Tue, 02 Apr 2013 08:43:07 +0000</pubDate>
			<description> Hi i got this problem and i dont why it occured in my query i know that the Table name is correct and the Column Name is correct but this error always appear No value given for one or more required parameters. the it highlights the da.fill(dt) Dim da As ...</description>
			<content:encoded><![CDATA[ <p>Hi i got this problem and i dont why it occured<br />
in my query i know that the Table name is correct and the Column Name is correct but<br />
this error always appear</p>

<p>No value given for one or more required parameters.<br />
the it highlights the da.fill(dt)</p>

<pre><code class="language-vb">Dim da As New OleDbDataAdapter("Select * from Government_BAU where Months like January", con)
        da.Fill(dt)
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Zick Technology</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451486/query-error</guid>
		</item>
				<item>
			<title>SQL Server 2008 adding space to the end of text records.</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451440/sql-server-2008-adding-space-to-the-end-of-text-records</link>
			<pubDate>Tue, 02 Apr 2013 00:22:37 +0000</pubDate>
			<description>Group, In reviewing the data in one of my SQL Server tables, I noticed that my nchar or nvarchar fields have additional spaces added to the end of the record. Is there a way to stop this? Should I be using a different data type? In advance, thanks for your ...</description>
			<content:encoded><![CDATA[ <p>Group,</p>

<p>In reviewing the data in one of my SQL Server tables, I noticed that my nchar or nvarchar fields have additional spaces added to the end of the record.  Is there a way to stop this?  Should I be using a different data type?</p>

<p>In advance, thanks for your responses.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451440/sql-server-2008-adding-space-to-the-end-of-text-records</guid>
		</item>
				<item>
			<title>Textbox Autocomplete</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451439/textbox-autocomplete</link>
			<pubDate>Mon, 01 Apr 2013 23:33:59 +0000</pubDate>
			<description>Hi, All, Greetings! Is this doable? I have a textbox for email address entry, now, when I type the email address and reach the @ character, there will be a dropdown suggesting common domains like msn.com,hotmail.com, aol.com, yahoo.com and etc. I hope you can help me. Thanks in advance.</description>
			<content:encoded><![CDATA[ <p>Hi, All,</p>

<p>Greetings!</p>

<p>Is this doable? I have a textbox for email address entry, now, when I type the email address and reach the @ character, there will be a dropdown suggesting common domains like msn.com,hotmail.com, aol.com, yahoo.com and etc.</p>

<p>I hope you can help me. Thanks in advance.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>renzlo</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451439/textbox-autocomplete</guid>
		</item>
				<item>
			<title>form seems to reactivate</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451340/form-seems-to-reactivate</link>
			<pubDate>Sun, 31 Mar 2013 15:58:46 +0000</pubDate>
			<description>I have a simple data input form in which when the form is activated if sets focus on a textbox and sets the back color. I later have a datetimepicker control. The tab stops are coreectly set but when ever the users selects a a date from the datetimepicker the ...</description>
			<content:encoded><![CDATA[ <p>I have a simple data input form in which when the form is activated if sets focus on a textbox and sets the back color. I later have a datetimepicker control. The tab stops are coreectly set but when ever the users selects a a date from the datetimepicker the form seems to send a form activated event, because the cursur/focus moves to the first textbox instead of the next tab stop. If I comment out the "form activated" event the form functions properly. Why does this happen? Does the datetimepicker send "form activated"? How can I work around this. I want to set the focus only the first time the form is loaded, from that point on I want the tab control to dictate the navigation.</p>

<p>thanks</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>NYCRAVEN</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451340/form-seems-to-reactivate</guid>
		</item>
				<item>
			<title>Populate TextBox from DataGridView</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451315/populate-textbox-from-datagridview</link>
			<pubDate>Sun, 31 Mar 2013 07:40:40 +0000</pubDate>
			<description>Hello, I have been working on a time clock application, and I'm trying to be able to select an employee from the DataGridView and populate their information into text boxes. I have done some research and what I have found works . . . sometimes. So sometimes when I click ...</description>
			<content:encoded><![CDATA[ <p>Hello,</p>

<p>I have been working on a time clock application, and I'm trying to be able to select an employee from the DataGridView and populate their information into text boxes. I have done some research and what I have found works . . . sometimes. So sometimes when I click on an employee it will show their name in the box other times I have to click around alot to do it. Any suggestions on a better way to do this?</p>

<p>~Scarlett~<br />
Here's my code:</p>

<pre><code class="language-vb">  Private Sub dgvEmployee_CellContentClick(sender As System.Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvEmployee.CellContentClick

        Dim dgvRow As DataGridViewRow
        For Each dgvRow In dgvEmployee.SelectedRows
            txtName.Text = dgvRow.Cells("Employee").Value.ToString
        Next

    End Sub
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>ScarWars9</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451315/populate-textbox-from-datagridview</guid>
		</item>
				<item>
			<title>Whats Wrong With This HttpWebRequest POST?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451291/whats-wrong-with-this-httpwebrequest-post</link>
			<pubDate>Sat, 30 Mar 2013 17:48:04 +0000</pubDate>
			<description>Hello, I need to know why this isn't working... I have tried many different things but still can't get it to work. (And, yes, I have replaced the MYPASSHERE with my password but it always says I have not registered yet...) Imports System.Net Imports System.IO Imports System.Text Public Class Form1 ...</description>
			<content:encoded><![CDATA[ <p>Hello,</p>

<p>I need to know why this isn't working... I have tried many different things but still can't get it to work. (And, yes, I have replaced the MYPASSHERE with my password but it always says I have not registered yet...)</p>

<pre><code class="language-vb">Imports System.Net
Imports System.IO
Imports System.Text
Public Class Form1

    Dim logincookies As CookieContainer

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim PostData As String = "action=do_login&amp;url=http%3A%2F%2Fhighqualityforums.com%2F&amp;quick_login=1&amp;quick_username=yorkiebar15&amp;quick_password=MYPASSHERE&amp;submit=Login&amp;quick_remember=yes"
        Dim TempCookies As New CookieContainer 'Temp Cookies
        Dim Encoding As New UTF8Encoding 'Declaring it
        Dim ByteData As Byte() = Encoding.GetBytes(PostData) 'Converting since it can't read VB.Net strings

        Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create("<a href="http://highqualityforums.com/member.php" rel="nofollow">http://highqualityforums.com/member.php</a>"), HttpWebRequest)
        postReq.Method = "POST" 'The method is to "POST" the Login Data
        postReq.KeepAlive = True 'No timeouts
        postReq.CookieContainer = tempCookies 'Use Temp Cookies, you'll see why later.
        postReq.ContentType = "application/x-www-form-urlencoded" 'It's an HTML Form
        postReq.Referer = "<a href="http://highqualityforums.com/" rel="nofollow">http://highqualityforums.com/</a>"
        postReq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)"
        postReq.ContentLength = ByteData.Length 'Counts ByteData Length

        Dim postreqstream As Stream = postReq.GetRequestStream()
        postreqstream.Write(ByteData, 0, ByteData.Length)
        postreqstream.Close()
        Dim postresponse As HttpWebResponse

        postresponse = DirectCast(postReq.GetResponse(), HttpWebResponse)
        TempCookies.Add(postresponse.Cookies) 'We want those cookies
        logincookies = TempCookies ' Will let us browse with it later
        Dim postreqreader As New StreamReader(postresponse.GetResponseStream())

        Dim ThePage As String = postreqreader.ReadToEnd 'We now have a string with the page.

        WebBrowser1.DocumentText = ThePage
    End Sub
End Class
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Yorkiebar14</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451291/whats-wrong-with-this-httpwebrequest-post</guid>
		</item>
				<item>
			<title>.fill takes ages to load when updating access database</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451288/.fill-takes-ages-to-load-when-updating-access-database</link>
			<pubDate>Sat, 30 Mar 2013 17:08:17 +0000</pubDate>
			<description>I am running a database with about 200,000 records, so not too big. It runs fine except when I try to update one of the tables. Here is the code: Private Sub Add_History() Dim cb5 As New OleDb.OleDbCommandBuilder(da5) Dim dsNewRow5 As DataRow Dim sql5 As String sql5 = &quot;SELECT * ...</description>
			<content:encoded><![CDATA[ <p>I am running a database with about 200,000 records, so not too big. It runs fine except when I try to update one of the tables. Here is the code:</p>

<pre><code class="language-vb">      Private Sub Add_History()

        Dim cb5 As New OleDb.OleDbCommandBuilder(da5)
        Dim dsNewRow5 As DataRow

        Dim sql5 As String
        sql5 = "SELECT * FROM tblHistory order by ID"

        dsNewRow5 = ds5.Tables("History").NewRow()

        ds5.Tables("History").Rows.Add(dsNewRow5)

        da5.Update(ds5, "History")

        da5.Dispose()
        ds5.Clear()
        da5 = New OleDb.OleDbDataAdapter(sql5, con)
        da5.Fill(ds5, "History")

        da5.Update(ds5, "History")

        New_hist()
errr:
    End Sub

      Private Sub New_hist()

        Dim cb5 As New OleDb.OleDbCommandBuilder(da5)
        Dim x
        On Error GoTo errr

        ds5.Tables("History").Rows(Hist_Rows - 1).Item(6) = contactID
        ds5.Tables("History").Rows(Hist_Rows - 1).Item(1) = DateTime.Now
        ds5.Tables("History").Rows(Hist_Rows - 1).Item(3) = username

da5.Update(ds5, "History")

    End Sub
</code></pre>

<p>Its the  da5.Fill(ds5, "History") that takes about 10 seconds to fill. If there are no new updates, ie I dont use</p>

<pre><code class="language-vb">            dsNewRow5 = ds5.Tables("History").NewRow()

            ds5.Tables("History").Rows.Add(dsNewRow5)

            da5.Update(ds5, "History")
</code></pre>

<p>then it fills instantly. It seems that when you want to add a record the fill takes forever.</p>

<p>Anyone got any ideas how I can speed this process up.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>UKnod</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451288/.fill-takes-ages-to-load-when-updating-access-database</guid>
		</item>
				<item>
			<title>Deleting a second Dataset</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451229/deleting-a-second-dataset</link>
			<pubDate>Fri, 29 Mar 2013 19:47:23 +0000</pubDate>
			<description>While creating a module within my program, I created a second Dataset (and it's called DesignDataSet2). I would like to delete it from the database altogether. I have already removed the one datatable that was within this dataset. I now want to eliminate this completely. How do I go about ...</description>
			<content:encoded><![CDATA[ <p>While creating a module within my program, I created a second Dataset (and it's called DesignDataSet2).  I would like to delete it from the database altogether.</p>

<p>I have already removed the one datatable that was within this dataset.  I now want to eliminate this completely.  How do I go about doing this?  I haven't seen a "delete" option when right-clicking that specific dataset.</p>

<p>Help!!</p>

<p>In advance, thanks for the help.</p>

<p>Don</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>doncwilson_1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451229/deleting-a-second-dataset</guid>
		</item>
				<item>
			<title>vb.net keypress events</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/451195/vb.net-keypress-events</link>
			<pubDate>Fri, 29 Mar 2013 12:11:11 +0000</pubDate>
			<description>I am working on a keyboard teaching aid similar to mavis beacon. With the following code i am able to detect if the enter key is pressed on the keyboard. If e.KeyChar = Microsoft.VisualBasic.ChrW(keys.enter) Then MsgBox(&quot;Enter key is pressed&quot;) End If but what i want to do is that i ...</description>
			<content:encoded><![CDATA[ <p>I am working on a keyboard teaching aid similar to mavis beacon. With the following code i am able to detect if the enter key is pressed on the keyboard.</p>

<pre><code class="language-vb">If e.KeyChar = Microsoft.VisualBasic.ChrW(keys.enter) Then
    MsgBox("Enter key is pressed")
End If
</code></pre>

<p>but what i want to do is that i want to make the keyword "keys.enter" to become a variable name so that the whole code can be called upon as a subroutine to handle all types of letter being pressed by the user so that i dont have to repeat the whole code for the keys needed. Thanks in advance</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>babateejay</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/451195/vb.net-keypress-events</guid>
		</item>
				<item>
			<title>Visual Basic Express fill combo box from SQL qry</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/450997/visual-basic-express-fill-combo-box-from-sql-qry</link>
			<pubDate>Tue, 26 Mar 2013 13:04:36 +0000</pubDate>
			<description>Hi - I am a pretty remedial visual studio express user. I recently understood how to do cascading comboboxes using the binding sources of the related tables, eg tbl 1 Make, Table 2 model, so as eg only ford models displayed in cbo2 if Ford selected in cbo1 - thanks ...</description>
			<content:encoded><![CDATA[ <p>Hi - I am a pretty remedial visual studio express user. I recently understood how to do cascading comboboxes using the binding sources of the related tables, eg tbl 1 Make, Table 2 model, so as eg only ford models displayed in cbo2 if Ford selected in cbo1 - thanks to Beth Massi!</p>

<p>However I'm having some trouble with the following scenario. I have a 'tblUser' table with fields: Name, Name_id, Firstname and Surname. I have a tblAsset' table with fields: 'AssetNo' and 'Description'. On form I have 4 controls: 2 x cbo and 2 x txt. Now, there is no direct link between Asset and User tables, because our administrators don't put the current user User IDs or names in the Asset container in AD!...at least not in their own field... Just some daft free text field called 'Description', which has the current user of an asset as part of the description string, eg "SOH-12345, Room 2b, Melanie Jones". So what I successfully did in access was use a LIKE statement to get (eg) all the 'Jones' entries in a combobox (using the Surname field on the form) then select the correct one, and use the related AssetNo. (The reason for this was so I could use the resulting AssetNo as the value to remote control a PC using Remote Access/MSRA in Windows). So basically the SQL says something like SELECT tblAsset.Description WHERE Description LIKE "<em>" &amp; txtSurname &amp; "</em>".</p>

<p>I'm a bit stumped, and I guess it's a lack of knowledge about creating a dataset from this query, i'm not sure. What I need to do is use cboUser to select a user (Eg Mel Jones), that user's Surname appears in txtSurname. Then cboUserAsset needs to display all the 'Jones's' entries in the 'Description' field of the Asset table, and I select the one that says "SOH-54321, Room 2b, Mel Jones". When I select that, txtAsset is populated with "SOH-54321", and I can use that to run a connect command in MSRA.</p>

<p>So it looks like cboUser would fire off the SQL string and populate cboUserAsset, but I'm not sure how to get that data in that control. Sorry this is long-winded. I'm looking all over, and will continue to, but can anyone shed some light on what I'm not 'getting'? Many Thanks.</p>

<p>(For Info, I use VB express 10, and connect to my tables using the programme datasources function.)</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>mnorton</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/450997/visual-basic-express-fill-combo-box-from-sql-qry</guid>
		</item>
				<item>
			<title>Table Name Loop</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/450952/table-name-loop</link>
			<pubDate>Tue, 26 Mar 2013 00:52:51 +0000</pubDate>
			<description>Hi this code is to fill up my Combo1 Item which is came from my Table1 .Combo_Main_AM.Items.Clear() Dim da As New OleDbDataAdapter(&quot;Select * from Table1&quot;, con) da.Fill(dt) For Each myRow In dt.Rows .Combo1.Items.Add(myRow.Item(0)) Next so it will add up the combo1 Jessie James Nick now the question is how can ...</description>
			<content:encoded><![CDATA[ <p>Hi this code is to fill up my Combo1 Item which is came from my Table1</p>

<pre><code class="language-vb">        .Combo_Main_AM.Items.Clear()
        Dim da As New OleDbDataAdapter("Select * from Table1", con)
        da.Fill(dt)
        For Each myRow In dt.Rows
            .Combo1.Items.Add(myRow.Item(0))
        Next
</code></pre>

<p>so it will add up the combo1</p>

<p>Jessie<br />
James<br />
Nick</p>

<p>now the question is how can i get the that name to be used in my query?<br />
using loop?<br />
i will use it to be the name of my table i want to search.</p>

<pre><code class="language-vb">da.fill(dt)
Dim da As New OleDbDataAdapter("Select * from dt", con)
    'Code here
Next
</code></pre>

<p>I hope you understand what i mean.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Zick Technology</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/450952/table-name-loop</guid>
		</item>
				<item>
			<title>Database application for VB</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/450941/database-application-for-vb</link>
			<pubDate>Mon, 25 Mar 2013 19:06:48 +0000</pubDate>
			<description>Hello, I am new here. I would like to ask opinion from you guys on what are the best options available for me to develop a database system using Visual basic? I am using Visual Basic Express Edition. My problem: I am currently developing a toolkit that needs the user ...</description>
			<content:encoded><![CDATA[ <p>Hello, I am new here. I would like to ask opinion from you guys on what are the best options available for me to develop a database system using Visual basic? I am using Visual Basic Express Edition.</p>

<p>My problem: I am currently developing a toolkit that needs the user to insert information and put it into a database system. After that, I need to extract and analyse the data and present it in graphical form (pareto, histogram, and pie chart) also in VB.</p>

<p>I am not familiar with VB, and based from what I've studied and from my research, there are few options. So, my questions are,</p>

<p>a) Is it possible for me to use VB stand alone as the database and perform all the required actions needed using it?</p>

<p>or,</p>

<p>b) is it better to use Excel and link it to my VB program?</p>

<p>or,</p>

<p>c) use Microsoft Access instead, and link it to my VB program?</p>

<p>Please help me on this matter. Thank you in advance.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Mireya B.</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/450941/database-application-for-vb</guid>
		</item>
			</channel>
</rss>