Posts by Oxiegen which have been Voted Up

Re: in Microsoft Windows
 
1
 

Do you know for a fact whether or not the recovery partition doesn't contain the factory install of Win7?
If it does you can just find the correct button to press/hold while booting and reset the system.

Otherwise, go right ahead and remove it all.
You can do that during the install of Win7. Just hit the big Custom button and remove any and all partitions from there, and create a new one as you see fit.

Re: in PHP
 
1
 

Here's the deal.
Practically everything under and including www should be owned by the webserver.
Check the config to see what user the server runs as, and change files and directories using the chown command.
Otherwise the webserver and scripts cannot perform any file or directory action.

You can later on lock it up some using a .htaccess file.

Re: in VB.NET
 
1
 

This is a fully working code.
I noticed one thing that caused problems. The column name Size is a reserved word, so you need to put brackets [] around it.

Imports System
Imports System.IO
Imports System.Text
Imports System.Data.OleDb

Public Class frmBirthdayCake
    Private sql As String = "SELECT CakeID,Cake_Name,Cake_Description,Weight,Price,Image,ShelfLife,[Size],NoOfServings FROM Birthday_Cake"
    Private dt As New DataTable
    Private con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\CakeAlbum.accdb")
    Private adapter As New OleDbDataAdapter(sql, con)
    Dim index As Integer

    Private Sub frmBirthdayCake_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        con.Open()
        adapter.Fill(dt)

        DataGridView1.DataSource = dt
        DirectCast(DataGridView1.Columns("Image"), DataGridViewImageColumn).ImageLayout = DataGridViewImageCellLayout.Stretch

        For i As Integer = 0 To dt.Rows.Count - 1
            Dim row As DataGridViewRow = DataGridView1.Rows(i)
            row.Height = 60
        Next

        DataGridView1.Columns("Image").Width = 150
        con.Close()
    End Sub

    Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs) Handles btnNext.Click
        If TextBox1.Text = "" Then
            index = 0
        ElseIf index = dt.Rows.Count - 1 Then
            Exit Sub
        Else
            index += 1
        End If

        TextBox1.Text = dt.Rows(index)(0)
        TextBox2.Text = dt.Rows(index)(1)
        ReadImage()
    End Sub

    Private Sub btnPrevious_Click(sender As System.Object, e As System.EventArgs) Handles btnPrevious.Click
        If TextBox1.Text = "" OrElse index = 0 Then
            index = 0
        ElseIf index = dt.Rows.Count - 1 OrElse index <> 0 Then
            index -= 1
        End If

        TextBox1.Text = dt.Rows(index)(0)
        TextBox2.Text = dt.Rows(index)(1)
        ReadImage()
    End Sub

    Private Sub ReadImage()
        Try
            Dim imageBytes() As Byte = CType(dt.Rows(index)(2), Byte())
            Using ms As New MemoryStream(imageBytes)
                PictureBox1.Image = Image.FromStream(ms)
                PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
            End Using
        Catch ex As Exception

        End Try
    End Sub

    Private Sub DataGridView1_CellMouseClick(sender As Object, e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseClick
        TextBox1.Text = dt.Rows(e.RowIndex)(0)
        TextBox2.Text = dt.Rows(e.RowIndex)(1)
    End Sub
End Class
Comments
thanks a lot this works!!!
Re: in VB.NET
 
2
 

You need two string variables.

You can perform a line read using the appropriate filereader object and append the line into a temp string variable through a simple loop.
And for each line you can in addition perform some string manipulation.
So for each line the only contains "" or " ", you can skip to the next line so that empty lines do not get read into the permanent string variable.

Additionally, during the manipulation phase you can do a simple string replacement.
:'++' becomes vbNewLine (or vbCrLf) and so on.
By using two variables you can append the last know good string to the "real" string.

The String object contains a whole bunch of useful tools to do exactly what you're asking for.

Re: in VB.NET
 
1
 

Just for kicks.
Try putting that code in a separate method and call it from the Load method.
But also include a class boolean variable.

Private bIsLoading As Boolean = True

Private Sub frmcrc_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    If bIsLoading Then
        LoadValues()
    End If
    bIsLoading = False
End Sub

Private Sub LoadValues()
    'Your code
End Sub

This is just to make sure that the code is not being executed twice.
I've had the happen to me once or twice when I had some code in the Form_Load event.

Re: in Computer Science
 
1
 

DIM is the keyword used in Visual Basic to declare a variable.

VB: Dim varname As Object
C#: object varname;

Comments
ok
Re: in VB.NET
 
1
 

If you create and add controls through code then those controls will not have any events tied to them.
When you open the second and third panels and create controls in them, you also have to use the AddHandler statement and tie that to the txbUM_KeyDown event, or use a generic event and tie all three textboxes to it using AddHandler.

'For panel 2
AddHandler txbUM2.KeyDown, AddressOf txbUM_KeyDown

'For panel 3
AddHandler txbUM3.KeyDown, AddressOf txbUM_KeyDown

Like that.
And in the event itself you can use sender to identify which textbox triggered the event by using CType.

Dim tbox As TextBox = CType(sender, TextBox)
Re: in Web Development
 
1
 

I cannot speak for all the webhosts in the world.
However, I would say that some webhosts provide such a solution, provided that you register a domain with them.
But most do not. They require that you order the full package of a webspace that includes 5, or more, email addresses.

But to answer your question.
Yes. It's possible.

How about this example? http://www.mailorderworks.co.uk/

Re: in Web Design, HTML and CSS
 
1
 

The question mark (?) was just an indicator telling you to put a numeric value there.
A question mark is also known as an "unknown". :)

