Oxiegen 88 Basically an Occasional Poster Featured Poster

it is telling me rows is not declared in this coding if I change it to datarow is says that Length is not a member of System.Data.DataRows

I'm sorry, that line should state If zipcodeRows.Length > 0 Then

I set this up as a module my question is about this, on my login all they put in is a username and password how will I assign the Staffid and their Last name to it? Silly question I am sure, but I am a bit lost on it as I am suspecting if I was keeping their username in the Module I would assign it similar to

Dim username.Textbox = strUsername

Correct me if I am off on this constructor if you would please and thank you so much for all your help.

I'm sure that you have code in place to verify the username and password against the database.
You might wanna modify that slightly so that if it's a successful verification, then the return would contain information so that you can assign the public variables intStaffId and strLastname.
For example:

Private Sub VerifyLogin(Username As String, Password As String)
   If Not Username.Equals("") AndAlso Not Password.Equals("") Then
      Dim verifyRows() As DataRow
      verifyRows = yourdataset.Tables("Staff").Select("Username = '" & Username & "' AND Password = '" & Password & "'")
      If verifyRows.Length > 0 Then
         intStaffId = verifyRows(0).Item("StaffId")
         strLastName = verifyRows(0).Item("LastName")
      End If
   End If
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

Here a small suggestion of how to read from textfiles.
It's just a small change of what you showed us in your original post.
And if you're looking for specific information stored in the files you can simply add an If statement. See code in red.

Dim stream As FileStream = Nothing
        Dim tr As TextReader = Nothing
        Dim line As String = ""
        Dim fileInput() As String

        If NameOfAccount.Equals("Savings") Then
            stream = New FileStream("csvSAVINGS.TXT", FileMode.Open)
        ElseIf NameOfAccount.Equals("Checkings") Then
            stream = New FileStream("csvCHECKKINGS.TXT", FileMode.Open)
        End If
        tr = New StreamReader(stream)

        While tr.Peek <> -1
            line = tr.ReadLine()
            If line.Contains("string to search for") Then
                tran = New Transaction()
                fileInput = line.Split(","c)
                tran.TransactionDate = fileInput(0)
                .......
            End If
        End While
Oxiegen 88 Basically an Occasional Poster Featured Poster

I understand how to add a module from the add item menu, my problem is I do not understand what I would be needing to use in it or how to use it to collect the username and staffid to carry through the application throughout the entire workday. As the StaffId and the Preferably their Last Name which is all related in the database need to be displayed and also printed on all documents they print from the application.

I was responding as to your first query on how to carry StaffId and Last Name through all forms.
In your login system you simply assign values to these variables and you can then use them from anywhere else in your program.

Module nameOfModule
   Public intStaffId As Integer
   Public strLastName As String
End Module

Truth is I may not even be doing this in the most optimal way possible. As what I need is a text box that they put in the clientid hit search if it comes up it will bring up on a seperate form the case file for that client they searched for, if not it routes to a different form to add them.

Here's one idea. In your Search buttons click event.

Private sub bnSearch_Click(ByVal sender As Object, ByVal e As EventArgs)
   If txtClientIdSearch.Text.Equals("") Then Exit Sub

   Dim con As MySqlConnection = New MySqlConnection("connectionstring")
   Dim da As MySqlDataAdapter = Nothing
   Dim SQL As String = "SELECT * FROM hinfo WHERE clientid1 = '" & …
Oxiegen 88 Basically an Occasional Poster Featured Poster

Instead of using GetUpperBound, try using Length.
See code in red.

Sub SaveFile(ByVal func As String, ByVal ac As Array, ByRef acc1 As Account, ByRef count As Double)

            Dim sa As IO.StreamReader = IO.File.OpenText("D:\Documents and Settings\My Documents\VB-Textfiles\Object\ACCOUNTS.txt")
            Dim sr As IO.StreamWriter = IO.File.CreateText("TEMP.TXT")
            If func = "Open" Then
                Do While sa.Peek <> -1
                    acc1 = New Account
                    Dim a = sa.ReadLine
                    If a = Nothing Then
                        Exit Do
                    Else
                        Dim line() = a.Split(","c)
                        acc1.DateNow = line(0)
                        acc1.Name = line(1)
                        acc1.Ammount = line(2)
                        acc1.Type = line(4)
                        If line(4) = "Checking" Then
                            acc1.CheckBalance = line(3)
                        Else
                            acc1.SaveBalance = line(3)
                        End If
                    End If

                    '*****************************************************************************

                    ' *The problem is here says that the redim preserve wont work. Why?.

                    ac(count) = acc1
                    ' x = ac.GetUpperBound + 1
                    ' ReDim Preserve ac(ac.Length + 1)



                    '***************************************************************************

                    count += 1
                Loop
                sa.Close()
                sr.Close()
            Else
            End If
        End Sub
    End Class
    ''Handles the File storing of all transactions
    'Private Sub BtnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click

    'End Sub

