Begginnerdev 256 Junior Poster

Are you wanting to limit the select count to 60 per each item in the combobox, or 60 total selections of items?

Begginnerdev 256 Junior Poster

Again, I suggest the Active Directory.

The user's first and last name will be stored in the active directory.

You can retrieve this by capturing the username that is logged into the application.

'Declare a public variable for the full name.'
Public FullName As String


'Call the function and assign the return to the FullName variable.'
FullName = GetRealNameFromAD(Environment.UserName)




'This is the function to drop in.'
Private Function GetRealNameFromAD(ByVal UsernameToFind As String) As String
    'Searches the active directory to get the users real name.'
    'Uses the user who is logged on at that time.'
    Dim full as String
    Try
        Using searcher As New DirectorySearcher(New DirectoryEntry())
            searcher.PageSize = 1000
            searcher.SearchScope = SearchScope.Subtree
            searcher.Filter = "(&(samAccountType=805306368)(sAMAccountName=" & UsernameToFind & "))"
            Using Results As SearchResultCollection = searcher.FindAll
                If Results Is Nothing OrElse Results.Count <> 1 Then
                    Throw New ApplicationException("Invalid number of results returned - either no users were found or more than one user account was found")
                End If
                Using UserDE As DirectoryEntry = Results(0).GetDirectoryEntry
                    full = CStr(UserDE.Properties("givenName").Value) & " " & CStr(UserDE.Properties("sn").Value)
                    return full
                End Using
            End Using
        End Using
    Catch ex As Exception
        MsgBox("Exception from: " & ex.Source & vbCrLf & ex.Message & vbCrLf & "Unable to lacate the user in active directory.", MsgBoxStyle.OkOnly)
    End Try
End Function
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

Duplicate?

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

You could try a different method and define a structure.....

Dim stud(24) As Students
Dim tmpStud As Students


Structure Students
    Dim StudentName As String
    Dim CumulativeScores As Double
End Structure




    For i = 0 To stud.Count - 2
        If stud(i).CumulativeScores > stud(i + 1).CumulativeScores Then
            tmpStud = stud(i + 1)
            stud(i + 1) = stud(i)
            stud(i) = tmpStud
        End If
    Next
Begginnerdev 256 Junior Poster

Sorry for long reply, and not marking question solved.....

Answer was to loop through the panels and do a buble sort.

Sudo

is next.y position < this.y Position
Yes: this.index = next.index, next.index = this.index

ect...

