Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In rare cases (even with Microsoft apps), clicking OK may not APPLY your changes. To be safe I usually click APPLY then OK.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try

cmd.CommandText = "UPDATE PDC_CHQ_IN_HAND SET PDF = NULL " &
                  " WHERE RefNo = '" & TxtRefNo.Text & "'"

but if RefNo is defined as a numeric you should use

cmd.CommandText = "UPDATE PDC_CHQ_IN_HAND SET PDF = NULL " &
                  " WHERE RefNo = " & TxtRefNo.Text
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm running Visual Studio 2010 on Windows 7 Home Premium (all updates installed). I created a sample project named 'PerryTest' and copied ID3TagLibrary.dll to the source folder. I added the dll to the References. I added the following code

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    Dim mp3 As New ID3TagLibrary.MP3File("D:\My Music\Alice Cooper\Alice Cooper - Schools Out For Summer.mp3")
    Me.Close()

End Sub

then put a breakpoint at Me.Close(). With a Watch on mp3 I saw the expected properties with no errors or warnings.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Have you tried Perry's ID3 Tag Library. I used this quite a while back with no problems. It's open source and he also provides an ID3 viewer using the library.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In my experience when you do an upgrade install you end up with pieces of both systems scattered about higgledy-piggledy. You'll effectively get a mish mash of both with a lot of wasted disk space. My advice is to take a disk image of your current system then wipe it and do a fresh install of Windows 7. I don't know how your system is partitioned but my suggestion is roughly

70 meg C partition
remainder to D partition

Once you have a base Windows 7 system installed and configured with all Windows 7 updates applied, relocate the following folders from C to D

My Documents
My Music
My Pictures
My Videos
Downloads

Reinstall the disk imaging software (Macrium Reflect has an excellent free edition) and take an image of the C partition. Now install your "must have" applications (I would include cCleaner). When you have your system configured and updated, run cCleaner and take another image (this one will be temporary). The last step will be to do a disk "freeze". One of the many updates you will have installed will be service pack 1. You'll never want to uninstall this so by doing a "freeze" you will clean your system of the uninstall files. To do this, open a CMD shell as Administrator and type

C:
CD \
dir
DISM /online /Cleanup-Image /SpSuperseded
dir

This could take upwards of 30 minutes to run so don't panic. And if you DO panic, that's why you did …

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

No problem. Glad we were finally able to get on the same page. Feel free to post follow-up questions.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

That's easy enough to do

Private Sub btnSend_Click(sender As System.Object, e As System.EventArgs) Handles btnSend.Click

    ListBox2.Items.Clear()

    For Each item As String In ListBox1.Items
        If item.Contains(TextBox1.Text) Then
            ListBox2.Items.Add(item)
        End If
    Next

End Sub

That will copy all items containing the string in TextBox1 from ListBox1 to ListBox2. If you want an exact match then use

If item = TextBox1.Text Then

If you want a dynamic version (ListBox2 updates while you type) then see this thread

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Textbox1 is that before the button

I know that. You have it labelled in the picture. At the top you said

you write something in in textbox1

Now you are saying

if type there Hi in textbox 2 nothing will show

I think our first problem is the language barrier. Your English is much better than my Albanian (non-existent) so unless you can get help with explaining your problem I don't think I'll be able to offer any advice.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

you write something in in textbox1.

In your example you don't have anything in textbox1.

after press a button it seach if a word like that is on listbox 1. if that is true than it send a item from listbox2.

What item is it supposed to send from listbox2 and where is it supposed to send it? You have some items in both listboxes and nothing anywhere else. I still have no idea what you want to do.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

There is a manual method for creating a shortcut that will run with Admin access (bypassing the UAC prompt) here.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm not clear on what you are asking. Could you possibly post an example with sample data? Please post, as well, any code you've tried so far.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Mark Russinovich (Sysinternals) has an excellent (and free) utility called autoruns that is part of the (also free) Sysinternals suite. It will tell you everything that starts automatically and allows you to disable selectively.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The syntax for INSERT is

INSERT INTO tablename (fld1, fld2, ...)
       VALUES(val1, val2, ...)

where you specify the field names by fld1, fld2, etc. and the values by val1, val2, etc.

For a complete example of how to use parameterized queries please see Code Snippets.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Here's a little trick. Name your controls so that you can calculate the name from the keyword. For example

DATE:            txtDATE
LOCATION NO:     txtLOCA
SHOW ID:         txtSHOW
INQUIRY NO:      txtINQU
USER:            txtUSER

Then you can dynamically reference the control in the loop by Me.Controls(ctrlName)

For Each key In keywords
    Dim line() As String = Filter(lines, key)
    Dim tag As String = line(0).Substring(InStr(line(0), key) + key.Length - 1)
    Dim endtag As Integer = Math.Max(InStr(tag, " "), tag.Length)
    tag = tag.Substring(0, endtag)
    Dim tbx As TextBox = Me.Controls("txt" & key.Substring(0, 4))
    tbx.Text = tag