End Class

Thanks for the help, If you notice I placed comments where I am returning errors, and I have yet to plug the save sub into the save button because it won't let me call the sub..

Have you tried declaring the SaveFile method as Public?
Just like properties, methods needs to be Public in order to be accessible from outside the class.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Try it like this.

Private Sub webbrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs)
    If WebBrowser.DocumentTitle.Equals("title of loginpage") Then
        AddHandler CType(sender, WebBrowser).Document.Window.Error, AddressOf Window_Error
        If WebBrowser1.ReadyState = WebBrowserReadyState.Complete Then
            WebBrowser1.Document.All("pass").SetAttribute("value", Password)
            WebBrowser1.Document.All("email").SetAttribute("value", email1)
            WebBrowser1.Document.Forms(0).InvokeMember("submit")
        End If
    ElseIf WebBrowser.DocumentTitle.Equals("title of second page")
        Dim link As String = WebBrowser1.Document.GetElementById("id of link").GetAttribute("href")
        If Not link.Equals("") Then
            WebBrowser1.Navigate(New Uri(link))
        End If
    End If
End Sub

And remember to replace "id of link" to the actual id of the HTML element on the second page.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok I will try these could yougive me any help in the module you are talking about? I have not done modules as of yet.

As you would add a class to your project, you can add a module.
A module is just an empty code file that is declared as Module.

Module nameOfModule
   'Here you can collect a bunch of independent and un-related methods.
   'Including constants and publicly declared variables.
End Module

as for the search function I can do a search of my database but it never gives me the fill by textbox it gives me a fillby button as I said I need it to display in a detail view not the normal gridview not sure if that part makes a difference or not.

I'm sorry, but i don't understand what you mean by "fill by textbox" and "fill by button".
I'm assuming that you wish to display the information in a ListView or a DataGridView.
The ListView has a property named View that can be set to Details, which gives it a similar look as a DataGridView.
And the DataGridView can bind to a DataSet to display the data in a spreadsheat similar fashion.

I am sorry also I mis-stated about the zip code thing, I have one table called zipcodes inside it are zip_codes State City County as the structure inside it the key is the zipcode itself. Would that make much difference in the coding you showed me?

Not …

Oxiegen 88 Basically an Occasional Poster Featured Poster

created a login system that works quite well, but I need using the db or settings or a variable keep the logged in staffid and username constant on all the forms through out the forms. I have no idea how to do this. as it is information that in the end also has to be printed on the printout.

Add a module to your project, in it you can declare Public variables to store the staffid and username.

My search problem is I need to do a filter I guess with a dataset search and if it does exist it will pull that record up in detail view for editing or updating. There is a small catch to this though I need it to not overwrite the old data but keep the clientid1 and write a whole new set of information to the table or move the old set to a historical table and write the new set with everything updated and changed and the old information that is propagated to the form to the original table. I tried to do the search with a filter similar to

The Tables property in the DataSet has a Select method that you can use to filter out the contents of your dataset.
It returns an array of DataRow.

Dim row() As DataRow
row = yourdataset.Tables("Clients").Select("<here you enter an SQL where-clause")

My Last Problem is I have tables with all known zipcodes, I need it to when filled out on …

kvprajapati commented: Very very helpful. +9
Oxiegen 88 Basically an Occasional Poster Featured Poster

Well. I couldn't really see anything wrong with your logic.
However, what can you see when you debug your transaction code and step through each line to see what line creates the NULL reference?
Just put a breakpoint at Private Sub btnTransfer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTransfer.Click and follow the code.

