Begginnerdev 256 Junior Poster

You will want to subtract one from QuestHistroyArray length

You will always want to subtract 1 from an array.
The last item will be a terminator character, so you will want the n - 1 index.

Begginnerdev 256 Junior Poster

Np friend, anything else I can help you with?

Begginnerdev 256 Junior Poster

You could write a sql statement to instert each one, then place it in a loop.

Example:

    Dim conStr As String = "Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;"

    Dim con As New SqlConnection(conStr)
    Dim cmd As SqlCommand

    Try

        For i = 0 To ComboBox1.Items.Count

            con.Open()

            Dim sqls As String = "INSERT INTO table (column) VALUES ('" & ComboBox1.Items(i).ToString & "')"
            cmd = New SqlCommand(sqls, con)
            cmd.ExecuteNonQuery()

        Next


    Catch ex As Exception
        MsgBox(ex.Message)
    End Try
Begginnerdev 256 Junior Poster

No problem friend, any other issues you have?

Begginnerdev 256 Junior Poster

Here is a tiny little recursive sub procedure I have written to do what you are needing it to do.

Public Sub PlusOne(int As Integer)
    If int <= 1000 Then
        ListBox1.Items.Add("HelloWorld")
        int += 1
        PlusOne(int)
    End If
End Sub

Just need to pass 1 in as int when you first call the sub, and change ListBox1 to Console.WriteLine.

Begginnerdev 256 Junior Poster

For loops are actualy pretty easy to use.

Example:

For Each object In Collection

Next

For Each Control in Me.Controls
'Loops through every control on the form.'
Next



For i = 0 to Me.Controls.Count

Next

'Would be the same as coding'
for(i=0;i=Me.Controls.Count;i++)
{

}

Hope this helps.

Begginnerdev 256 Junior Poster

Example:

Dim sqls As String = "SELECT column1 FROM table WHERE primarykey=value"
Begginnerdev 256 Junior Poster

Example:

Dim sqls As String = "INSERT INTO table (column1) VALUE ('" & DateTimePicker1.Value & "')"
Begginnerdev 256 Junior Poster

It would work.

If you wanted to remove it later you could try:

t.RemoveAt(t.IndexOf(txtField4))
Begginnerdev 256 Junior Poster

I forgot to add, to retrieve the object from the ArrayList, it's good practice to do the following.

Dim txtBox As TextBox = TryCast(t(i), TextBox)
Dim lbl As Label = TryCast(l(i),Label)

If the cast fails, they will return Nothing.

So by just checking to ensure they are not nothing, you will safeguard from null references.

Begginnerdev 256 Junior Poster

Here is a rewritten version of your code using ArrayLists (better when dynamicly adding/removing from a list/array)

Dim t As New ArrayList
Dim l As New ArrayList

   For i = 0 To intNoColumns - 1
        Dim lbl As New Label
        Dim txt As New TextBox

        lbl.Name = "lblField" & i
        lbl.Location = New Point(25, intylocation)
        lbl.Size = New Size(300, 15)
        lbl.Text = dt.Columns(i).ToString
        Me.pnlResults.Controls.Add(lbl)

        txt.Name = "txtField" & i
        txt.Location = New Point(150, intylocation)
        txt.Size = New Size(300, 10)
        txt.Text = dt.Rows(intCurrentRecord).Item(i)

        If lbl.Text = strPrimaryKey Then
            txt.Enabled = False
            intPrimaryKeyIndex = i
        End If
        Me.pnlResults.Controls.Add(txt)

        intylocation += 50

        t.Add(txt)
        l.Add(lbl)
    Next

This will be must easier for you to use than using redim for each new item in the array.

Begginnerdev 256 Junior Poster

You might also want to wrap your code in try/catch blocks.

Begginnerdev 256 Junior Poster

Do you mean something like this?

    Try
        Dim myDir As String = My.Computer.FileSystem.SpecialDirectories.Desktop & "/tmpOldLoc/"
        Dim toDir As String = My.Computer.FileSystem.SpecialDirectories.Desktop & "/tmpNewLoc/"


        If Directory.Exists(myDir) = True Then
            Dim di As New IO.DirectoryInfo(myDir)
            Dim diar1 As IO.FileInfo() = di.GetFiles()
            Dim dra As IO.FileInfo
            For Each dra In diar1
                File.Copy(dra.FullName, toDir & dra.Name)
            Next
        End If

    Catch ex As Exception

        MsgBox("Something went wrong!" & vbCrLf & ex.Message)

    End Try
