Deleting Coresponding Row(s)?

May 9, 2009

Casting Table has MovieID , and ActorIDActor Table has ActorIDThis code deletes a row from the movies table(using a datagrid in vb.net), I need all the rows in the Casting table with the same MovieID to also be deleted.

Dim result As String
Dim i As Integer
i = MovieDataGridView.CurrentRow.Index

[code].....

View 2 Replies


ADVERTISEMENT

Deleting A Message From A Ftp?

Aug 26, 2011

I have a ftp chat of sorts and I want to make it so users can delete their own messages (Its all basically run off a .txt in the ftp). I just need a little help cause I don't know how to delete the off of a ftp. I

View 2 Replies

Deleting A Registry Value?

Apr 20, 2011

I have this code which should make my application start on startup or stop it from starting on startup depending on whether a checkbox is checked or not:

If MnuItemAutoStart.Checked = True Then
My.Settings.Startup = True
'This code all works fine, it creates the registry key like clockwork
Dim oReg As RegistryKey = Registry.LocalMachine

[code]....

I have tried running the program as administrator, using a different registry value, turning off all of my antivirus & firewalls and loads of other stuff. The strange thing is that I can delete the registry key in regedit, or any other program, it's just my program won't do it. It works on another program with exactly the same code (same startup code, different program).

View 3 Replies

Deleting From Datagridview?

Oct 9, 2009

I have a datagridview control that displays a list of expenses. I would like to code a button that will delete the record from the DGV and the DB table. Then I would like it to update so the DGV still shows up the updated DGV

View 3 Replies

Deleting Nodes From Xml?

Mar 13, 2012

i am trying to delete a node based on the userName input:This is the set up of my xml File:

[Code]...

View 6 Replies

Deleting Picture That Is In Use?

Jan 30, 2011