I know it's unrelated but the first thing I did notice was this.

Sub WriteTransaction(ByVal activity As Transaction)
        CalcBalance(activity)
'This is only a single item array. And nothing really won't be accomplished with the Join method.
        Dim temp() As String = {activity.TransactionDate & "," & activity.DepoOrWith.ToString & "," & _
        activity.TransactionAmount & "," & Balance}
'Try the code in red instead
        Dim temp As String = activity.TransactionDate & "," & activity.DepoOrWith.ToString & "," & _
        activity.TransactionAmount & "," & Balance
        Select Case activity.AcctName
            Case Is = "Savings"
                Dim sw As StreamWriter = File.AppendText("csvSAVINGS.TXT")
                sw.WriteLine(temp)
                sw.Flush()
                sw.Close()
            .....
        End Select
    End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

Identify the link on the second page and use the returnvalue to perform a webbrowser1.Navigate() from inside the webbrowser1.DocumentCompleted event.

Dim link As String = webbrowser1.Document.GetElementById("id of link").GetAttribute("href")
        webbrowser1.Navigate(New Uri(link))
Oxiegen 88 Basically an Occasional Poster Featured Poster

Examine the webbrowsers LocationChanged event and perhaps also the webbrowsers DocumentCompleted event and the ProgressChanged event.

Maybe you can find some clues there as to why the form is not being submitted. Regardless if you use Forms(0) or Forms(1).

Oxiegen 88 Basically an Occasional Poster Featured Poster

Post your code for the transfer button and let's take a look.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Is the form you're trying to submit actually the form you stated on this line: WebBrowser1.Document.Forms(1).InvokeMember("submit") ?
If the page only has one form, then the line should probably read: WebBrowser1.Document.Forms(0).InvokeMember("submit")

Oxiegen 88 Basically an Occasional Poster Featured Poster

I found some things that you might wanna look at.
If for example the files csvSAVINGS.TXT or csvCHECKING.TXT does not exists then you might wanna change some of the code for the file reading.

In the method CalcBalance, in the Account class, you cannot ReDim m_transSet if the variable x is -1.
When ReDim'ing you have to state the amount of positions in the array to use. Meaning, if the size of the array is supposed to be 1 then the variable x must be declared as 1, not 0 or -1. ReDim variable(<number of positions to declare>) My next suggestion is to check the state of m_transSet in the Balance property:

Public ReadOnly Property Balance() As Double
        Get
            If m_transSet IsNot Nothing Then
               Return m_transSet(m_transSet.Length - 1).NewBalance
            Else
               Return <a default number if all failes>
            End If
        End Get
    End Property
Oxiegen 88 Basically an Occasional Poster Featured Poster

Yes, I understand. Perhaps I formulated myself a bit unclear.

Based on what I can see in the code-snippet you provided is that no matter what value tempckL has (1, 2 or 3), that is the position in the array you will select a value from.

That said, there is really no need for a large IF...ELSE IF-statement to check for every possible value tempckL can have, because it's redundant.

As long as tempckL is either 1, 2 or 3 (or greater?) then all you need to do is assign the values in the array to your labels. Hence my smaller IF statement.

Take a closer look at your IF statement and tell me if I'm wrong.

Since I don't know how the rest of the code looks like and a loop really is called for, then perhaps something like this:

'Loop the rounds 1 through 3
For i As Integer = 1 To 3
   sBBox.Text = arrSB(i - 1)
   lBBox.Text = arrLB(i - 1)
   nSBBox.Text = arrSB(i)
   nLBBox.Text = arrLB(i)
Next

This will put different values in the labels at a very quick rate.

Oxiegen 88 Basically an Occasional Poster Featured Poster

From what I can see of your IF statement is that no matter what tempckL is, you always set your labels to the same thing.
So what do you need either IF statements or loops for?

Although, perhaps you should consider a small IF statement.

If tempckL > 0 Then
   sBBox.Text = arrSB(tempckL - 1)
   lBBox.Text = arrLB(tempckL - 1)
   nSBBox.Text = arrSB(tempckL)
   nLBBox.Text = arrLB(tempckL)
Else
   sBBox.Text = ""
   lBBox.Text = ""
   nSBBox.Text = ""
   nLBBox.Text = ""