That way it resorts the index of the panels (Which is what is used when looping through controls.

Begginnerdev 256 Junior Poster

Hello my fellow Daniwebbers, I have yet another question for you.

I have been using a library to scan, located here, and have not been getting a consistant return.

When I use the TWAIN Source, the GUI pops up and disappears almost instantly.
When I tell the source manager to not show the GUI, it scans fine, but with duplexing enabled.

When I scan with the WIA source, everything is fine.....BUT! I can't save my scan settings.

Has anyone used twain or WIA in .Net and knows how to pass in the parameters for the scanning process?

I have dug through WIA and TWAIN documentation, and neither of them are very helpful on the situation.

Begginnerdev 256 Junior Poster

What poojavb is saying is that you do not need those single and double quotes.
Single quotes in SQL are used to represet a string DATA value. The double quotes you are using to creating a string
in VB.NET

Example:

Dim strn As String = "This is the correct way to declare a string."
Dim strn2 As String = "SELECT * FROM table WHERE columm='" & myString & "'"
Begginnerdev 256 Junior Poster

A long overdue response to the question/answer..... I have found an application written by NETMaster on codeproject, and tailored it, but still can't expose the true way to scan without the UI and pass in the parameters needed to perform the scan.

Begginnerdev 256 Junior Poster

Found an odd fix for the bad comments for the CODE section for the vb.net forumns.

If you add an additional ' at the end of the commented line, it renders fine.

Begginnerdev 256 Junior Poster

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

Begginnerdev 256 Junior Poster

I have always had bad luck with looking for empty rows. I have always made direct references to the data are.

I would normally wrap the code in two for statements like:

For i = 1 To NumberOfColumns
    For i = FirstDataRow To LastDataRow
    'Place your extraction code here.'
    Next
Next
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 can also use the Active Directory if you are wanting a full name. That would be the most accurate way if you were writing
a multiple user application. Each user's name would be in teh active directory.

Begginnerdev 256 Junior Poster

I have found a solution.
I placed the code into a timer, and then placed an IF statement saying

If valueOfTimer > 15 Then
'code'
End IF
Begginnerdev 256 Junior Poster

I have tried, but the interpreter skips the code. :(
I have found an article that said the .NET events are supposedly fired in the following order

MouseDown
Click
MouseUp

Which completely destroys my code setup. I need to be able to click to referece the control, and mousedown/up to drag the control to where I need it to be.

Begginnerdev 256 Junior Poster

It is basicly control relocation code. User clicks/holds left mouse > drag > release.

Begginnerdev 256 Junior Poster

Hello my fellow Danniwebbers, I have yet another question for you to ponder.

I have two custom action listers. One that handles Mouse.Click and one that handles Mouse.MouseDown.

My question to you is, can I delay the mouse down event so that it does not intefere with the code of the Mouse.Click event?

I have tried adding a timer and waiting x amount then setting a bool value to true, but the code executes to fast and it skips the other code.

Any tips?

Thanks,
Begginnerdev

Begginnerdev 256 Junior Poster

You would have to keep a counter of the visists to that website, and increment the counter every time the user views that website.

Then, you will have to define how many visits constitute an automatic favorite.

Next, you will copy the corresponding website to the "Favorites" list box.

Begginnerdev 256 Junior Poster

You will need to reference the value in the textbox from Add Product.

Like:

BuyingForm.TotalTextBox.Text = Cdbl(AddProduct.PriceTextBox.Text) * Cint(BuyingForm.QuantityTextBox.Text)

But, you may have a problem.

Are you luaching the buying form FROM the add product form?

If not, you are not going to be able to get your value from that form.

You will have to get the value from a database or a text file.....

Are you using a database backend, or storing the values in project variables?

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

Can we see the code that you are using to fill the chart?

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

Substitute the name for the textbox that you want the new textbox to be placed under.

And the code is wrong, I just noticed.

Correct would be:

textbox1.Location.Y = myOtherTextBox.Location.Y + 40 'You will have to play with this value to adjust it to where you want it.
textbox1.Location.X = myOtherTextBox.Location.X
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 store the data you have already read to a "temp" location.

That way every time you open the file again, you can compare to see if there is any new data, copying only the new data.

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

Try this:

Dim textbox1 As New TextBox
textbox1.name = "TextBox1"
textbox1.bounds = New Rectangle(e.Location,New Size(100,100))
textbox1.location.x = myOtherTextBox.Location.x + 40
textbox1.location.y = myOtherTextBox.Location.y
Me.Controls.Add(textbox1)
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

Can you please post the code that is throwing the error?

Begginnerdev 256 Junior Poster

What error is being thrown?

Begginnerdev 256 Junior Poster

Can you please elaborate on the "missing" features? What features does it have and not have?

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

If you are deleteing the value from one table, you will have to also delete the value form the second table.

Begginnerdev 256 Junior Poster

I must be totally lost, but didn't you answer you own question with the code you provided?

Are you trying to link code to an external document?

If so, just make the sub public and import the document on the document you wish to have the Undo.

If not, you have already linked the code in the current document.

Begginnerdev 256 Junior Poster

Is there a control on the form that the scroll bars are bound to?

If not, are you expecting them to scroll the form's viewable area?

Begginnerdev 256 Junior Poster

If the charts are table driven you can query the database and then store the data into a data table.

Begginnerdev 256 Junior Poster

If the column is a varchar, just simply store the value as you wish.

If it is a numerical value, you can use decimal places to seperate the value.

Example:

40.6

Begginnerdev 256 Junior Poster

You will have to work with the NET library.

There is another post on the same subject Here

Begginnerdev 256 Junior Poster

You will have to read/write from a stream.

If you use the File.IO methods, you are holding that file until the application exits.

I know you might not have to worry about it from the regulars, but the anons might take advantage of the private information.

You might want to remove that information from your code snippet.

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...