<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>VB.NET Forum RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest threads from the 'VB.NET' forum at Programmer's Heaven, excluding replies.</description>
    <language>en</language>
    <copyright>Copyright 2008 Programmers Heaven</copyright>
    <pubDate>Mon, 01 Dec 2008 19:18:52 -0700</pubDate>
    <lastBuildDate>Mon, 01 Dec 2008 19:18:52 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Parameters.count equals 0</title>
      <link>http://www.programmersheaven.com/mb/VBNET/382236/382236/parameterscount-equals-0/</link>
      <description>I am using VB.NET 2005 to access a MySQL 5 database.&lt;br /&gt;
I expected the following code snippet to give me a parameter count of 3 but it gives me 0. &lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
- The connection to DB is established (tested)&lt;br /&gt;
&lt;br /&gt;
Any ideas? &lt;br /&gt;
Please help!&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;'Create a connection to DB
Dim cn as New ADODB.Connection
cn.Mode = ADODB.ConnectModeEnum.adModeReadWrite
cn.CursorLocation = ADODB.CursorLocationEnum.adUseClient
cn.Open("MyDSN_Name_ODBC")

'Run Parameter Query
Dim cmd As New ADODB.Command
cmd.ActiveConnection = cn
cmd.CommandText = "INSERT INTO `tblgroups` ( " &amp;amp; _
           " `groupID` , `GroupName` , `Description` " &amp;amp; _
          " ) VALUES ( " &amp;amp; _
          "  ? , ? , ? " &amp;amp; _
          ")"
'Debug
Msgbox(cmd.Parameters.count) ' It gives me 0, WHY????
...&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Wed, 26 Nov 2008 03:15:05 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>This post has been deleted.</title>
      <link>http://www.programmersheaven.com/mb/VBNET/382172/382172/this-post-has-been-deleted/</link>
      <description>This post has been deleted.</description>
      <pubDate>Mon, 24 Nov 2008 03:38:19 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Accessing the SQL Database available in other server with my same LAN</title>
      <link>http://www.programmersheaven.com/mb/VBNET/382170/382170/accessing-the-sql-database-available-in-other-server-with-my-same-lan/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
Iam very new to VB.Net. Even I can say today only I started the project in VB.NET&lt;br /&gt;
&lt;br /&gt;
My requirement:-&lt;br /&gt;
&lt;br /&gt;
Currently we are having 3-servers. Myself is logged-in to server called - " SERVER-1 " &amp;amp; My User name with server - " Bond ", Password - " 007 "&lt;br /&gt;
&lt;br /&gt;
And the SQL SERVER 2005 is available in another system and that server called "SERVER-2"  and his user name is " Raj" , Password - "123"&lt;br /&gt;
but all are in same LAN&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How to connect with that sql server available in another machine ?&lt;br /&gt;
&lt;br /&gt;
The following details I collected from that sql server..........&lt;br /&gt;
&lt;br /&gt;
Server Name :    abcde2&lt;br /&gt;
user name    :    SERVER-1 \ Raj&lt;br /&gt;
&lt;br /&gt;
Codings:&lt;br /&gt;
Dim con As New SqlConnection("server=server-2; database=emp_management; uid=Server-1\Raj")&lt;br /&gt;
&lt;br /&gt;
From MAHEY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Sun, 23 Nov 2008 23:48:01 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Problem with SETUP &amp; DEPLOYMENT</title>
      <link>http://www.programmersheaven.com/mb/VBNET/382102/382102/problem-with-setup--deployment/</link>
      <description>I have run / debug my application and it is not giving me any errors.  The moment i tried to create a setup and deployment i start getting problems.  The setup file is created and when i install it, it does what it is supposed to do.  BUT.. when i run it , it says Exeption was thrown in Mymodule.vb.&lt;br /&gt;
&lt;br /&gt;
I have the module here, and it looks fine.  Can anybody tell me what is going on.&lt;br /&gt;
&lt;br /&gt;
Is there anybody to whom i can send ALL of my code, to help me, yust with the compiling..  This is a project for College i am working on, and my time is running out.  PLEASE HELP...!!!&lt;br /&gt;
Here is the mymodule code..&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Public Module MyModule
    Dim Rs_AppPath As String = System.IO.Directory.GetCurrentDirectory
    Public testname1, testname2, testname3, testname4, testname5, testname6, testname7, testname8, testname9, testname10 As String
    Public AmountTests As Integer
    Public str As String = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" &amp;amp; Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("bin")) &amp;amp; "libra.mdb;Mode=Share Deny None;Extended Properties=;Jet OLEDB:System database=;Jet OLEDB:Registry Path=;Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"
    Public currentstudent As String
    Public lecturerdays1, lecturerdays2, lecturerdays3, lecturerdays4 As Integer

End Module
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Fri, 21 Nov 2008 06:49:34 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>properties of single contol in a control array set up in a class</title>
      <link>http://www.programmersheaven.com/mb/VBNET/382070/382070/properties-of-single-contol-in-a-control-array-set-up-in-a-class/</link>
      <description>I have set up a control array by making a class and using clickhandlers.  What i need to do, is when the user clicks a control, i need that control to change position.  I tried setting it up the same way as the message box i set up (below) but it didnt work.&lt;br /&gt;
&lt;br /&gt;
MessageBox.Show("you have picked " &amp;amp; CType(CType(sender, _  System.Windows.Forms.Button).Tag, String) &amp;amp; " dollars.")&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Thu, 20 Nov 2008 06:45:33 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>UPDATE SQL CE Server via DataAdapter</title>
      <link>http://www.programmersheaven.com/mb/VBNET/382030/382030/update-sql-ce-server-via-dataadapter/</link>
      <description>Hi All,&lt;br /&gt;
&lt;br /&gt;
I have an issue which I have been trying to resolve for a couple of days. I am trying to update the SQL CE Server (which is in my project) with the changes that have been made to my dataset.&lt;br /&gt;
&lt;br /&gt;
Code: &lt;br /&gt;
&lt;br /&gt;
        Dim myConn As SqlCeConnection = New SqlCeConnection(My.Settings.db_Database_Applicatio
n_ConnectionString)&lt;br /&gt;
&lt;br /&gt;
        Dim myDataAdaptor As New SqlCeDataAdapter&lt;br /&gt;
&lt;br /&gt;
        Dim mySQLCommandUpdate As SqlCeCommand = New SqlCeCommand("UPDATE tblTutors SET Password = 'pass'", myConn)&lt;br /&gt;
&lt;br /&gt;
        Dim mySQLCommand As SqlCeCommand = New SqlCeCommand("SELECT * FROM tblTutors", myConn)&lt;br /&gt;
&lt;br /&gt;
        Dim myDataset As DataSet = New DataSet&lt;br /&gt;
&lt;br /&gt;
        myConn.Open()&lt;br /&gt;
&lt;br /&gt;
        myDataset.Clear()&lt;br /&gt;
&lt;br /&gt;
        myDataAdaptor.SelectCommand = mySQLCommand&lt;br /&gt;
        myDataAdaptor.UpdateCommand = myConn.CreateCommand&lt;br /&gt;
        myDataAdaptor.UpdateCommand.CommandText = ("UPDATE tblTutors SET Password = 'password'")&lt;br /&gt;
&lt;br /&gt;
        mySQLCommandUpdate.ExecuteNonQuery()&lt;br /&gt;
&lt;br /&gt;
        myDataAdaptor.Fill(myDataset, "tblTutors")&lt;br /&gt;
&lt;br /&gt;
        DataGridView1.DataSource = myDataset&lt;br /&gt;
        DataGridView1.DataMember = "tbltutors"&lt;br /&gt;
&lt;br /&gt;
        myDataAdaptor.Update(myDataset, "tbltutors")&lt;br /&gt;
&lt;br /&gt;
        myConn.Close()&lt;br /&gt;
&lt;br /&gt;
The changes seem fine when displaying the data in the DataGridView however the changes have not been made to the SQL CE Server itself.&lt;br /&gt;
&lt;br /&gt;
Can anyone spot where I am going wrong here?&lt;br /&gt;
&lt;br /&gt;
Any help is much appreciated.</description>
      <pubDate>Wed, 19 Nov 2008 03:17:49 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Updating SQL Join via DATASET</title>
      <link>http://www.programmersheaven.com/mb/VBNET/382019/382019/updating-sql-join-via-dataset/</link>
      <description>I need some help, I have been at this for a few days... &lt;br /&gt;
I have a datagridview that I am populating with an SQL JOIN with the following stored procedure... &lt;br /&gt;
&lt;br /&gt;
CREATE PROCEDURE sp_company_GRIDVIEW_Iuserid_companyid&lt;br /&gt;
@companytypenumber int, &lt;br /&gt;
@iuserid int &lt;br /&gt;
 AS&lt;br /&gt;
Select tblcompany.CompanyName as [Company Name], &lt;br /&gt;
tblcompanytypes.Companytype as [Group Name],&lt;br /&gt;
tblcompany.phoneNumber as [Phone Number],&lt;br /&gt;
tblcompany.Altphone as [Alternate Phone], &lt;br /&gt;
tblcompany.Address, &lt;br /&gt;
tblcompany.city, &lt;br /&gt;
tblcompany.EmailAddress as [Email Address] &lt;br /&gt;
From tblcompany INNER JOin tblcompanytypes ON&lt;br /&gt;
tblcompany.companytypeNumber = tblcompanytypes.companytypenumber &lt;br /&gt;
Where tblcompanytypes.IUSERID = @iuserid And tblcompanytypes.companytypenumber = @companytypenumber&lt;br /&gt;
GO&lt;br /&gt;
&lt;br /&gt;
The results are successfully returned into the datagridview, and it works great, &lt;br /&gt;
However I would like to implement the functionality to update, insert, and delete from the datagrid.  &lt;br /&gt;
&lt;br /&gt;
To start with the following code, saves changes to my dataset, with the cellendedit event of the datagrid with following.. &lt;br /&gt;
&lt;br /&gt;
Private Sub dgcompanies_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgcompanies.CellEndEdit&lt;br /&gt;
        If Me.PersDB01DataSet.HasChanges Then&lt;br /&gt;
            Me.PersDB01DataSet.AcceptChanges()&lt;br /&gt;
&lt;br /&gt;
        End If&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
There is a save button, that I want to update persdb01dataset to the datasource.  &lt;br /&gt;
What is the best way to do this? I am really stuck and in need of some help. &lt;br /&gt;
Any help is much appreciated, thank you very much. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Tue, 18 Nov 2008 20:41:29 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Port lookup</title>
      <link>http://www.programmersheaven.com/mb/VBNET/382011/382011/port-lookup/</link>
      <description>Hi everyone,&lt;br /&gt;