End If
Oxiegen 88 Basically an Occasional Poster Featured Poster

Here you first call the ReadFile method and do a bunch of things.
So far so good.

calc.ReadFile(nameOfAccount, listDisplay)
        txtBalance.Text = FormatCurrency(calc.Balance)

However in the ReadFile method I noticed something.

Sub ReadFile(ByVal NameofAccount As String, ByRef listDisplay As ListBox)
        Dim fmtStr As String = "{0,-10} {1,-30}{2,20:c} {3, 10}"
        Dim tran As Transaction
        Dim x As Integer = 0
        Dim sr As StreamReader = Nothing
        If NameofAccount = "Savings" Then
            sr = File.OpenText("csvSAVINGS.TXT")
        Else 'If NameofAccount = "Checking" Then 
            sr = File.OpenText("csvCHECKING.TXT")
        End If
What happens if sr.Peek actually equals -1?
        Do While (sr.Peek <> -1)
            tran = New Transaction
            fileInput = sr.ReadLine.Split(","c)
            tran.TransactionDate = fileInput(0)
            tran.DepoOrWith = fileInput(1)
            tran.TransactionAmount = fileInput(2)
            tran.PreviousBalance = fileInput(3)
            ReDim Preserve m_transSet(x)
            m_transSet(x) = tran
            listDisplay.Items.Add(String.Format(fmtStr, tran.TransactionDate.ToShortDateString, tran.DepoOrWith, _
            FormatCurrency(tran.TransactionAmount) & " PREV BAL", FormatCurrency(tran.PreviousBalance) & _
            " New BAL" & FormatCurrency(tran.NewBalance)))
            x += 1
            tran = Nothing
        Loop
        sr.Close()
    End Sub

So, if the class variable m_transSet is not set then you will get a null reference error.
Try changing the order of the code so that m_transSet is always not null.

Sub ReadFile(ByVal NameofAccount As String, ByRef listDisplay As ListBox)
        Dim fmtStr As String = "{0,-10} {1,-30}{2,20:c} {3, 10}"
        Dim tran As Transaction
        Dim x As Integer = 0
        Dim sr As StreamReader = Nothing
        If NameofAccount = "Savings" Then
            sr = File.OpenText("csvSAVINGS.TXT")
        Else 'If NameofAccount = "Checking" Then 
            sr = File.OpenText("csvCHECKING.TXT")
        End If
        ReDim m_transSet(x)
        Do While (sr.Peek <> -1)
            tran = New Transaction
            fileInput = sr.ReadLine.Split(","c) …
Oxiegen 88 Basically an Occasional Poster Featured Poster

I was thinking, for your first problem.
Because you use a three space divider between the values from the database for each item in the listbox.
Couldn't you use that piece of knowledge for startindex and length in the SubString method?
That way, these values will always be dynamic.

Dim startIindex As Integer = 0
Dim stringLength As Integer = 0
stringLength = DisplayCustomersListBox.Text.IndexOf("   ")
CustomerIDTextBox.Text = DisplayCustomersListBox.Text.Substring(0, stringLength)
' Get the startindex of the next value separated by "   "
startIndex = DisplayCustomersListBox.Text.IndexOf("   ") + 3
' Get the startindex of the following "   ", counting from the previous one
stringLength = DisplayCustomersListBox.Text.IndexOf("   ", startIndex) 
SurnameTextBox.Text = DisplayCustomersListBox.Text.Substring(startIndex, stringLength)
.....
Oxiegen 88 Basically an Occasional Poster Featured Poster

Wouldn't it be easier to look at the underlying datasource?
For example, if the DataGrid is bound to a DataSet you can loop that to find the values you are looking for.

Dim totalSum As Integer

For i As Integer = 0 To DataSet.Tables(0).Rows.Count - 1
   totalSum += DataSet.Tables(0).Rows(i).Item("Total")
Next

TextBox.Text = totalSum.ToString()
Oxiegen 88 Basically an Occasional Poster Featured Poster

(1)
PHP has no real definition, ie: var $a_var;.
In VB.NET you must define what the variable will contain, ie:
Dim a_var As Integer
Dim another_var As String

(2)
PHP uses the C syntax for iterations:
for (var $i = 0; $i < 10; $i++)
{ }
while ($a_var < 10)
{ }