Begginnerdev 256 Junior Poster

Your connection string looks wrong.

Are you getting your "DataDirectory" from your vb app?

If so, your connection string should look like this.

cnn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & DataDirectory & "\Database.accdb"
Begginnerdev 256 Junior Poster

That is the wildcard character.

That means that you are allowing any connection from any IP.

Do you have a user setup (with access to the database) on the Ubuntu machine?

Begginnerdev 256 Junior Poster

Is it a possibility you need to instal the mySQL adapter?

Here are the adapters available.

Begginnerdev 256 Junior Poster

Almost every obect that has an index is treated as a 0th based array.

Arrays will have a terminator character to the end.

Example

Cat

cat = 3 characters, but is actually 4 after the terminator.

Therefore,

 Dim test() As String = {"c", "a", "t"}

 MsgBox(test.Length) 'Returns 3'

 MsgBox(test(0)) 'Returns c'
 MsgBox(test(1)) 'Returns a'
 MsgBox(test(2)) 'Returns t'
 MsgBox(test(3)) 'Outside of bounds. Terminator character."
Begginnerdev 256 Junior Poster

You will want to make sure to subtract 1 from count.

Liike this:

For i As integer = 0 to Me.DtaGridXML.Rows.Count - 1
Begginnerdev 256 Junior Poster

Here is another post on the same subject.

Begginnerdev 256 Junior Poster

There is

UPDATE table SET column2 = column2 + 1

Begginnerdev 256 Junior Poster

You will have to loop through the datagrid like a table.

Here is another question from Microsoft's Forumns.

Click Here

Begginnerdev 256 Junior Poster

Any luck with your problem my friend?

Begginnerdev 256 Junior Poster

Here is an article on WPF issues.

Begginnerdev 256 Junior Poster

Are you creating controls on run time?

Begginnerdev 256 Junior Poster

Sorry deceptikon, the previous post about being in the wrong forum was when it was posted in the vb.net forum.

Begginnerdev 256 Junior Poster

Do you have any timers or any code that is firing constantly?

Begginnerdev 256 Junior Poster

Place this code in the Form's mouse down event.

'On mousedown'
If e.Button = Windows.Forms.MouseButton.Left Then

Capture = True
relocateTimer.Start()

End If

Place this in the mouse up event.

'On mouseup'
relocateTimer.Stop
Capture = False

Next place this in the timer's tick event.

'Place this code in a timer.'
'Set tic to 15 milliseconds.'

dim i as integer = 0

i+= 1

If i > 15 Then
Me.location = new Point (MousePosition.x - (me.width /2 ),Mouseposition.y - (me.height /2))
End If

Now, after the user holds the mouse for 15 milliseconds, it will start to relocate.

Begginnerdev 256 Junior Poster

Don't know if anyone else here has the same feeling that I have.....

I have a feeling that this may either be a prank, or something malicious....

Am I the only one who feels this way?

Also, wrong forum.

Begginnerdev 256 Junior Poster

Are the TracebleSOPAllocationItems being stored directly to the grid, or is the grid bound to a database?

Begginnerdev 256 Junior Poster

Exact duplicate of this.

Begginnerdev 256 Junior Poster

I am suspecting that the issue is the AllocatedItem.

Correct me if I am wrong, but there will only be object types in the data source right?

You can place the code in a TryCast() to attempt to cast it to the AllocatedItem object.

Begginnerdev 256 Junior Poster

The only way I know of would be to single out each directory and find the directory pointing back to it's self.

This would be time consuming, but you would be able to find the problem, then just remove the loopback.

Begginnerdev 256 Junior Poster

Np friend, don't forget to close the thread. :)

Begginnerdev 256 Junior Poster

You will have to "recreate" the situation to generate the report the same way as it was two days ago.

If the reports are not archived, then you will have to find a way to recreate the situation.

Begginnerdev 256 Junior Poster