&lt;br /&gt;
I'm looking for help in figuring out how to look up ports in my program. What I want to do is search for ports that already have devices connected to the computer, and then assign those within the program.&lt;br /&gt;
&lt;br /&gt;
The way it works right now is that I have to manually assign the ports used in the console. I want the program to look up a string that the device is currently sending to the computer, the code will recognize that string and realize what port it's coming from, then set the device to that port automatically.&lt;br /&gt;
&lt;br /&gt;
Does anyone have any suggestions as to how I should go about writing code to search for ports in use and assigning them?&lt;br /&gt;
&lt;br /&gt;
(I'm slightly new to programming, so any help at all is appreciated.)&lt;br /&gt;</description>
      <pubDate>Tue, 18 Nov 2008 11:57:02 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Navigating a Dataset</title>
      <link>http://www.programmersheaven.com/mb/VBNET/382005/382005/navigating-a-dataset/</link>
      <description>What is the best place (event/procedure) to use the newest record when navigating from record to record on a form.&lt;br /&gt;
&lt;br /&gt;
For example, I want to do a calculation on 2 text boxes that are bound to a dataset. This calculation will be done each time a new record is navigated to.&lt;br /&gt;
&lt;br /&gt;
This seams basic but I am new to .net and can't see, to find the best way.&lt;br /&gt;
Thanks&lt;br /&gt;</description>
      <pubDate>Tue, 18 Nov 2008 09:18:05 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Datagridview - Add columns and Rows based on 2 or dates</title>
      <link>http://www.programmersheaven.com/mb/VBNET/381985/381985/datagridview---add-columns-and-rows-based-on-2-or-dates/</link>
      <description>Greeting coders...&lt;br /&gt;
I am working on something and google isn't finding what I need.&lt;br /&gt;
&lt;br /&gt;
I use mysql 4.x , VB 2008 Express&lt;br /&gt;
Datagridview = DGV from here on...&lt;br /&gt;
&lt;br /&gt;
I have 10/10/2008 and 10/20/2008 (example dates)&lt;br /&gt;
How can I add a # of cloumns (the DATEDIFF of those 2 dates) with the each date as a column header.&lt;br /&gt;
&lt;br /&gt;
I can get the datediff. But I don't know how I can loop around my table row.&lt;br /&gt;
This is what I have in my table.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;roomRates   |StartDate   | EndDate    |
---------------------------------------
BaseRate    | 10/10/2008 | 10/20/2008 |&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
and I want the grid to look like.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;---------------------------------------------------------
DATE     | 10/10/08  | 10/11/08 | 10/12/08  | 10/13/08  |
BaseRate | x price   | xprice $ | xprice $  |    price  |
---------------------------------------------------------&lt;/pre&gt;&lt;br /&gt;
I don't want to end up having a field for every day in a year.&lt;br /&gt;
Thanks for any ideas or pointers.&lt;br /&gt;
HP.</description>
      <pubDate>Mon, 17 Nov 2008 23:42:05 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>control another application from vb.net</title>
      <link>http://www.programmersheaven.com/mb/VBNET/381915/381915/control-another-application-from-vbnet/</link>
      <description>I need to control another application from vb.net by simulating keyboard and mouse entries.&lt;br /&gt;
The idea is to auomatize tasks of changing prices on an e-commerce solution's control panel because I have no direct access to the database.&lt;br /&gt;
Can somebody help me?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Sat, 15 Nov 2008 16:12:04 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>strange behavior with property procedures</title>
      <link>http://www.programmersheaven.com/mb/VBNET/381854/381854/strange-behavior-with-property-procedures/</link>
      <description>I have some code that is deliberately programmed in a non-standard way, so I'm not looking for someone to point that out. When it's coded right, I get the proper results. However the results are not what I thought they would be with the non-standard code. &lt;br /&gt;
&lt;br /&gt;
I spent some time walking through the code with the debugger. Everything was working right until just before the end, when the correct value that should have been returned changed to minus 1. Purely as a matter of curiosity, I'd like to know what's going on with the code to produce the strange result. Here it is:&lt;br /&gt;
&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;
        Dim cls As New Class1&lt;br /&gt;
        cls.Area = 8.34D&lt;br /&gt;
        cls.Price = 31.22D&lt;br /&gt;
        MsgBox(Format(cls.TotalCost, "Fixed"))&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
Public Class Class1&lt;br /&gt;
    Private pricee As Decimal&lt;br /&gt;
    Private areea As Decimal&lt;br /&gt;
    Private totCost As Decimal&lt;br /&gt;
&lt;br /&gt;
    Public ReadOnly Property TotalCost() As Decimal&lt;br /&gt;
        Get&lt;br /&gt;
            Return totCost = Area * Price&lt;br /&gt;
        End Get&lt;br /&gt;
    End Property&lt;br /&gt;
&lt;br /&gt;
    Public Property Area() As Decimal&lt;br /&gt;
        Get&lt;br /&gt;
            Return areea&lt;br /&gt;
        End Get&lt;br /&gt;
        Set(ByVal value As Decimal)&lt;br /&gt;
            If value &amp;lt; 1000 Then&lt;br /&gt;
                areea = value&lt;br /&gt;
            Else&lt;br /&gt;
                areea = 0&lt;br /&gt;
            End If&lt;br /&gt;
            totCost = value * Price&lt;br /&gt;
        End Set&lt;br /&gt;
    End Property&lt;br /&gt;
&lt;br /&gt;
    Public Property Price() As Decimal&lt;br /&gt;
        Get&lt;br /&gt;
            Return pricee&lt;br /&gt;
        End Get&lt;br /&gt;
        Set(ByVal value As Decimal)&lt;br /&gt;
            pricee = value&lt;br /&gt;
            totCost = value * Area&lt;br /&gt;
        End Set&lt;br /&gt;
&lt;br /&gt;
    End Property&lt;br /&gt;
&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Thu, 13 Nov 2008 21:36:12 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>How NOT to print 'White Spaces'</title>
      <link>http://www.programmersheaven.com/mb/VBNET/381823/381823/how-not-to-print-white-spaces/</link>
      <description>Here is the code i using to print a report.  The report is print fine.  BUT , the problem is that the 3rd column is not indent correctly.  I assume that it has to do with WHITE SPACES.  I tried to TRIM and PAD, but not luck.  How can i make sure that my columns are indented corectly?&lt;br /&gt;
&lt;br /&gt;
  &lt;pre class="sourcecode"&gt; private Sub Doc_PrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs)
        Dim doc As TextDocument = DirectCast(sender, TextDocument)
        Dim lineHeight As Single = Font.GetHeight(e.Graphics)
        Dim x As Single = e.MarginBounds.Left
        Dim y As Single = e.MarginBounds.Top
        doc.PageNumber += 1 
        Dim fnt4 As New Font("Arial", 9, FontStyle.Italic)
        e.Graphics.DrawString(TextBox1.Text &amp;amp; vbTab &amp;amp; vbTab &amp;amp; vbTab &amp;amp; DateTimePicker1.Text, fnt4, Brushes.Black, x, y)
        y += lineHeight
        y += lineHeight
        Dim fnt2 As New Font("Arial", 14, FontStyle.Underline)
        e.Graphics.DrawString("TEST RESULT : " &amp;amp; Trim(PUBMYLECTURER) &amp;amp; vbTab &amp;amp; " CAMPUS: " &amp;amp; PUBMYCOLLEGE, fnt2, Brushes.Black, x, y)
        y += lineHeight
        y += lineHeight
        Dim fnt3 As New Font("Arial", 12, FontStyle.Bold)
        e.Graphics.DrawString(" GROUP :" &amp;amp; PUBCLASSGROUP &amp;amp; "  FOR: " &amp;amp; pagetesttitle, fnt3, Brushes.Black, x, y)
        y += lineHeight
        Using fnt As New Font("Arial", 10)
            While ((y + lineHeight) &amp;lt; e.MarginBounds.Bottom And doc.Offset &amp;lt;= doc.Text.GetUpperBound(0))
                e.Graphics.DrawString("___________________________
__________________________________________________
_________", Font, Brushes.Black, x, y)
                y += lineHeight
                Dim R As New RectangleF(x, y, 80, 80)
                e.Graphics.DrawString(doc.Text(doc.Offset), Font, Brushes.Black, x, y)
                doc.Offset += 1
                y += lineHeight
            End While
            y += lineHeight
            y += lineHeight
            Dim fnt5 As New Font("Arial", 9, FontStyle.Italic)
            e.Graphics.DrawString(TextBox2.Text, fnt5, Brushes.Black, x, y)
            If doc.Offset &amp;lt; doc.Text.GetUpperBound(0) Then
                e.HasMorePages = True ' There is still at least one more page. Signal this event to fire again.
            Else
                doc.Offset = 0 ' Printing is complete.
            End If
        End Using
    End Sub     &lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
 Sub PRINTTEST(ByVal CLASSGROUP, ByVal testtype)
        ' Create a document with 100 lines.
        Dim studentarr, studentcode2 As String
        Dim a As Integer = 1
        Dim testamount As Integer
        PUBCLASSGROUP = CLASSGROUP
        'con.Open()
        If testtype = "test1" Then
            adp2 = New OleDbDataAdapter("select studentname, studentcode,test1 from tests where studentclass = '" &amp;amp; CLASSGROUP &amp;amp; "'  order by studentname ", con)
            pagetesttitle = pubmytest1
        End If
        If testtype = "test2" Then
            adp2 = New OleDbDataAdapter("select studentname, studentcode,test2 from tests where studentclass = '" &amp;amp; CLASSGROUP &amp;amp; "'  order by studentname ", con)
            pagetesttitle = pubmytest2
        End If
        If testtype = "test3" Then
            adp2 = New OleDbDataAdapter("select studentname, studentcode,test3 from tests where studentclass = '" &amp;amp; CLASSGROUP &amp;amp; "'  order by studentname ", con)
            pagetesttitle = pubmytest3
        End If
        If testtype = "test4" Then
            adp2 = New OleDbDataAdapter("select studentname, studentcode,test4 from tests where studentclass = '" &amp;amp; CLASSGROUP &amp;amp; "'  order by studentname ", con)
            pagetesttitle = pubmytest4
        End If
        If testtype = "test5" Then
            adp2 = New OleDbDataAdapter("select studentname, studentcode,test5 from tests where studentclass = '" &amp;amp; CLASSGROUP &amp;amp; "'  order by studentname ", con)
            pagetesttitle = pubmytest5
        End If
        If testtype = "test6" Then
            adp2 = New OleDbDataAdapter("select studentname, studentcode,test6 from tests where studentclass = '" &amp;amp; CLASSGROUP &amp;amp; "'  order by studentname ", con)
            pagetesttitle = pubmytest6
        End If
        If testtype = "test7" Then
            adp2 = New OleDbDataAdapter("select studentname, studentcode,test7 from tests where studentclass = '" &amp;amp; CLASSGROUP &amp;amp; "'  order by studentname ", con)
            pagetesttitle = pubmytest7
        End If
        If testtype = "test8" Then
            adp2 = New OleDbDataAdapter("select studentname, studentcode,test8 from tests where studentclass = '" &amp;amp; CLASSGROUP &amp;amp; "'  order by studentname ", con)
            pagetesttitle = pubmytest8
        End If
        If testtype = "test9" Then
            adp2 = New OleDbDataAdapter("select studentname, studentcode,test9 from tests where studentclass = '" &amp;amp; CLASSGROUP &amp;amp; "'  order by studentname ", con)
            pagetesttitle = pubmytest9
        End If
        If testtype = "test10" Then
            adp2 = New OleDbDataAdapter("select studentname, studentcode,test10 from tests where studentclass = '" &amp;amp; CLASSGROUP &amp;amp; "'  order by studentname ", con)
            pagetesttitle = pubmytest10
        End If
        ds2 = New DataSet
        adp2.Fill(ds2, "s")
        Dim dr As DataRow
        Dim amountrows As Integer = ds2.Tables(0).Rows.Count
        Dim printText As String() = New String(amountrows) {}
        '' Find the longest name
        Dim longname As String
        Dim maxname As Integer = 0
        For Each dr In ds2.Tables(0).Rows()
            longname = dr.Item(0)
            If maxname &amp;lt; Len(longname) Then maxname = Len(longname)
        Next

        For Each dr In ds2.Tables(0).Rows()
            printText(a) = a.ToString.PadRight(3, " "c)

            studentarr = dr.Item(0)
            studentcode2 = dr.Item(1)
            testamount = Val(dr.Item(2))
            printText(a) += studentcode2 &amp;amp; vbTab
            printText(a) += (Trim(studentarr) + Space(maxname - Len(studentarr) + 1)).PadRight(2)
            printText(a) += vbTab &amp;amp; vbTab &amp;amp; testamount
            a = a + 1
        Next
        ' The Printing Starts Here
        Dim doc As New TextDocument(printText)
        AddHandler doc.PrintPage, AddressOf Doc_PrintPage
        Dim dlgSettings As New PrintDialog
        dlgSettings.Document = doc
        Dim dlgPreview As New PrintPreviewDialog
        dlgPreview.Document = doc
        If dlgSettings.ShowDialog = Windows.Forms.DialogResult.OK Then
            dlgPreview.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowOnly
            If dlgPreview.ShowDialog = Windows.Forms.DialogResult.OK Then
                doc.Print()
            End If
        End If
    End Sub &lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Thu, 13 Nov 2008 04:13:23 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>using arrays</title>
      <link>http://www.programmersheaven.com/mb/VBNET/381640/381640/using-arrays/</link>
      <description>i want to store the employees quarter sales and at the same time i want them to average with the companies quarter sales any ideas?&lt;br /&gt;
&lt;img src="http://i38.tinypic.com/21m6e74.jpg" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt; Const intNUMBER_OF_EMPLOYEES As Integer = 10
    Const intMAX_EMPLOYEE As Integer = intNUMBER_OF_EMPLOYEES - 1


    ' class level variables
    Private Names(intMAX_EMPLOYEE) As String
    Private quarter1(9) As Single
    Private quarter2(9) As Single
    Private quarter3(9) As Single
    Private quarter4(9) As Single

    Private Sub txtQuarter1_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtQuarter1.Validating, txtQuarter4.Validating, txtQuarter3.Validating, txtQuarter2.Validating
        Dim input As String = CType(sender, TextBox).Text
        If IsNumeric(input) Then
            Dim number As Integer = CInt(input)
        Else
            MessageBox.Show("Please enter an integer.")
            e.Cancel = True
        End If

    End Sub

    

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim intCount As Integer

        For intCount = 0 To intMAX_EMPLOYEE
            Names(intCount) = TextBox1.Text

&lt;/pre&gt;</description>
      <pubDate>Fri, 07 Nov 2008 23:36:52 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>How To Select Data from *.DBF files</title>
      <link>http://www.programmersheaven.com/mb/VBNET/381552/381552/how-to-select-data-from-dbf-files/</link>
      <description>&lt;br /&gt;
I am very new to foxpro file extraction programming using vb.net &lt;br /&gt;
plz help for following scenario.&lt;br /&gt;
&lt;br /&gt;
I have a foxpro files of file extension &lt;br /&gt;
&lt;br /&gt;
1) FOXUSER.DBF: which contains fields such as Type,Id,Name,Readonly,CkVal,&lt;br /&gt;
                Data,Updated.&lt;br /&gt;