VB.NET:
For i As Integer = 0 To 10
Next
While a_var <= 10
End While

(3)
PHP (again, C syntax):
if ($a_var == $another_var)
{ }
else
{ }

VB.NET:
If a_var = another_var Then
Else
End If

(4)
PHP:
$file = fopen(<file to open>,"r"|"r+"|"w"|"w+"|"a"|"a+"|"x"|"x+");

VB.NET:
Many many ways of manipulating files.
Have a look at the System.IO namespace.
There's the classes File, FileStream, StreamReader, Stream and FileInfo among others.

pls i need the different betwwen Vb.net and PHP looking in the are i listed
Area Visual Basic .Net PHP
(1)Variable definitions
(2)Loops
(3)Conditions
(4)File handling

Oxiegen 88 Basically an Occasional Poster Featured Poster

Perhaps something like this.
The check should be performed after the query.

Me.NamesTableAdapter.FillByName(Me.DataSet.Names, Me.ForenameTextBox.Text, Me.ForenameTextBox.Text, Me.SurnameTextBox.Text, Me.SurnameTextBox.Text, Me.RoleTextBox.Text, Me.RoleTextBox.Text)

If Me.DataSet.Names.Rows.Count > 0 Then
        Dim frm As New Staff
        frm.SetEmployeeData(Me.DataSet.Names)
        frm.Show()
Else
        MessageBox.Show("No records found")
End If
        Me.Close()
Oxiegen 88 Basically an Occasional Poster Featured Poster

If you use a DataReader then the answer is quite easy.
The reader has a property called HasRows that indicates whether or not the database query was successful, or not.
Put the code for opening the form inside an If DataReader1.HasRows = True Then statement, and the code for displaying a MessageBox inside an Else statement.

If you're using the DataAdapter method and use that to fill a DataSet then you can check either DataSet1.Tables.Count or DataSet1.Tables(0).Rows.Count.

i have sucessfully coded my form so that when a user enters data into the texxt box and searches any matching data is displayed on another form my problem is when no data matches the search criteria the form that would display the result still opens but is blank how do i create a message that tells the user there is no matching crieria and stop the other form from opening?

Oxiegen 88 Basically an Occasional Poster Featured Poster

In Visual Studio 20005/2008 you can add a new connection through a wizard.
At one point the wizard tells you that you've selected a local data file that's not in the current project, and asks if you would like to copy the database file to your project folder.

Choosing NO will keep the database file at the current location and your VB project will use and share that file.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Doesn't this all depends on how you place your monitors?
One monitor is always the primary depending on which graphics port you use on your computer.

In either case, perhaps you should take a look at the Screen class?
More specifically the property AllScreens which contains a collection of all screens.

You can check for the Primary screen with this:

If Screen.AllScreens(0).Primary Then
     '' Code for displaying box on the seconday screen
     '' using Screen.AllScreens(1).Bounds or .WorkingArea
Else
     '' Code for displaying box on the primary screen
     '' using Screen.AllScreens(0).Bounds or .WorkingArea
End If
Oxiegen 88 Basically an Occasional Poster Featured Poster

Ok. Here's another thought.
Can you see all controls in the template while in design mode?
If so, what happens if you double-click the dropdown control?

You should be "transferred" to the codebehind-file and a method is created for the dropdown-control's SelectedIndexChanged event.
And thus recognized.

On the other hand, have you checked to see if the dropdown gets declared while inside the template?
If it's not. Just manually declare it yourself in the codebehind-file. Protected WithEvents CriticalBx As DropDownList

Oxiegen 88 Basically an Occasional Poster Featured Poster

Quite right.
You can also change the format of the date in the gridview.
But if you change the format of the date at the source, you only have to do it once and makes for, in my opinion, cleaner code.

Oxiegen 88 Basically an Occasional Poster Featured Poster

you need to do coding in cs file, you cannot add if statement in aspx page, .

Not to complicate anything or something. But this is not entirely accurate.
You don't need to use CS or VB codebehind file.

You can use <script runat="server"></script> directly in the <head> section of the ASPX file, like in ASP. But that's another story and is quite messy.

