What I want is that when i select the data from the listview1 it will also delete the corresponding data in the database im using mysql database...these is my code
Dim Button = MessageBox.Show _
("Are you sure you want to delete this Data?", _
"Message", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1)
[Code].....
so far that is my code..it work but in order to delete the data from database i use the datagridview does not what i want ,what I want is that when i select the item in the listview the corresponding data in the listview it will also delete in database... that code i post is that u need to select the data in listview1 and also select the data from the datagridview in order to delete the data in database..
If MsgBox("You sure?", MsgBoxStyle.YesNo, "Wait..") = MsgBoxResult.No Then : Exit Sub : End If rs = New ADODB.Recordset rs.Open("select * from Rami where Name like '" & Me.Text & "'", cn, 2, 3) rs.Delete() DisplayList()
I get that error when I try to delete:Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
I am using Visual Basic 2008.I Have a lilstview with items from an MS Access database loading in to it. I can update, insert and delete all from the database and the listview is updated accordingly. However, I cannnot for the life of me get it to remove a row from the database based on the selected index of the listview!!!I suppose I could use a DataGridView but then I would need to add a datasource wouldn't I?
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 got a system which i want to insert, delete, update the data into my database and the data from database will be display using datagrid. The below is the coding for one of my button, delete.
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Try btnSearchEmpNo.Enabled = False[code].....
Now I wanna set when user click on this button to delete a employee (for example) then the datagrid that i have in my application will not show the data of the deleted employee but in the background, the employee haven't been deleted from database.The employee only will be deleted from database when the user click on SAVE button.I know this application have to use RowState but how?
My apologies I have posted this in the wrong catagory It should be in VB.net, my mistake)Hi guys I posted this question at the end of another topic I started but I think it will be over looked as the origional topic was solved of the dreamincode community You must all be getting sick of my quexstions by now haha I suppose you don't learn if you dont ask.
Anyway I have used the delete sql method to delete data from a database, I want to refresh the data in the form after the record has been deleted. Do I have to close the form and then open an new instance of it? or is there another way I can refresh the data?
I've tried the following code but it doesn't delete and no error message received.
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim Station As String = "" For Each sItem As ListViewItem In lvList.SelectedItems
in my form..there's a couple of textboxes..these textboxes display data from the database using databinding method...my problem is when i click on my delete button to delete the data displayed in those textboxes...the data will be gone from the textboxes...but when i check my database..the data is still there.....how do i solve the delete button problme???...i want the data to be delete from the textboxes AS WELL AS from the database.
here's my delete button code
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim intresult As Integer Try
I have a Form1 that is the main application form, that display certain data from a database. Then I have Form2 that add/delete data from a specific table in the database.My problem is, When I add data to the database, and save it, it work fine, But, it does not reflect on the main form, after I close Form2. Only when I exit the application, and open it again, it shows. Is there a setting or something I need to do to update/refresh the info added so I do not need to restart the application?
I am having trouble removing a row from a table of an access database. I'm trying to remove a row based on a date/time that has already passed. Here is the code I have. When I try to run it I get an error.[code]...
in my form..there's a couple of textboxes..these textboxes display data from the database using databinding method..
when i click on my delete button to delete the data displayed in those textboxes...the data will be gone from the textboxes...but when i check my database..the data is still there....what happen??..how do i delete the data from the textboxes..AS WELL AS from the database?
here's my delete button code
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim intresult As Integer
I am using vb2008 express to work an Access 2003 database. I want to use code to delete the table after I have used it and before I close the program. Is there any code to accomplishg this?
Most of the project I do, I use the datagridview to display the data from the database. What is the different between the datagridview and listview? If I want to display the data from the database, should I use the datagridview or the listview?
i'm have a payment form and a listview in this form. i'm adding about 3 item in the listview, so it has 3 row. but how can i insert the items in one of the column into database.
for example for listview id item netmount 123 Stock1 113.00
ive written a query to show data from my database in a listview (using more than or equal to in the query itself) the problem is it doesnt show all my data that is greater than what i have put in and it still shows some data however that is less than,
SELECT * FROM Room WHERE [Room Size] > = '" & Noofppl.Text & "' AND [Number of PC's] > = '" & noofpcs.Text & "'"
I have a ListView setup in details mode that looks like this: When the user presses the delete button, I need to go ahead and delete their record from the database. This I can do fine, but I'm stuck on how I retrieve the data that is highlighted in the ListView control. I've tried using Google but all the examples I found have failed to work.
I have a ListView control set up in details mode with 5 columns. It is populated by code using the following subroutine:
For j = 0 To 14 cmd = New OleDbCommand("SELECT TeacherName, ClassSubject, BookingDate, BookingPeriod FROM " & SchemaTable.Rows(i)!TABLE_NAME.ToString() & " WHERE (((BookingDate)=" & Chr(34) &
I have a Listview with 5 columns. It display data taken from 2 textbox, 1 combobox, 1 datetimepicker and auto generated number. I want to save all these data to a database. While trying with my code I was getting some errors. I add my whole project here . Below is my code -
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click For x As Integer = 0 To ListView1.Items.Count - 1 CMD.Connection = CN CMD.CommandText = "INSERT INTO SaveData (CatID, Item, SubItem, Date, Amount) " + _
if this question has already been answered many times, but I am new to VB and I don't really understand any of the examples I have found by trying to research this topic. I am using VB 2008 Express Edition. My List View is called listView.