I created a time clock program for a friends business and I added a place for them to use pictures for the employee. It uses the employee number to grab the photos from a folder and displays it (ex. employee #1 would like for 1.jpg). I want to let them change the picture without going to that folder, delete the old one, copy the new one and then rename it. I also let it have a default photo (theres 2, one for females and one for males, which are matched by there gender) just in case they haven't had a photo added yet. My trouble is, if I try to update the photo and delete the old photo, I get an error saying its in use by another process. My code goes like this, check to see if the employee has a photo, if it does, it will delete that photo (this is where I get the error), copy the new photo (already selected in previous code) and then sets the photo. how to release the photo from the project before I delete?

View 4 Replies

Deleting Records In Sql?

Jun 6, 2011

I have created a form called new users, I have added my data source, draged over the objects I want from the dataset onto the form and all is well appart from the fact that I cant delete records.

To add them I simply click the add button, put in my info and then click the little disk button to update the dataset.This does not work for the delete button though, instead I get the following error

UPDATE REQUIRES A VALID DELETE COMMAND WHEN PASSED DATA ROW COLLECTION WITH DELETED ROWS.

[Code]...

View 2 Replies

Deleting Registry Key?

Feb 9, 2009

I have been looking for ages trying to find a way to delete a registry key in vb.net - This works: My.Computer.Registry.LocalMachine.DeleteSubKey

But my problem is that the key I want to delete has a different name on every computer. I.E. "KL Deployment Wrapper5444789417547544987"

I have played arround with: My.Computer.Registry.LocalMachine.GetSubKeyNames.Find

View 1 Replies

Error While Deleting A Row?

Jul 19, 2011

I am having problem deleting my data on click event. Here is my

Dim inc As Integer
Dim cs As New SqlConnection("Data Source=ConnectSQLEXPRESS;Initial Catalog=ForumCrawl;Integrated Security=True")

[Code].....

View 20 Replies

.net - Deleting Data From A File

Jun 17, 2011

I need to delete some rows from csv file based on a column value. Here is my sample.csv file [code]In my vb.net winforom application, I have to read this file and need to delete the rows related to 06/06/10 date column values then write the remaining rows into new.csv file. So far my program works on reading whole data present in the file.[code]

View 2 Replies

.net - Deleting File If Not Just Created (or Being Used)?

Apr 20, 2012

i am creating a console app that will delete pictures from a directory every 30 minutes. Problem is that its being populated by files every minute or so. So if i go and delete files in that directory then it may cause an error trying to delete a file thats being created just then or opened.

I currently have this code to copy the files to another directory and then delete them from the source directory.Dim f() As String = Directory.GetFiles(sourceDir)

[Code]...

View 2 Replies

ASP.NET - Deleting Computer Accounts Within AD?

Apr 27, 2012

I'm building out a decommissioning application that will allow an individual to provide an computer name and the utility will go out and purge the computer record from various locations. I'm running into a problem when attempting to delete a computer account from Active Directory. I'm impersonating a service account that only has rights to "Delete All Child Objects" within a particular OU structure. The code below works if I run it with my domain admin account; however fails with an "Access Denied" when I run it with the impersonated service account. I have verified that the permissions are correct within AD as I can launch Active Directory Users and Computers using a "runas" and providing the service account credentials and I can delete computer objects perfectly fine.

Wondering if anyone has run into this before or has a different way to code this while still utilizing my current OU permissions. My gut tells me the "DeleteTree" method is doing more then just deleting the object.

Sub Main()
Dim strAsset As String = "computer9002"
Dim strADUsername As String = "serviceaccount@domain.com"

[Code]....

View 2 Replies

Avoid Deleting When None Selected

Sep 2, 2011

My [code]...

But how i avoid when you selected nothing, you can delete.

View 2 Replies

C# - Deleting Files In A Directory?

Feb 12, 2011

I have seen questions like What is the best way to empty a directory?

But i need to know,

what is the fastest way of deleting all the files found within the directory, except any .zip files found.

Smells like linq here... or what?

UPDATE: By saying fastest way, i mean the Fastest execution time.

View 3 Replies

C# - Folder Deleting Not Working?

Apr 5, 2012

If System.IO.Directory.Exists(HttpContext.Current.Server.MapPath("images/TravelogueGallery/" & getMaxID())) Then
System.IO.Directory.Delete(HttpContext.Current.Server.MapPath("images/TravelogueGallery/" & getMaxID()), True)
End If

I am using the above code snippet to delete a directory but I get this error:

'G:ProjectsLatestLTCIndia 05-04-12 1415imagesTravelogueGallery19' is not a valid virtual path.

UPDATE: I have updated the question with the correct answer. The above code snippet works just fine.

View 1 Replies

C# :: While Deleting A File Getting Error?

May 10, 2011

at System.IO.__Error.WinIOError(Int32errorCode, String maybeFullPath) at
System.IO.File.Delete(String path)
at

[code]....

View 2 Replies

Code Still Works Even After Deleting It?

Aug 15, 2011

I don't think the problem lies within the codes but..The last thing I did was use datediff.. and show the result on a label.. and when I wasn't satisfied with the result I changed a few lines, and I noticed it was still the same whenever I run it.I've tried changing/deleting the codes to my forms but whenever I run the program, it still works. I even tried deleting the form and it still works.

View 5 Replies

DataGrid Confirmation Before Deleting?

Nov 19, 2011

I have a datagridview named dgvInventory. Okay when you have data inside your datagridview all you have to do is push the delete button on your keyboard and it automatically deletes the record. However, I want a popup box that says "Are you sure you want to delete this record?", and if yes is clicked then the item will be deleted, if not then the record stays the same.

View 1 Replies

DataGridView - Deleting A Record

Sep 26, 2009

I have a form with a DataGridView binding to an Access database. Everything works fine and it populates perfectly. Except when I delete a record. I get the following. I found a few threads about the issue but I cannot resolve the issue. Can some one give me a step by step to resolve this. [Code]

View 4 Replies

DataGridView Editing & Deleting?

Nov 2, 2009

i am working on datagridview vb.net 2005 i am trying to modify the data with datagridview control the problem is the data is virtually modified in datagridview but no Change happened in my sql server 2005 database

View 6 Replies

DataGridView User Deleting Row

May 29, 2011

I have a DataGridView in my Form. I am adding a handler as follows:

Private Sub DataGridView1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.SelectionChanged
If Me.DataGridView1.SelectedRows.Count > 0 Then

[Code]...

View 5 Replies

Deleting .TXT File In TextBox1?

Dec 31, 2009

i've tried to make it so Button5 Deletes what TextBox1 says I know its

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
If File.Exists("FILE.TXT") Then
File.Delete("FILE.TXT")

[code]....

But I want it to find and delete what TextBox1 Says.

View 6 Replies

Deleting A Created File

Apr 7, 2010

I have an aspx page in VB that fills a pdf with data from a web form.I'm using iTextSharp for this and I have no problem with this.This is the second time I've created anything for pdf's and I'm using the code from the first script.The first script wrote the filled in pdf to a directory on the server where one person could access those via another aspx page. I wrote that code probably a year ago.Now, instead of having the filled in pdf sit on the sever, I have to email it, which I was successful at doing.The only issue left is to delete the filled in pdf from the directory.I tried to use file.delete(), but I got an error stating the the file was being used by another process.how to stop the process in order to be able to delete the file.[code]

View 3 Replies

Deleting A Record Using Sql Server?

Jun 6, 2011

i'm having a problem regarding sql deleteCommand..

here's my code
Private Sub btnDeleteBC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeleteBC.Click
If MessageBox.Show("Do you really want to Delete this Record?", _

[Code].....

View 8 Replies

Deleting A Registry String Value?

Jun 30, 2009

I need to delete a registry string value.The registry string value that I'm trying to delete is:

HKEY_LOCAL_MACHINESoftwareMicrosoftMSDN SetupDefaultSet

I've tried googling for results, but none of the sample scrips I have located have done the trick.They all seem to throw a bunch of errors in Visual Basic 2008 Express Edition.

View 9 Replies

Deleting A Row From An Access Database?

Jul 16, 2009

when i had 3 text box then i did the following code and it worked for me also:

Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Dim con As OleDbConnection

[code]....

in the above code ,depending on the textbox3.text,i performed all the deletion,so it was easy now i have got a three of combo box and three text box....... i filled the combo box with the database entries.....now i want to perform deletion depending upon the selected items of any one of the three combo box........i cant get the logic of the where portion in the delete syntax.....

View 4 Replies

Deleting A Shortcut Via VBScript?

Jun 2, 2009

I have a process by which I push icons to distant Vista based PCs on our domain...it's all automated. One of these itemsis a shortcut (call it MYLINK.LNK) which I put in the user's Start Menu. That shortcut calls a .WSF script that, in turn, runs a JScriptfollowed by a VBScript.The JScript installs a commercial product and the VBScript is used to clean up after itself. One of those 'clean up' jobs is to delete the icon that kicked off this entire thing.

So I have :
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C: empstartload.wsf")

[code]....

View 3 Replies

Deleting A Single Row From A Gridview?

Mar 15, 2012

i am having problem in deleting a single row from a gridview. i am using binding navigaator to delete the row. i have customer table and booking table. Cust_id is used as foreign key in booking table. when i try to delete a single row from booking table it delete all the bookings related to that customer in the gridview.It also deletes the related customer aswell. i just want to delete one booking of that customer

Me.Validate()
Me.CustomerBindingSource.EndEdit()
Me.CustomerTableAdapter.Update(NewBookingDataSet.Customer)
Me.BookingBindingSource.EndEdit()
Me.BookingTableAdapter.Update(NewBookingDataSet.Booking)

View 12 Replies

Deleting ALL Files Within A Folder

Jul 3, 2010

vb 2008 on Vista: I have a folder called "Documents", and another called "PastDocuments". When the user deletes a client, I copy the contents of Documents into the Past Documents folder. Next, I need to delete the Documents folder, but there are existing files within that folder, so it won't let me delete it. What is the easiest way to delete ALL files within that folder?

View 1 Replies

Deleting An Item From An Array?

Dec 2, 2008

This is what I currently have but it's not deleting the items, just showing a message

Code:
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnDelete.Click
Dim strTitle As String = ""

[code]....

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved