Begginnerdev 256 Junior Poster

For active:

1) Capture each character typed and query the database for possible solutions.

For passive:

1) The user leaves the text box, check against the database by splitting spaces and storing in the array.

Example of active:

Dim s As String = ""


Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

    'cmd = Command '
    'da = Data adapter'
    'ds = Data set'
    'dt = Data table'

    s = TextBox1.Text

    Dim sqls As String = "SELECT * FROM table WHERE value='" & s & "'"

    cmd = New Command(sqls,con)
    da.SelectCommand = cmd
    da.Fill(ds,"table1")
    dt = ds.Tables("table1")

    If dt.Rows.Count > 0 Then
        return
    Else
        TextBox1.BackColor = Color.Salmon
    End If

End Sub

For the passive:

Dim ar() As String

 Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

    'cmd = Command '
    'da = Data adapter'
    'ds = Data set'
    'dt = Data table'

    ar() = TextBox1.Text.Split(" ")

    For i = 0 to ar.Count - 1

        Dim sqls As String = "SELECT * FROM table WHERE value='" & ar(i) & "'"

        cmd = New Command(sqls,con)
        da.SelectCommand = cmd
        da.Fill(ds,"table1")
        dt = ds.Tables("table1")

        If dt.Rows.Count = 0 Then

        'place your code here for letting the user know it's misspelled.'

    Next  

End Sub
Begginnerdev 256 Junior Poster

You will have to add them to your project.

Look in the toolbox when in design view, you will find PrintDocument under the printing tree.

or

Add it manually;

Imports System.Drawing.Printing
....
Dim pd As New PrintDocument
Begginnerdev 256 Junior Poster

What are you using for a data source? ADO?

Begginnerdev 256 Junior Poster

Here is a project on crystal reports. It is an older project but it is a good reference project.

Begginnerdev 256 Junior Poster

What you can do, is place all of the code that retreives the data for the gridview ( The select statement and data adapter ) into a custom function that you can call. That way, when you delete a row, the function will:

1) Clear the gridview
2) Fill the gridview

If you make the code modular, you will not have to worry about having to recode it everytime. You can just call the function/sub.

Begginnerdev 256 Junior Poster

After doing some looking around, I think you are going to have a slim to none chance of using Jmeter with ASP.NET

It seems that the viewstate of ASP.NET doesn't allow the Jmeter scripts to execute properly. You might want to look into another form of load testing your web application.

Begginnerdev 256 Junior Poster

Do you have a method to connect to the access database?

If not, you will have to:

1) Connect to the database (Use this for your connection string)
2) Create a new command (Use this for a simple guide on connecting to the database.)
3) Execute the command. (Use the string below to delete.)

Try something like this:

Dim sqls As String = "DELETE FROM table"
Begginnerdev 256 Junior Poster

You have posted the same question repeatedly about 3 times already.

Have you not received the answers you needed on the other posts?

Begginnerdev 256 Junior Poster

Are you wanting an active spell check? (One that checks as you type)

or

Are you wanting a passive spell check? (One that checks the word after you type it)

Begginnerdev 256 Junior Poster

I am assuming you mean ASP.NET?

From my undertanding JMetere deosn't support vb, because it is meant to test servers/scripts and any web based content.

Begginnerdev 256 Junior Poster

Here is a post on stackOverflow about something related. Maybe it would be a good starting point for you.

Begginnerdev 256 Junior Poster

For one thing, you can't see if you do have an error.

All of your catch's are empty.

Try placing:

MsgBox(ex.Message)

In all of them, it will give you a little bit of an explanation of what happens.

Are you allowing the user to select a range of products?

If not, then just add the item like

listItemsBough.Items.Add(listproduct.SelctedItem())
Begginnerdev 256 Junior Poster

You might want to look into some Windows message hooking. The only way to directly catch an error would be if the other application was part of yours. Here is an example in C#. Here is a code translator that will make the code easier for you to read if you have no C# experience.

Begginnerdev 256 Junior Poster

Do you have any generational specific formatting?

Example:

Any Excel 2003,2005,2007 formatting that is not compatible with your interopt?

Begginnerdev 256 Junior Poster

You will have to create a custom print method.

In this method you will have to loop through the datagridview and parse everything line by line.
You will have to pass each line as a String variable.

You can use this as a reference.

It is a tedious process. One you master it, you will be able to use it on any project with a gridview/listview.

Good luck, friend.

Begginnerdev 256 Junior Poster

Are you receiving any errors, or is the database just not getting updated?

Begginnerdev 256 Junior Poster

Have you checked your projects publish settings?

