I have a small application which has a MS Access as backend, and the front end is developed using VB.Net 2008. When I click on the listview item and then click delete button to delete a particula list and its content on the database, it is giving me the error as "No value given for one or more required parameters". My access database have a Primary key as the first character of the firstname combined with the first 2 characters of the lastname. It does not have a Anutonumber fiels. My code for the delete button is as follows: the code was working fine on a MS Access that has a Primary Key as the AutoNumber being generated.
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click If lvData.SelectedIndices.Count <= 0 Then
i want to delete an item on a listview, this is my code
If ListView1.SelectedItems.Count > 0 AndAlso MessageBox.Show("Do you want to delete this item?", "Confirm", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then 'make sure there is a selected item to delete ListView1.SelectedItems(0).Remove() End If
now my problem is i want to delete that item on the text file line
I'm making a function that is supposed to delete a line from a textfile "test.txt". I'm having no problems with finding what line i want to delete. The basic idea is this: read the whole file with streamreaderdelete the linerewrite the file with streamwriter. My problem is the last, how can i completely remove the file content, and write another string in it, writer.writeline just appends a line.
I have a program that reads a text file tab delimted using OLEDb I need to be able to allow the user to insert a user created record into the file which I can do. The problem is I need to be able to let the user edit that record. From my understanding you can not edit or delete with OLEDB only insert So I thought I would read the file using stream reader, find the line I want to edit and just delete it, rewrite the file, then let the user insert a new record?
Dim strDelimiter As String = vbTab OpenFileDialog1.InitialDirectory = "C:\" OpenFileDialog1.Filter = "Text Files (*.txt)|*.txt"
I have a 4 listboxes, all 4 listboxes will be populated after I clicked the cmd_button. I need to have the items on all 4 listboxes written to a text (or preferably rtf file if possible)
Prog appends a textfile. Don't want user able to delete or modify while form open. How do I do this?? - As long as form is open user cannot modify or delete textfile. But so the file can be edited from within form
How do I do this. Here is my code so far
Public Class Form1 Dim FILE_NAME As String = "C:UsersBirthdayDocumentsinfo.txt" Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
i made a media player program and i am having many problems! the main issue is that i have a listview that displays music playlist, how can i get it to navigate to the next item after the clicked one is over that way users don't have to click on the next one to continue their playlist?
How can I save ALL of the items in a listview, items that were added by the user? I tried application Settings and tried creating a settings file but there is not a settings option for listview items.
Im trying to print out all the items/sub items of a listview into one string.
here is the code i have:
For Each lvwItem In ListView1.Items ' Print the subitems of this particular ListViewItem For Each lvwSubItem In lvwItem.SubItems
[Code]....
How do i just print out the value (MyItem1) without the "ListViewSubItem: {}" part? I know i can use a string function to remove this, but id rather not
I have the code below and when I try to populate the listview it populates all of the listview items but only the first subitem. No clue what I've got wrong.[code...]
I am trying to create a textfile and write some lines into the textfile. However, the code that i am using can only write when the textfile is already created in the directory.
For this case, can i actually allow my script to search if a textfile is being created, if not create a textfile ???
Dim pathdir As String = "C:workingdir est.txt" If System.IO.File.Exists(pathdir) = True Then Dim objWriter As New StreamWriter(pathdir)
I have a datagridview i use to load alot of klients into a combobox. The values of the datagridview is a connection to a MySQL db.
What it's suppose to do, is to: When clicking the combobox, it should make a list from the datagridview, getting all the names from the klients.
My problem is that it gets dublicated, and will use to much memory at a moment.
I've tryed to check if the item it was about to add allready existed in the datagridview, if it was, it shoudn't add it again, however my code failed, and I'm having huge CPU and RAM useage when running this problem for more than 30mins.
My code:
Private Sub loadCustomers() SQL = "SELECT * FROM kunder;" Try
[Code].....
The code above is only checking for dublicated in the combobox, And I want the code to also check for dublicated items in the datagridview.
Or a way to clear the datagridview right after the items are inserted into the combobox?
How is it possible to delete all the items from a ListBox that have the same extension? This is in particular to video files that have have extensions of .mpg, .modd and .moff. I can populate the ListBox with just the .mpg files but I would like to know how I can remove the other file types should I put the whole lot in.Also, presumably using similar coding, it it posssible to highlight all lines with a particular extension?
I am coding a simple database that uses a .txt file as a way to store infomation (It is required to use an external file and .txt was the first one that comes to mind), my question was. Is there a way to click on data in a list box and then delete it from both the listbox and the .txt file?