&lt;br /&gt;
2) FOXUSER.FPT:fields same as above &lt;br /&gt;
 &lt;br /&gt;
3) Data_Needed.DBF :Contains fields such as  &lt;br /&gt;
                    EmployeeID,EmployeeName,EmpolyeeAddress&lt;br /&gt;
&lt;br /&gt;
I have created a function for selecting data from the foxpro file Data_Needed.DBF&lt;br /&gt;
&lt;br /&gt;
But it gives error &lt;br /&gt;
&lt;br /&gt;
"The Microsoft Jet database engine could not find the object 'Data_Needed'.  Make sure the object exists and that you spell its name and the path name correctly."&lt;br /&gt;
&lt;br /&gt;
I have troubleshooted a lot but no use although the files are present there in the location&lt;br /&gt;
&lt;br /&gt;
my function is as below&lt;br /&gt;
&lt;br /&gt;
==========================================&lt;br /&gt;
        connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" &amp;amp; _&lt;br /&gt;
        "Data Source=D:\DATA Needed\Data_Needed;Extended Properties=dBase III"&lt;br /&gt;
&lt;br /&gt;
        Dim dBaseConnection As New System.Data.OleDb.OleDbConnection(connectionString
)&lt;br /&gt;
&lt;br /&gt;
        dBaseConnection.Open()&lt;br /&gt;