You can set publish settings by:

Open the Solution > Click "My Project" > Click the Publish Tab

Begginnerdev 256 Junior Poster

Are you appending the data that is in memory back out the file? If so you are just adding everything back in again.

Example:

If you are reading into table > add more to end > post back out = Post all data in table, including data that is already in the workbook.

You can compare line by line to the table to see if the data is already in the workbook, if so, don't add it and visa versa.

Begginnerdev 256 Junior Poster

KHEKHEKHE

Please do not spam the forum. If you do not have anything that is beneficial to the post, do not post. The objective is to keep threads and short and to the point as possible. Please do not clutter up threads with useless posts.

Thank you

Begginnerdev 256 Junior Poster

it is also a possibility that the file is being used by the other program.

Is the runtime error a "file in use" or "file is being used by another program" or something of that nature?

Begginnerdev 256 Junior Poster

Reading and writing from/to a text file is a VERY simple procces;

You need to define a stream reader/writer

Dim sr As New StreamReader("C:/Users/MyUser/Desktop/file.txt")

Do While sr.Peek <> -1
    Dim curLine as String = sr.ReadLine
    'curLine now holds an entire line from the text file, from crlf to crlf'
Loop

For writing to a text file you do the same thing, just opposite.

Dim sw As New StreamWriter("C:/Users/MyUser/Desktop/file.txt")

Dim S() As String = {"Line 1","Line 2","Line 3","Line 4"}

For i = 0 to S.count - 1
    sw.WriteLine(s(i)) 
    'This will loop through the array and print every element on it's own line.'
Next

Now with that being said, we can't see your code to find any errors. But as log as you have the basics down, you should be able to determine the root of the problem.

Begginnerdev 256 Junior Poster

You will want to do the reverse of what poojavb has posted.

Dim dr As Object    
If e.CloseReason = CloseReason.UserClosing Then       
    dr = MsgBox("Do you want to save the changes?", MsgBoxStyle.YesNo Or MsgBoxStyle.Question)       
    If dr = vbNo Then          
        Me.Dispose()          
        e.Cancel = False       
    Else          
        btnSave(sender,e)
        Me.Dispose()          
        e.Cancel = False  
    End If
End If

If the user pressed YES it would have just disposed.

Begginnerdev 256 Junior Poster

You can do as poojavb has stated, but if you are using this textbox for input in a database, you will have to be sure that the user can't submit the changes when the textbox is empty (contains default mask) or it will blow up.

Begginnerdev 256 Junior Poster

Possible duplicate of this?

Begginnerdev 256 Junior Poster

Are you wanting a data monitor for network activity and bandwidth?

Your question is a bit vague, and is not very legible.

Can you please give us a little bit more information...and possibly better typing?

If you can't convey your point in english you can always type into a translator and then post english output here.

Begginnerdev 256 Junior Poster

Something like this:

Dim sqls as String = "SELECT lastname, firstname, tag" & _
     "FROM drivers, vehicles " & _
     "WHERE drivers.location = vehicles.location"
Begginnerdev 256 Junior Poster

com.CommandText = " INSERT INTO Staff (Staff_Id,Staff_Name, Staff_IC,Staff_Ext,Staff_HP,Staff_Email,Staff_Position) VALUES ('" + txtId.Text + "','" + txtName.Text + "','" + txtIC.Text + "','" + txtExt.Text + "','" + txtHP.Text + "','" + txtEmail.Text + "','" + txtPosition.Text + "')"
com.CommandText = " INSERT INTO Login (Staff_Id, Staff_Username) VALUES ('" + txtId.Text + "','" + txtUsername.Text + "')"

You have two insert statements but do not execute the statement. You are just overwriting the first statement

I suggest you call com.executenonquery inbetween each statement

Begginnerdev 256 Junior Poster

Talk about bringing back dead threads...

You have less or to many columns in your insert.

If less on purpose, you will have to set the values to their columns.

Example:

Dim sqls As String = "INSERT INTO table (column1, column3, column4) VALUES ('val1','val2,'val3')
Begginnerdev 256 Junior Poster

For one thing, I never see you fill the data set with the data adapter.

Example:

da.Fill(ds,"tableName")
dimmslider commented: Thanks! So simple! +0
Begginnerdev 256 Junior Poster

This does something very close to what you want, try to use this as a reference.

    Dim j As Integer = CInt(TextBox1.Text)
    Dim numOfPasses As Integer = j

    Dim numbers() As String = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}


    For i = 0 To j
        Dim lineString As String = ""
        numOfPasses = i + 1
        While numOfPasses <> 0
            lineString &= numbers(numOfPasses)
            numOfPasses -= 1
        End While
        ListBox1.Items.Add(lineString)
    Next