Auto is not a property, it's a valid value to simply allow the container to expand depending on whatever the size of the content without regards.

Re: in VB.NET
 
1
 

Something like this:

Private Sub CopyToAccess(source As DataTable)
    Try
        Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;"

        Dim accConnection As New OleDb.OleDbConnection(connString)
        Dim selectCommand As String = "SELECT <field1>, <field2> and so on FROM <table>"
        Dim accDataAdapter As New OleDb.OleDbDataAdapter(selectCommand, accConnection)

        Dim accCommandBuilder As New OleDb.OleDbCommandBuilder()
        accDataAdapter.InsertCommand = accCommandBuilder.GetInsertCommand()
        accDataAdapter.UpdateCommand = accCommandBuilder.GetUpdateCommand()

        Dim accDataTable As DataTable = source.Copy()

        ''Just to make sure, set the RowState to added to make sure an Insert is performed'
        'For Each row As DataRow In accDataTable.Rows'
        '    If row.RowState = RowState.Added Or RowSate.UnChanged Then'
        '        row.SetAdded()'
        '    End If'
        'Next'

        accDataAdapter.Update(accDataTable)
    Catch ex As Exception
    End Try
End Sub
Re: in VB.NET
 
1
 

Here's how you can get an ArrayList of available drives.

Imports System.IO

Public Function GetDrives() As ArrayList
    Dim drives As New ArrayList

    For Each drive As DriveInfo In My.Computer.FileSystem.Drives
        drives.Add(drive.Name)
    Next

    Return drives
End Function
Re: in VB.NET
 
1
 

I'm assuming that you're looking for the SQL expression to accomplish this.
Here it is:
SELECT tblData.num,SUM(tblData.cost) AS Total,tblPrize.prize FROM tblData, tblPrize WHERE tblData.num = tblPrize.num GROUP BY tblData.num

Re: in VB.NET
 
1
 

I've been successful in using IO.File.Copy when transfering files to and from another computer.
IO.File.Copy("\\" & cmbservername1.Text & "\SharedNow\database.txt", "C:\database.txt")

Re: in VB.NET
 
2
 

You should make it a rule to include an ID field and make it a Primary Key when creating tables in a database.
And also include that in your SELECT statements.

That's why you get that message.

Re: in VB.NET
 
1
 

Try setting the mdiparent of that second form to the MDI form.

mastersupplier.MdiParent = <name of mdi form>
Re: in VB.NET
 
1
 

Alright.
You want to convert the text into HTML entities.

This function should do it:

Private Sub SomeMethod()
   Dim file As New StreamReader("filename", Encoding.GetEncoder(437))
   Dim content As String
   content = TextToHtmlEntity(file.ReadToEnd)
   file.Close()

   'content now contains a string of HTML entities
End Sub

Private Function TextToHtmlEntity(ByVal text As String) As String
   Dim textVal As Integer
   Dim encoded As String = ""
   Dim c As Char

   For Each c In text
      textVal = AscW(c)
      If textVal >= 49 And textVal <= 122 Then
         encoded += c
      Else
         encoded += String.Concat("&#",
textVal.ToString(System.Globalization.NumberFormatInfo.InvariantInfo), ";")
      End If
   Next

   Return encoded
End Function
Re: in VB.NET
 
1
 

You can use the MouseMove event and check if the mouse pointer is within the Bounds of the stripmenu item.
If that's the case, simply change the BackgroundColor.

Private Sub menuitem1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
        If menuitem1.Bounds.Contains(e.Location) Then
            menuitem1.BackColor = Color.Beige
        Else
            menuitem1.BackColor = Color.White
        End If
    End Sub
Comments
Thank you.

Tag Cloud for Oxiegen