<script runat="server">
Protected Sub SomeControl_SomeEvent(sender as Object, e As EventArgs) Handles SomeControl.SomeEvent
      If dropdownlistbox1.selectedindex = 1 Then
            'whatever u want
      Else
           'something else
       End If
End Sub
</script>
<script runat="server">
protected void SomeControl_SomeEvent(Object sender, EventArgs e)
{
      if (dropdownlistbox1.selectedindex = 1)
     {
            //whatever u want
      } else {
           //something else
       }
}
</script>
Oxiegen 88 Basically an Occasional Poster Featured Poster

This is a quick and dirty way of doing it. I sometimes use it as a last resort.

Iterate through the Control collection of the page checking each controls ClientID.
If it matches the ID you gave the control, then you have a reference you can use.

Private classVariable_Control As Object = Nothing
Private Sub LookForControl(parent As Control)
	For Each ctl As Control In parent.Controls
		If TypeOf ctl Is DropDownList Then
			If ctl.ClientID.Equals("CriticalBx") Then
				classVariable_Control = ctl
				'Exit the Sub and do something with the object
			End If
		End If
		If ctl.HasControls Then LookForControl(ctl)
	Next
End Sub

But it just occurred to me.
Did you try the SelectedIndexChanged event?

Protected Sub CriticalBx_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles CriticalBx.SelectedIndexChanged
		'Some event coding
End Sub
Oxiegen 88 Basically an Occasional Poster Featured Poster

You might wanna have a look at the ClientID property.
ASP.NET adds the container ID to the ID of a control in the container but ClientID is always the ID you gave the control.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Try this (add the red part):

<asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#CC9966"
            BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1"
            Style="z-index: 103; left: 288px; position: absolute; top: 256px" AutoGenerateColumns="False">
            <RowStyle BackColor="White" ForeColor="#330099" />
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
            <Columns>
                <asp:BoundField DataField="Expr1" HeaderText="Expr1" ReadOnly="True" SortExpression="Expr1" DataFormatString="{0:d}" HtmlEncode=False />
                <asp:BoundField DataField="Expr2" HeaderText="Expr2" SortExpression="Expr2" DataFormatString="{0:d}" HtmlEncode=False />
                <asp:BoundField DataField="DAYS" HeaderText="DAYS" ReadOnly="True" SortExpression="DAYS" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:guest1 %>"
            SelectCommand="SELECT CONVERT (DateTime, date_of_arr, 103) AS Expr1, CONVERT (DateTime, date_of_dept, 103) AS Expr2, DATEDIFF(dd, date_of_arr, date_of_dept) AS DAYS FROM guesthouse WHERE (CONVERT (DateTime, date_of_arr, 103) = @date_of_arr)">
            <SelectParameters>
                <asp:ControlParameter ControlID="arrivaldate" Name="date_of_arr" PropertyName="Text" />
            </SelectParameters>
        </asp:SqlDataSource>
Oxiegen 88 Basically an Occasional Poster Featured Poster

Change this

SelectCommand="SELECT date_of_arr, date_of_dept, DATEDIFF(dd, date_of_arr, date_of_dept) AS DAYS FROM guesthouse WHERE (date_of_arr = @date_of_arr)">

Into this

SelectCommand="SELECT CONVERT(DateTime,date_of_arr,103), CONVERT(DateTime,date_of_dept,103), DATEDIFF(dd, date_of_arr, date_of_dept) AS DAYS FROM guesthouse WHERE (CONVERT(DateTime,date_of_arr,103) = @date_of_arr)">

Notice the CONVERT functions.
The CONVERT function takes 2-3 arguments.
1: The target datatype of the field
2: The fieldname
3: The format of the output

Here's an overview of how to format dates in SQL: http://msdn.microsoft.com/en-us/library/aa226054(SQL.80).aspx

Oxiegen 88 Basically an Occasional Poster Featured Poster

The easiast way to do this would be to first fetch the information from the database then call a seconday method in order to update the database.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim connstr As String
connstr = ConfigurationManager.ConnectionStrings("guest1").ConnectionString()
Dim SQL As String = "select booking_no from guesthouse"
Dim conn As New SqlConnection(connstr)
conn.Open()
Dim com As New SqlCommand(SQL,conn)
Dim dr As SqlDataReader

dr = com.ExecuteReader()
If dr.HasRows Then
   dr.Read()
   sino.Text = dr(0).ToString