kiyu2keith commented: thanks, it helped a lot +0
Begginnerdev 256 Junior Poster

Dim x As String = dsResult.Tables(0).Rows(0)(0).ToString()

 Dim x As String = dsResult.Tables(0).Rows(0).Item(0).ToString
Begginnerdev 256 Junior Poster

Np friend, anything else we can help you with?

Begginnerdev 256 Junior Poster

We encourage people to start their own threads, just as long as they close them when their question has been answered.

Begginnerdev 256 Junior Poster

Where is the NullReferenceException pointing to in the stack trace?

Begginnerdev 256 Junior Poster

You have SQL Server 2012 Express (Free from Microsoft's Website)

You have Oracle(Some free versions, haven't worked with.)

Begginnerdev 256 Junior Poster

That connection string should work for DB2 v7 and above

Begginnerdev 256 Junior Poster

The string you are looking for will look like this:

Dim str As String ="Provider=IBMDADB2;Database=myDataBase;Hostname=myServerAddress;Protocol=TCPIP; Port=50000;Uid=myUsername;Pwd=myPassword;"

This string, and others like it can be found here.

Begginnerdev 256 Junior Poster

Please don't hijack dead threads.

Please start a thread of your own.

Thank you.

Begginnerdev 256 Junior Poster

TCP/IP or APPC?

And are you using Microsoft's OleDB provider or IBM's??

Begginnerdev 256 Junior Poster

What database type is on the mainframe?
AS400?

Begginnerdev 256 Junior Poster

If I understand what you are wanting, you will want do something like this:

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    TextBox4.Text = subjectWords(Get_Random(0, subjectWords.Count - 1)) & " " & predicateWords(Get_Random(0, predicateWords.Count - 1)) & " " & _
    complementWords(Get_Random(0, complementWords.Count - 1)) & "."
End Sub

Public Function Get_Random(ByVal Low As Integer, ByVal High As Integer) As Integer
    Dim rand As Integer = Math.Floor((High - Low + 1) * Rnd() + Low)
    Return rand
End Function
Begginnerdev 256 Junior Poster

We are not here to answer homework, If you have code or any attempt....please post.

We can't just do your homework for you, or you would never learn anything.

Begginnerdev 256 Junior Poster

Do a string plit, storing the values in a array.

Only look for the value at the 1 index.

Example:

Dim infoString as String = "mister.john#gotodaniweb.com2"
Dim ar() as String = infoString.Split("#")

'ar(0) = mister.john'
'ar(1) = gotodaniweb.com2'
Begginnerdev 256 Junior Poster

I think what you are meaning to do is.

Dim sConnection As String = "Provider=SQLOLEDB;Data Source="XXXX.XXXXX.COM:5000;Initial Catalog=IBMDADB2;Integrated Security=SSPI"

Also, you might want to remove the user name and password from your string....This is a public forum, and is open to the unregistered public.

At bare minimum, you could have a co-worker see this,identify you, and possibly lead to your termination.

Begginnerdev 256 Junior Poster

Change the name of resources in one of the .resx file.

You will then have to change any references to the old name in the corrosponding source code.

Example.

My.Resources.Resources

to

My.Resources.ResFix

Begginnerdev 256 Junior Poster

Create a connection to the database, using this as a reference.

Connect to the database and create/execute a query, storing the values in a table:

Dim ConStr As String = "Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;"

Dim con As OleDBConnection(ConStr)

Dim cmd As OleDBCommand
Dim da As New OledbDataAdapter
Dim ds As New DataSet
Dim dt As New DataTable
Dim sqls As String = "SELECT aname,bname FROM table WHERE primary_key=value"

Try

    con.Open
    cmd = new OleDBCommand(sqls,con)
    da.SelectCommand = cmd
    da.Fill(ds,"nameTable")
    dt = ds.Tables("nameTable")


    If dt.Rows.Count < 1 Then
        'Table is empty, no names found'
    Else
        'Post names to multiline textboxes or listview.'
        'Listview is easier to use.'
    End If

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

You will have to post your code, but at a 3,000 ft. glance; you just need to have only one execute statement.

Begginnerdev 256 Junior Poster

You can use WPF to build a gui in Visual Studio

Begginnerdev 256 Junior Poster

Place a text box on the page (can be hidden) and store the textvalue into the text box/

Begginnerdev 256 Junior Poster

You can get SQL Server Express free from Microsoft's Website

You can get mySQL from Here