&lt;br /&gt;
        Dim dBaseCommand As New System.Data.OleDb.OleDbCommand("SELECT * FROM Data_Needed", dBaseConnection)&lt;br /&gt;
&lt;br /&gt;
        Dim dBaseDataReader As System.Data.OleDb.OleDbDataReader = dBaseCommand.ExecuteReader(CommandBehavior.Sequent
ialAccess)&lt;br /&gt;
&lt;br /&gt;
        While dBaseDataReader.Read&lt;br /&gt;
&lt;br /&gt;
            ComboBox1.Items.Add("" &amp;amp; dBaseDataReader("EmployeeName") &amp;amp; "")&lt;br /&gt;
&lt;br /&gt;
        End While&lt;br /&gt;
&lt;br /&gt;
        dBaseConnection.Close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==================================================
========&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please Help me finding a solution &lt;br /&gt;
&lt;br /&gt;
Thanks in Advance for all&lt;br /&gt;
Jiendra&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Wed, 05 Nov 2008 00:49:35 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>From Inputbox to Listbox</title>
      <link>http://www.programmersheaven.com/mb/VBNET/381488/381488/from-inputbox-to-listbox/</link>
      <description>Alright folks...I'm new to this visual basic stuff, and to the site.  I am working on an assignment for a class...it'll probably look pretty easy to the rest of you, but I just can't figure it out.&lt;br /&gt;
&lt;br /&gt;
What I need to do is take the information from the input box, the 'quiz scores' that are entered and put them in the list box.  The way it is set up now, as you'll see is that it takes the last score and enters it all 5 times.  It appears that all of my other calculations work.  I'm not looking for someone to completely write the code for me, as I really need to and want to learn this...but maybe just a little 'shove' in the right direction?!&lt;br /&gt;
&lt;br /&gt;
Below is all of the code I have so far:  I changed the part I need help with to red font so you can find it quicker...Thanks!!!!!&lt;br /&gt;
&lt;br /&gt;
' Project:      IT Department Grades&lt;br /&gt;
' Purpose:      Allows the user to enter 5 scores, they will be displayed in a list box&lt;br /&gt;
'               and then can be used to calculate the average and a grade letter will&lt;br /&gt;
'               be displayed.&lt;br /&gt;
' Created by:   Lisa Bastian on 9/27/08&lt;br /&gt;
&lt;br /&gt;
Option Strict On&lt;br /&gt;
Option Explicit On&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Public Class GradeForm&lt;br /&gt;
&lt;br /&gt;
    Dim strInputQuiz As String&lt;br /&gt;
    Dim intQuizCounter As Integer = 1&lt;br /&gt;
    Dim strGrade As String&lt;br /&gt;
    Dim intQuizPoints As Integer&lt;br /&gt;
    Dim intPointsAccumulator As Integer&lt;br /&gt;
    Dim intAverage As Integer&lt;br /&gt;
    Dim isConverted As Boolean&lt;br /&gt;
&lt;br /&gt;
    Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click&lt;br /&gt;
        Me.Close()&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub btnClear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClear.Click&lt;br /&gt;
        lblTotalPoints.Text = ""&lt;br /&gt;
        lblAveragePoints.Text = ""&lt;br /&gt;
        lblLetterGrade.Text = ""&lt;br /&gt;
        lstGrades.Items.Clear()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub btnAcceptGrades_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAcceptGrades.Click&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        ' repeats input box until all 5 grades have been entered&lt;br /&gt;
        Do While intQuizCounter &amp;lt; 6&lt;br /&gt;
            ' input box for user to enter the numeric grades&lt;br /&gt;
            strInputQuiz = InputBox("Please enter quiz grades " &amp;amp; intQuizCounter, "Quiz Grades")&lt;br /&gt;
&lt;br /&gt;
            ' if points entered are correct numbers count the quiz and add the points&lt;br /&gt;
            ' in the points accumulator if not show message box saying re-enter&lt;br /&gt;
            isConverted = Integer.TryParse(strInputQuiz, intQuizPoints)&lt;br /&gt;
            If isConverted Then&lt;br /&gt;
                intQuizCounter = intQuizCounter + 1&lt;br /&gt;
                intPointsAccumulator = intPointsAccumulator + intQuizPoints&lt;br /&gt;
&lt;br /&gt;
            Else&lt;br /&gt;
                MessageBox.Show("Please re-enter quiz grade.", "Quiz Grades Error", MessageBoxButtons.OK, _&lt;br /&gt;
                                MessageBoxIcon.Information)&lt;br /&gt;
&lt;br /&gt;
            End If&lt;br /&gt;
        Loop&lt;br /&gt;
       &lt;span style="color: Red;"&gt; ' Converts the Quiz Points entered to string and adds them &lt;br /&gt;
        ' to the list box&lt;br /&gt;
        lstGrades.Text = Convert.ToString(intQuizPoints)&lt;br /&gt;
        lstGrades.Items.Add(intQuizPoints)&lt;br /&gt;
        lstGrades.Items.Add(intQuizPoints)&lt;br /&gt;
        lstGrades.Items.Add(intQuizPoints)&lt;br /&gt;
        lstGrades.Items.Add(intQuizPoints)&lt;br /&gt;
        lstGrades.Items.Add(intQuizPoints)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
    Private Sub btnCalculate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCalculate.Click&lt;br /&gt;
        ' uses the numeric grades entered in the list box&lt;br /&gt;
        ' to give the average grade, which will be displayed as a &lt;br /&gt;
        ' letter grade&lt;br /&gt;