End If
conn.Close()

UpdateBookingNo()
End Sub

Private Sub UpdateBookingNo()
Dim connstr As String
connstr = ConfigurationManager.ConnectionStrings("guest1").ConnectionString()
Dim SQL As String = "update guesthouse set booking_no = booking_no + 1"
Dim conn As New SqlConnection(connstr)
conn.Open()
Dim com As New SqlCommand(SQL,conn)
com.ExecuteNonQuery()
conn.Close()
End Function
Oxiegen 88 Basically an Occasional Poster Featured Poster

Perhaps if you change this e.Day.Date into this e.Day.Date.ToString("dd/MM/yyyy")
Otherwise you may have to complicate things by going into localization, but then your in the hands of the visitor and their local computersettings.

Oxiegen 88 Basically an Occasional Poster Featured Poster

You can use the RequiredFieldValidator-control.
Put one next to each textbox or dropdownlist and bind each validator-control to the corresponding input-control.

Oxiegen 88 Basically an Occasional Poster Featured Poster

First off, you don't need to use the statement With Me because it's redundant.

Second, in an If statement there's only need for (in my oppinion) one Else.
As the If statement is for checking different values you should use: IF {something} Else If {something else} Else {totally different} End If This is what I would do (I agree about the last If statement being wrong):

If makeoverRadioButton.Checked Then
	MakeoverLabel.Text = MAKEOVER_Decimal.ToString()
Else If HairStylingRadioButton.Checked Then
	hairStylingLabel.Text = HAIR_STYLING_Decimal.ToString()
Else If manicureRadioButton.Checked Then
	manicureLabel.Text = MANICURE_Decimal.ToString()
Else 
	permanentMakeupLabel.Text = PERMANENT_MAKEUP_Decimal.ToString()
End If

Or

If makeoverRadioButton.Checked Then
	MakeoverLabel.Text = MAKEOVER_Decimal.ToString()
End IF
If HairStylingRadioButton.Checked Then
	hairStylingLabel.Text = HAIR_STYLING_Decimal.ToString()
End IF
If manicureRadioButton.Checked Then
	manicureLabel.Text = MANICURE_Decimal.ToString()
End IF
If permanentMakeupRadioButton.Checked = True Then
	permanentMakeupLabel.Text = PERMANENT_MAKEUP_Decimal.ToString()
End If

Good luck!

Oxiegen 88 Basically an Occasional Poster Featured Poster

I would try to limit the amount of data for each query.
Using the reader in order to populate some kind of repository do take a long time.
The way the reader works is that it only reads one line of data at a time.
Ie:

While Rs.Read
If Not IsDBNull(Rs.Item("some_column_name")) Then repository = Rs.Item("some_column_name")
End While

However, if you limit the amount of data to read with a WHERE clause this will go faster.

Or, you could use a dataadapter/dataset and basically get a mirror copy of the data.
Then you can search and select from there.

Public db_name As String
Public db_username As String
Public db_userpassword As String
Public db_server As String

Public connStr As String
Public sqlCommand As OdbcCommand
Public sqlConn As OdbcConnection
Public Rs As OdbcDataReader  '''Remove this
Public Da as OdbcDataAdapter '''Replace with this
Public sqlComBuilder as OdbcCommandBuilder '''Add this
Public Ds As DataSet '''Add this too

Public Sub DoQuery(ByVal tmpSQL as String)
    connStr = "Driver={PostgreSQL ANSI};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword

              sqlConn = New OdbcConnection(connStr)
              Da = New OdbcDataAdapter(tmpSQL, sqlConn)
              sqlComBuilder = New OdbcCommandBuilder(Da)
              Ds = New DataSet()

              sqlConn.Open()
              Da.Fill(Ds,"name_of_table")
              sqlConn.Close()
End Sub

The CommandBuilder is used to automatically create INSERT/DELETE/UPDATE queries when you need to update, insert or delete information in the database. Good thing to use if you don't want to create long and complicated queries manually.

Oxiegen 88 Basically an Occasional Poster Featured Poster

If the database was to be openly accessible *shudder*, albeit with a username and password.
Then you can most likely access the database with javascript and odbc (jdbc?).
If that is the case then no server-side scripting would be needed.