Next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I prefer to avoid using StreamReader unless the input file is exceedingly large. You are scanning for a series of keywords so I suggest you loop through the keywords rather than looping through the lines of text. You could do something like

Dim lines() As String = System.IO.File.ReadAllLines("D:\temp\test.txt")
Dim keywords() As String = {"DATE: ", "LOCATION NO: ", "SHOW ID: "}

For Each key In keywords
    Dim line() As String = Filter(lines, key)
    'extract tag
Next

Filter returns all lines containing the given string. To extract the tag (data) portion you first extract everything following the keyword (notice that I included the trailing blank in each keyword). Then you have to throw away everything following the data. The end of the data is marked by either the end of the line or a blank. You can do the first extraction by

Dim tag As String = line(0).Substring(InStr(line(0), key) + key.Length - 1)

You can find the end of the tag by taking the highest value of location of first blank or end of string as

Dim endtag As Integer = Math.Max(InStr(tag, " "), tag.Length)

and to extract the complete tag you can do

tag = tag.Substring(0, endtag)

so all together it is

Dim lines() As String = System.IO.File.ReadAllLines("D:\temp\test.txt")
Dim keywords() As String = {"DATE: ", "LOCATION NO: ", "SHOW ID: "}

For Each key In keywords
    Dim line() As String = Filter(lines, key)
    Dim tag As String = line(0).Substring(InStr(line(0), key) + …
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You are going to have a problem with

If cmbProcess.SelectedIndex = "0" Then

because cmbProcess.SelectedIndex is numeric and you are comparing it to a string. Try

If cmbProcess.SelectedIndex = 0 Then
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Assuming that proQuantity is numeric, try

cmdUpdate.CommandText = "UPDATE tblProducts SET proQuantity=" & txtTotalqty.Text & " WHERE pID =" & cmbID.Text & ";"
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can't concatenate an array. To see how to insert binary data you can look at this code snippet. The example uses a PDF.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I use CutePDF Writer. It's a free virtual printer. Print any file to CutePDF and the output is a PDF.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

But

select * from Test_Table where date like '2015%'

does not, at least if stored as a date. Actually it should be

select * from Test_Table where [date] like '2015%'
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm also using MS SQL 2012 and using LIKE with dates returns nothing. It works with numerics, but not with dates.

 select @@VERSION
 Microsoft SQL Server 2012 - 11.0.2100.60 (X64) 
Feb 10 2012 19:39:15 
Copyright (c) Microsoft Corporation
Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try adding

";Connection Timeout=60"

to the end of your connection string.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I just ran that query as a test against an MS SQL database and it returned the desired results. What database engine are you using?

My exact query was (using sample NorthWind DB)

SELECT * FROM Orders
 WHERE DATEPART(YY,OrderDate) = 1997
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can't use LIKE on numeric values. You can use DATEPART to extract the year portion. Your query string should be

qry = "SELECT * FROM test_table" &
      " WHERE DATEPART(YY,myColumn) = " & myDate
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

For what it's worth, GOTOs are evil. Before the advent of structured programming constructs like IF-THEN-ELSE, GOTOs were a necessary evil, but used properly they could be tolerated. I, myself, have (on rare occasions) used GOTOs to escape from nested constructs, but I have never had to resort to that since the introduction of TRY-CATCH. I strongly suggest that you rewrite your code to eliminate your GOTOs.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What does your output look like with the above code?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could clear the textboxes whenever you do a insert or delete. This is unrelated to the question but you might simplify the query as

query = "SELECT StudentNo,Fullname,Year,Term,Class " &
        "  FROM StudentRegistration  " &
        " WHERE StudentNo = '" & TxtStudentNo.Text & "'" &
        "   AND class IN ('Senior 5A', 'Senior 5S', 'Senior 6A', 'Senior1 6S')"
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Sorry about that. My previous post had a typo. Try

For Each row As DataRow In dt.Rows

    Dim line As String = ""

    For Each column As DataColumn In dt.Columns
        'Add the Data rows.
        line += "|" & row(column.ColumnName).ToString()
    Next

    'Add new line
    txt += line.SubString(1) & vbCrLf

Next

If File.Exists(fileloc) Then
    Using sw As StreamWriter = New StreamWriter(fileloc)
        sw.WriteLine(txt)
    End Using
End If
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try

If radResidential.Checked Then
    totalDue = 4.5 + 30 + 5 * premiumChannels
Else 
    totalDue = 16.50 + 80 + 4 * Math.Max(premiumChannels - 10, 0)
End If

Math.Max returns the maximum of the two values. If the number of channels is 10 or fewer it return 0, otherwise it returns the number of channels over 10.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could do

For Each row As DataRow In dt.Rows

    Dim line As String = ""

    For Each column As DataColumn In dt.Columns
        'Add the Data rows.
        line += "|" & row(column.ColumnName).ToString()
    Next

    'Add new line
    txt += line.SubString(1)  vbCr

Next

If File.Exists(fileloc) Then
    Using sw As StreamWriter = New StreamWriter(fileloc)
        sw.WriteLine(txt)
    End Using
End If

That way each new line is built as "|a|b|c". The SubString chops off the leading "|" before it is added to the output buffer. You might want to use StringBuilder instead of String. It's much faster when building strings usinc concatenation.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What have you tried so far?

Sequeira commented: please check the below comment.. im sorry im new in diz group... +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

How about

For Each line As String In lines
    if not line.StartsWith("#") then
        Dim columns() As String = line.Split(" ")
        Dim index = Me.DataGridView1.Rows.Add()
        Me.DataGridView1.Rows(index).SetValues(columns)
    end if
Next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

No suggestions on that I'm afraid. That's why I generally export my bookmarks weekly.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What kind of backup? If it was an image backup like Macrium Reflect or Acronis you should be able to recover the entire profile folder without having to restore the entire image.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could restore it from your most recent backup. You do do backups, right?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Does the associated cell have a value in it? If the data is originally from a database you may have to convert nulls to some default value. In MS SQL you can use the COALESCE function. If the null values are because a textbox field is empty then you'll have to ensure that all fields contain values.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    DataGridView1.Rows.Add({"1", "Pizza", "$20.00"})
    DataGridView1.Rows.Add({"2", "Bun", "$1.00"})
    DataGridView1.Rows.Add({"3", "Burger", "$3.00"})
    DataGridView1.Rows.Add({"4", "Fries", "$2.00"})
    DataGridView1.Rows.Add({"5", "Chicken", "$2.50"})

End Sub

Private Sub DataGridView1_CellClick(sender As System.Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick

    txtNumber.Text = DataGridView1.Rows(e.RowIndex).Cells(0).Value
    txtName.Text = DataGridView1.Rows(e.RowIndex).Cells(1).Value
    txtPrice.Text = DataGridView1.Rows(e.RowIndex).Cells(2).Value

End Sub

I have set DataGridView1 with the following properties

DataGridView1.AllowUserToAddRows = False
DataGridView1.AllowUserToDeleteRows = False
DataGridView1.AllowUserToOrderColumns = True
DataGridView1.AllowUserToResizeRows = False
DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect

Clicking any cell will cause the entire row to be selected and to copy the corresponding cell values to the text boxes for editing.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Im busy I can help you on skype, can send and code if is needed.

If you supply a solution via Skype then it doesn't help anyone else here. If you do this then please post the solution.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What line is giving the error?

You should use a DataReader. Try

Dim query As String

qry = "SELECT Description, Price " &
      "  FROM tblProducts " &
      " WHERE pID = ?"

Dim cmd As New OleDb.OleDbCommand(query, myConnToAccess)    
cmd.Parameters.AddWithValue("@parm", cmbID.Text)
Dim rdr As OleDbDataReader = cmd.ExecuteReader()

If rdr.Read Then
    txtDescription.Text = rdr.GetString(0)
    txtPrice.Text = rdr.GetString(1)
End If

rdr.Close()
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

@altgen - When images are essential to the post, please upload the images to Daniweb and include them in your post. That ensures that the images will be available for as long as the post exists. Once the images are deleted from the external server your post becomes useless to anyone else.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If anyone is interested, the creator of Duck Duck Go was interviewed here

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I once had a friend who was creeped out by anyone touching their eyeball. Unfortunately he also has a friend with a glass eye who would occasionally tap it with a pencil just to freak him out.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Perhaps that last sentence was too much information ;-P

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I seem to recall that one of the criteria for Lasix is that your presciption is stable for (I think) two years. The lasers they use now are much more precise than what they used on me. Basically, each "zap" burns a small pit from your cornea. As you can imagine, using a finer laser results in more, but finer, pits. Sort of like using a camera with more megapixels.

There are few experiences like being able to smell your own eyeball burning.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Depending on your age, you might want to consider Lasix (laser eye surgery). I had it done in 2000 and it was one of the best decisions I ever made. I had worn glasses since grade four any my vision was 20/200+ in both eyes. I did, however, have to get reading glasses when I turned 55 (ish) due to normal aging of the cornea. My older son had even worse vision (coke bottle glasses) and he had his eyes done in 2010. He has been glasses-free since then.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Q: What do you call a cow with no legs?
A: Ground beef

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try

SELECT * FROM [BANK ACCOUNT] ORDER BY [ACCOUNT NAME]

but if possible you should rename the columns by replacing the spaces with underscores.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Q: How many NRA spokesmen does it take to screw in a light bulb?
A: More guns.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

This is a query

SELECT * FROM tblbooks WHERE author LIKE 'Smi%'

This is not a query

adobooksearch.Refresh

If you want help debugging the query then post your query.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What you posted was the code that generates the query. What I want to see is the query that is causing the error.