&lt;br /&gt;
        lblTotalPoints.Text = Convert.ToString(intPointsAccumulator)&lt;br /&gt;
&lt;br /&gt;
        lblAveragePoints.Text = Convert.ToString(intPointsAccumulator / 5)&lt;br /&gt;
&lt;br /&gt;
        intAverage = CInt(Convert.ToString(intPointsAccumulator / 5))&lt;br /&gt;
        lblAveragePoints.Text = Convert.ToString(intAverage)&lt;br /&gt;
&lt;br /&gt;
        Select Case intAverage&lt;br /&gt;
            Case Is &amp;gt;= 93&lt;br /&gt;
                strGrade = "A"&lt;br /&gt;
            Case Is &amp;gt;= 86&lt;br /&gt;
                strGrade = "B"&lt;br /&gt;
            Case Is &amp;gt;= 77&lt;br /&gt;
                strGrade = "C"&lt;br /&gt;
            Case Is &amp;gt;= 70&lt;br /&gt;
                strGrade = "D"&lt;br /&gt;
            Case Else&lt;br /&gt;
                strGrade = "F"&lt;br /&gt;
        End Select&lt;br /&gt;
&lt;br /&gt;
        ' displays the letter grade in the label&lt;br /&gt;
        lblLetterGrade.Text = strGrade&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Sun, 02 Nov 2008 13:08:53 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Use Mouse Wheel in Datagrid</title>
      <link>http://www.programmersheaven.com/mb/VBNET/381312/381312/use-mouse-wheel-in-datagrid/</link>
      <description>I want to use my M&amp;lt;ouseWheel to scroll up and down in my Datagridview.  I want my heading to stand still while the rest of my data  moves up and down.&lt;br /&gt;
&lt;br /&gt;
How?&lt;br /&gt;</description>
      <pubDate>Thu, 23 Oct 2008 00:22:45 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Error in Published program</title>
      <link>http://www.programmersheaven.com/mb/VBNET/381272/381272/error-in-published-program/</link>
      <description>I published my project.  When i execute it, the first screen comes up , but then i get the error below.  &lt;br /&gt;
Question 1:  What is causing it?&lt;br /&gt;
Question 2:  How do i go about creating a setup program, that does not give the same error below?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[See the end of this message for details on invoking &lt;br /&gt;
just-in-time (JIT) debugging instead of this dialog box.&lt;br /&gt;
&lt;br /&gt;
************** Exception Text **************&lt;br /&gt;
System.TypeInitializationException: The type initializer for 'Library.Module1' threw an exception. ---&amp;gt; System.ArgumentOutOfRangeException: Length cannot be less than zero.&lt;br /&gt;
Parameter name: length&lt;br /&gt;
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)&lt;br /&gt;
   at System.String.Substring(Int32 startIndex, Int32 length)&lt;br /&gt;
   at Library.Module1..cctor() in L:\vb programs\My Book Library DataBase\Library\Module1.vb:line 5&lt;br /&gt;
   --- End of inner exception stack trace ---&lt;br /&gt;
   at Library.LoginForm1.OK_Click(Object sender, EventArgs e) in L:\vb programs\My Book Library DataBase\Library\LoginForm1.vb:line 11&lt;br /&gt;
   at System.Windows.Forms.Control.OnClick(EventArgs e)&lt;br /&gt;
   at System.Windows.Forms.Button.OnClick(EventArgs e)&lt;br /&gt;
   at System.Windows.Forms.Button.OnMouseUp(MouseEventAr
gs mevent)&lt;br /&gt;
   at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)&lt;br /&gt;
   at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)&lt;br /&gt;
   at System.Windows.Forms.ButtonBase.WndProc(Message&amp;amp; m)&lt;br /&gt;
   at System.Windows.Forms.Button.WndProc(Message&amp;amp; m)&lt;br /&gt;
   at System.Windows.Forms.Control.ControlNativeWindow.O
nMessage(Message&amp;amp; m)&lt;br /&gt;
   at System.Windows.Forms.Control.ControlNativeWindow.W
ndProc(Message&amp;amp; m)&lt;br /&gt;
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
************** Loaded Assemblies **************&lt;br /&gt;
mscorlib&lt;br /&gt;
    Assembly Version: 2.0.0.0&lt;br /&gt;
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)&lt;br /&gt;
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50
727/mscorlib.dll&lt;br /&gt;
----------------------------------------&lt;br /&gt;
Library&lt;br /&gt;
    Assembly Version: 1.0.0.0&lt;br /&gt;
    Win32 Version: 1.0.0.0&lt;br /&gt;
    CodeBase: file:///D:/temp/Library.exe&lt;br /&gt;
----------------------------------------&lt;br /&gt;
Microsoft.VisualBasic&lt;br /&gt;
    Assembly Version: 8.0.0.0&lt;br /&gt;
    Win32 Version: 8.0.50727.1433 (REDBITS.050727-1400)&lt;br /&gt;
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.Vis
ualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.Visua
lBasic.dll&lt;br /&gt;
----------------------------------------&lt;br /&gt;
System&lt;br /&gt;
    Assembly Version: 2.0.0.0&lt;br /&gt;
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)&lt;br /&gt;
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.
0__b77a5c561934e089/System.dll&lt;br /&gt;
----------------------------------------&lt;br /&gt;
System.Windows.Forms&lt;br /&gt;
    Assembly Version: 2.0.0.0&lt;br /&gt;
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)&lt;br /&gt;
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Window
s.Forms/2.0.0.0__b77a5c561934e089/System.Windows.F
orms.dll&lt;br /&gt;
----------------------------------------&lt;br /&gt;
System.Drawing&lt;br /&gt;
    Assembly Version: 2.0.0.0&lt;br /&gt;
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)&lt;br /&gt;
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawin
g/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll&lt;br /&gt;
----------------------------------------&lt;br /&gt;
System.Configuration&lt;br /&gt;
    Assembly Version: 2.0.0.0&lt;br /&gt;
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)&lt;br /&gt;
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Config
uration/2.0.0.0__b03f5f7f11d50a3a/System.Configura
tion.dll&lt;br /&gt;
----------------------------------------&lt;br /&gt;
System.Xml&lt;br /&gt;
    Assembly Version: 2.0.0.0&lt;br /&gt;
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)&lt;br /&gt;
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.
0.0.0__b77a5c561934e089/System.Xml.dll&lt;br /&gt;
----------------------------------------&lt;br /&gt;
System.Runtime.Remoting&lt;br /&gt;
    Assembly Version: 2.0.0.0&lt;br /&gt;
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)&lt;br /&gt;
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtim
e.Remoting/2.0.0.0__b77a5c561934e089/System.Runtim
e.Remoting.dll&lt;br /&gt;
----------------------------------------&lt;br /&gt;
&lt;br /&gt;
************** JIT Debugging **************&lt;br /&gt;
To enable just-in-time (JIT) debugging, the .config file for this&lt;br /&gt;
application or computer (machine.config) must have the&lt;br /&gt;
jitDebugging value set in the system.windows.forms section.&lt;br /&gt;
The application must also be compiled with debugging&lt;br /&gt;
enabled.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
    &amp;lt;system.windows.forms jitDebugging="true" /&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When JIT debugging is enabled, any unhandled exception&lt;br /&gt;