You aren't referencing a textbox you renamed or forgot to name are you? If not, have you possibly deleted the textbox by accident?

Are both of them on a different form?

Have you forgotten to add them to the form?

If you have you can do it through the designer or manually like:

Public lblComputerSum As Label
lblComputerSum.Name = "lblComputerSum"
Public lblPlayerSum As Label
lblPlayerSum.Name = "lblPlayerSum"


'Then add to form.'

MyForm.Controls.Add(lblComputerSum)
MyForm.Controls.Add(lblPlayerSum)
Begginnerdev 256 Junior Poster

You are trying to bind the conenction to the statement string.

You will have to use the connection string in the SQLClient.SQLConnection.

You can get your connection string from here

Begginnerdev 256 Junior Poster

If I were you, I would place the code in the transaction form. That way the new total is calculated as soon as the transaction is submitted.

Begginnerdev 256 Junior Poster

Np, friend. Don't forget to marked the thread as solved. :)

Begginnerdev 256 Junior Poster

Should look something like this:

    Dim sqls As String = "UPDATE table SET column= column - 1 WHERE unique=value"
    Dim con As New SqlConnection(connection string here)
    Dim cmd As New SqlCommand(sqls, con)
    cmd.ExecuteNonQuery()

You can also do this:

sqladapter.UpdateCommand = sqls
sqladapter.Update("album")
Begginnerdev 256 Junior Poster

If you have a connection and command already declared just do this.

command = New Command(sqls,connection) 'Substitute "Command" With your adapter type.
Begginnerdev 256 Junior Poster

Declare a boolean variable at the top of the class.

public Paused as Boolean = false
'When you fire your click event do this;
If Paused = false Then
    'Pause code here
    Paused = true
ElseIf Paused = True Then
    'Unpause code here.
    Paused = False
End If
Begginnerdev 256 Junior Poster

You will have to create a query that gets the current value and subtracts one.

Dim sqls as String = "UPDATE table SET column= column - 1 WHERE unique=value"
Begginnerdev 256 Junior Poster

The correct sql statement would be:

("SELECT * FROM daftarpelajar WHERE '" & cbChoice.Text & "' Like '%" & txtSearch.Text & "%' ORDER by id_pelajar ", conn)
Begginnerdev 256 Junior Poster

You will have to close this thread and start a new one. I am sure we will be able to help you out.

Begginnerdev 256 Junior Poster

One of the easiest projects for people who are starting anew would be a CD catalog.

You will have to start designing your tables.

Example:

Table Name: CDinfo

Column1: prod_name
Data Type: varchar
Field Legnth: 40

Column2: prod_sn
Data Type: varchar
Field Length: 100

Column3: prod_price
Data Type: Numeric(6,2) Four significant figures and two decimal places. 1000.00
Field Length: ~ -2mil > ~ 2mil

ect...

Then you will need to think in a business level as to how you want to "loan" or "sell" the cds.

You will need to design a customer table.

If you sell, then you will need a table with metadata like the date of purchase ect...

If you loan, you will need a similar table but modified a bit for the loans.

I hope this helps.

Begginnerdev 256 Junior Poster

What you will need to do is to sit down with your partners and develop a database for the backend.

If you are wanting multiple users at a time, look into MySQL (free) or SQLServer (Free from MSDNAA)
If you are looking for a single user at a time, use Access.

You will need to decide on your project type first, banking systems are the normal test system.

Then you will need to design your tables and entities.

Once you have the database designed and tables layed out, start designing your GUI.

When/If you need help with the GUI or Database, I would be glad to help.

Begginnerdev 256 Junior Poster

You might have to edit the CSV file.

Or, if you know all the lengths are the same, you can parse the second value and seperate by the values from string index 1-3, 3-6, ect...

Begginnerdev 256 Junior Poster

If you are a student, then you shouldn't just request a project.

You should show a little effor before we can offer to help you.

Now, if you have ideas or code, post them.

We can't do your homework for you.

Begginnerdev 256 Junior Poster

Here is the documentation that Microsoft offers.

Begginnerdev 256 Junior Poster

There is a free extention for Visual Studio that does this. Open visual studio, and go to the extention manager. Go to online templates and look for Google GEO Pack 2010