will be sent to the JIT debugger registered on the computer&lt;br /&gt;
rather than be handled by this dialog box.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Mon, 20 Oct 2008 03:25:35 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Accessing controls from threads</title>
      <link>http://www.programmersheaven.com/mb/VBNET/381250/381250/accessing-controls-from-threads/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I hope some one that give me a nice clear answer to this as I'm at my ends whits with it.&lt;br /&gt;
&lt;br /&gt;
Ok I have form1 and a button on that opens form2.  Form2 starts a thread that will create report for me.  When the threads start it executes some code that accesses controls on form1. Of course you know this wouldn't work because I'm getting errors as its unsafe.  The code is very simple&lt;br /&gt;
&lt;br /&gt;
if form1.checkbox.checked then&lt;br /&gt;
' Do something&lt;br /&gt;
end if&lt;br /&gt;
&lt;br /&gt;
I have many checkboxes on form1 that I need to check so is there a way I can do this from the thread quickly and safely?&lt;br /&gt;
&lt;br /&gt;
I also calls a public function in the thread that is in form1 that adds data to a tree view.&lt;br /&gt;
&lt;br /&gt;
Please HELP!&lt;br /&gt;
&lt;br /&gt;
Jim</description>
      <pubDate>Fri, 17 Oct 2008 07:58:00 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Add bd sqlserver 2005 in a Relaese Project</title>
      <link>http://www.programmersheaven.com/mb/VBNET/381189/381189/add-bd-sqlserver-2005-in-a-relaese-project/</link>
      <description>Hi everybody, i just want to know how can we add a database made in sql server 2005 in a release project with visual studio 2005 (.NET)&lt;br /&gt;</description>
      <pubDate>Tue, 14 Oct 2008 07:48:16 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Outlook Style Datagridview</title>
      <link>http://www.programmersheaven.com/mb/VBNET/378521/378521/outlook-style-datagridview/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
Anyone there who has a sample code on how to create an outlook style datagridview using vb.net?&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
xtian&lt;br /&gt;</description>
      <pubDate>Thu, 09 Oct 2008 20:31:54 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Load info from a web page to a vb.net application</title>
      <link>http://www.programmersheaven.com/mb/VBNET/378241/378241/load-info-from-a-web-page-to-a-vbnet-application/</link>
      <description>I just want to know if it is possible to load info's from a web page&lt;br /&gt;
with a windows application (vb.net).&lt;br /&gt;
If someone can insert code samples it will be nice.&lt;br /&gt;
Thanks for any help !!!&lt;br /&gt;</description>
      <pubDate>Tue, 07 Oct 2008 07:05:01 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Im trying to convert numbers to english , Why wont this work ,,,</title>
      <link>http://www.programmersheaven.com/mb/VBNET/378135/378135/im-trying-to-convert-numbers-to-english--why-wont-this-work-/</link>
      <description>' When I run the program it returns a 0 in the label ???? Any suggestions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Private Sub btnConverttoEnglish_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConverttoEnglish.Click&lt;br /&gt;
&lt;br /&gt;
        Dim oneword As Integer&lt;br /&gt;
        Dim tensword As Integer&lt;br /&gt;
        Dim hundredsword As Integer&lt;br /&gt;
        Dim thousandsword As Integer&lt;br /&gt;
        Dim EnglishResult As String&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
        Select Case thousandsword&lt;br /&gt;
            Case 1000&lt;br /&gt;
                EnglishResult = "one Thousand"&lt;br /&gt;
            Case 2000&lt;br /&gt;
                EnglishResult = "two Thousand"&lt;br /&gt;
            Case 3000&lt;br /&gt;
                EnglishResult = "three Thousand"&lt;br /&gt;
        End Select&lt;br /&gt;
&lt;br /&gt;
        Select Case hundredsword&lt;br /&gt;
            Case 100&lt;br /&gt;
                EnglishResult = "one hundred"&lt;br /&gt;
            Case 200&lt;br /&gt;
                EnglishResult = "two hundred"&lt;br /&gt;
            Case 300&lt;br /&gt;
                EnglishResult = "three hundred"&lt;br /&gt;
            Case 400&lt;br /&gt;
                EnglishResult = "four hundred"&lt;br /&gt;
            Case 500&lt;br /&gt;
                EnglishResult = "five hundred"&lt;br /&gt;
            Case 600&lt;br /&gt;
                EnglishResult = "six hundred"&lt;br /&gt;
            Case 700&lt;br /&gt;
                EnglishResult = "seven hundred"&lt;br /&gt;
            Case 800&lt;br /&gt;
                EnglishResult = "eight hundred"&lt;br /&gt;
            Case 900&lt;br /&gt;
                EnglishResult = "nine hundred"&lt;br /&gt;
&lt;br /&gt;
        End Select&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        Select Case oneword&lt;br /&gt;
&lt;br /&gt;
            Case 1&lt;br /&gt;
                EnglishResult = "One "&lt;br /&gt;
            Case 2&lt;br /&gt;
                EnglishResult = "Two "&lt;br /&gt;
            Case 3&lt;br /&gt;
                EnglishResult = "Three "&lt;br /&gt;
            Case 4&lt;br /&gt;
                EnglishResult = "Four "&lt;br /&gt;
            Case 5&lt;br /&gt;
                EnglishResult = "Five "&lt;br /&gt;
            Case 6&lt;br /&gt;
                EnglishResult = "Six "&lt;br /&gt;
            Case 7&lt;br /&gt;
                EnglishResult = "Seven "&lt;br /&gt;
            Case 8&lt;br /&gt;
                EnglishResult = "Eight "&lt;br /&gt;
            Case 9&lt;br /&gt;
                EnglishResult = "Nine "&lt;br /&gt;
            Case 10&lt;br /&gt;
                EnglishResult = "Ten "&lt;br /&gt;
            Case 11&lt;br /&gt;
                EnglishResult = "Eleven "&lt;br /&gt;
            Case 12&lt;br /&gt;
                EnglishResult = "Twelve "&lt;br /&gt;
            Case 13&lt;br /&gt;
                EnglishResult = "Thirteen "&lt;br /&gt;
            Case 14&lt;br /&gt;
                EnglishResult = "Fourteen "&lt;br /&gt;
            Case 15&lt;br /&gt;
                EnglishResult = "Fifteen "&lt;br /&gt;
            Case 16&lt;br /&gt;
                EnglishResult = "Sixteen "&lt;br /&gt;
            Case 17&lt;br /&gt;
                EnglishResult = "Seventeen "&lt;br /&gt;
            Case 18&lt;br /&gt;
                EnglishResult = "Eighteen "&lt;br /&gt;
            Case 19&lt;br /&gt;
                EnglishResult = "Nineteen "&lt;br /&gt;
        End Select&lt;br /&gt;
&lt;br /&gt;
        Select Case tensword&lt;br /&gt;
&lt;br /&gt;
            Case 90 To 99&lt;br /&gt;
                EnglishResult = "Ninety "&lt;br /&gt;
            Case 80 To 89&lt;br /&gt;
                EnglishResult = "Eighty "&lt;br /&gt;
            Case 70 To 79&lt;br /&gt;
                EnglishResult = "Seventy "&lt;br /&gt;
            Case 60 To 69&lt;br /&gt;
                EnglishResult = "Sixty "&lt;br /&gt;
            Case 50 To 59&lt;br /&gt;
                EnglishResult = "Fifty "&lt;br /&gt;
            Case 40 To 49&lt;br /&gt;
                EnglishResult = "Forty "&lt;br /&gt;
            Case 30 To 39&lt;br /&gt;
                EnglishResult = "Thirty "&lt;br /&gt;
            Case 20 To 29&lt;br /&gt;
                EnglishResult = "Twenty "&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        End Select&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        EnglishResult = CStr(thousandsword + hundredsword + tensword + oneword)&lt;br /&gt;
        txtEnterNumber.Text = CStr(EnglishResult)&lt;br /&gt;
        LblResult.Text = txtEnterNumber.Text&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    End Sub&lt;br /&gt;</description>
      <pubDate>Mon, 06 Oct 2008 13:09:13 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Save changes to a database</title>
      <link>http://www.programmersheaven.com/mb/VBNET/376853/376853/save-changes-to-a-database/</link>
      <description>&lt;strong&gt;Hi , &lt;br /&gt;
This is my codes , what I want to do is to save changes to database. &lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;    Dim connstr As String = "Provider= Microsoft.Jet.OLEDB.4.0;" &amp;amp; _&lt;br /&gt;
      "Data source = cdbank.mdb"&lt;br /&gt;
   &lt;br /&gt;
    Dim dt As New DataTable&lt;br /&gt;
    Dim sqlstr As String = "SELECT * FROM info"&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Private Sub SaveToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem1.Click&lt;br /&gt;
        Dim changes As Integer&lt;br /&gt;
       &lt;br /&gt;
       &lt;br /&gt;
        Dim dataadapter As New OleDb.OleDbDataAdapter(sqlstr, connstr)&lt;br /&gt;
        Dim commandbuilder As New OleDb.OleDbCommandBuilder(dataadapter)&lt;br /&gt;
        dataadapter.Update(dt)&lt;br /&gt;
        dataadapter.Dispose()&lt;br /&gt;
        If changes &amp;gt; 0 Then&lt;br /&gt;
            MsgBox(changes &amp;amp; "changed rows were stored in the database ")&lt;br /&gt;
        Else&lt;br /&gt;
            MsgBox("No changes made.")&lt;br /&gt;
&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But when i run the program and i load data from database and want to save the changes i have made i get this error:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;
Syntax error (missing operator) in query expression '((code = ?) AND ((? = 1 AND name IS NULL) OR (name = ?)) AND ((? = 1 AND serial IS NULL) OR (serial = ?)) AND ((? = 1 AND software inside IS NULL) OR (software inside = ?)))'.&lt;br /&gt;
&lt;br /&gt;
&lt;/strong&gt;&lt;span style="color: Red;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I have no idea what this is about !&lt;br /&gt;
&lt;br /&gt;
Anyone here can help&lt;br /&gt;
I mostly appreciate &lt;br /&gt;
&lt;br /&gt;
sap2020&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Sat, 04 Oct 2008 10:16:35 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Problem with Screen.AllScreens(0).DeviceName</title>
      <link>http://www.programmersheaven.com/mb/VBNET/376809/376809/problem-with-screenallscreens0devicename/</link>
      <description>I am having some problem with some code that worked OK when I programmed it on Vista 64 bit edition, but is having problems on a machine with Windows XP SP2. I have created some simple code that simulates the problem, rather than post my original code which is more complicated. &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;'Obtain Monitor Name
Dim MonitorName As String = Screen.AllScreens(0).DeviceName

'Gets rid of the "\\.\" at the start of the name
Do While MonitorName Like "*\*"
    MonitorName = Microsoft.VisualBasic.Right(MonitorName, Len(MonitorName) - 1)
Loop
'Display message if Monitor Name is "DISPLAY1"
If (MonitorName = "DISPLAY1") Then
    MsgBox("Monitor Found", MsgBoxStyle.OkOnly, "Monitor Search")
End If
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The problem is that the message box in the last line never displays, Even though the Monitorname is "DISPLAY1" As expected..&lt;br /&gt;
&lt;br /&gt;
The problem seems to be coming from the call to "Screens.AllScreens(0).DeviceName in the first line. If I obtain the value of "DeviceName" by putting my cursor over this bit of code it says &lt;br /&gt;
&lt;br /&gt;
DeviceName = "DISPLAY1&lt;br /&gt;
&lt;br /&gt;
Notice how there is a quotation mark at the start and none at the end. This problem carries over to the MonitorName variable, and MonitorName would also be missing the final quotation mark when the If Statement is run.&lt;br /&gt;
&lt;br /&gt;
I am programming with VB.Net Express 2008 edition. On a machine with Windows XP SP 2, and the program is using .Net Framework 2.0. I have tried switching to .Net Framework 3.0 without any success.&lt;br /&gt;
&lt;br /&gt;
I suspect this is a bug with something on my machine, rather than with my program. Is there another way of obtaining the name of all monitors attached to the computer?&lt;br /&gt;
&lt;br /&gt;
Thank you&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Thu, 02 Oct 2008 17:51:03 -0700</pubDate>
      <category>VB.NET</category>
    </item>
  </channel>
</rss>