Delete A Record By Searching That Record In Two Tables?

Jun 6, 2011

i have one textbox ,this textbox contains a number ,i want to delete a record by searching that number in two tables Table1 and Table2,the record may present in Table1 or Table2 ,so it should check both the Tables ,if it is found in table1 it should delete or else from table 2 it should delete.

View 3 Replies


ADVERTISEMENT

Sql - Delete The Contents Of A Related Record From Two Tables?

Dec 11, 2011

The StudentDetails.Students is the master table which forms a relationship with RegistrationDetails.Registration. Therefore, StudentID is the primary key in the former whereas it is a foreign key in the latter.Now I've tried each of the following codes but each of the first two gives an error message "Incorrect syntax near 'a'" and in the case of the third one DbTransaction as in "Dim trans As DbTransaction" is also not a valid type. I'm using SQL Server 2008 Professional Edition.

cmd = New SqlCommand("DELETE FROM StudentDetails.Students a, RegistrationDetails.Registration b WHERE (b.StudentId=a.StudentId) AND a.StudentId='" & txtStudentID.Text & "'", cn)

[code]....

View 4 Replies

Delete Contents Of A Related Record From Two Tables( Using SQLTransaction)?

Dec 15, 2011

I'm getting "Format of the initialization string does not conform to specification starting at index 0" error having used the following code. The commands are supposed to delete a related record from two tables namely StudentDetails.Students as the master table and RegistrationDetails.Registration as the child table. [code]...

View 1 Replies

Save Data In Table First Delete Record Then Insert Record

Dec 3, 2011

I use This Code To Save Data in Table First I delete record Then Insert record

View 4 Replies

Delete A Record From A Dat File By Selecting The Record From A List Box?

Feb 9, 2011

Basically, I am making a booking system. On one of the forms, you can: Add, Edit and Delete a record by using the selected index. I can do the Add and Edit part fine but some problems are occuring when I try to delete it. What I'm trying to do when deleting is, copy all the records except the selected one and then copy it back into the original file again.

[Code]...

View 1 Replies

Unable To Delete Row Record From SQL SERVER Record?

Mar 26, 2011

when i try to delete a row . always restricting to delete on certain Table table.( DELETE ERROR tble_tombstone) message comes up.

View 8 Replies

Retrieve The Record And Display The Record In A Listbox Displaying The Time Field As The Text For That Record?

Apr 18, 2009

I hav a web service which pull records from a database and I am hosting these services in IIS which works fine but I am trying to retrieve the record and display the record in a listbox displaying the time field as the text for that record.I have created the following function

public sub get_data()
dim dt as new data.dataTable
dim service as ws webservice.webservice

[code]...

View 1 Replies

Quering Record - Check A Record In Database Before Inserting A New Record

Aug 9, 2010

I am trying to check a record in database before inerting a new record here is my code but problem is when i enter a names first alphabet it imediatly populate massage. i want to check it after entering whole name

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Try
Dim cnString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &

[CODE]...

View 2 Replies

Searching A Record In A Database Using .net?

May 1, 2009

i am using visual basic 2008 with vb.net as language. i have created an application in which i am using oracle 9i sql database. the table is admissioninfo in which the columns are rollno,feespaid,dept,sem,sec. i want to know how i can search a record i.e, rollno from the database through my program and the program will show feespaid,dept,sem,sec in the textboxes.

View 1 Replies

Searching For A Record In Database?

Dec 29, 2009

I have two text boxes and want the users to be albe to serach through Access Database for a first or last name.but my search button is not working

Imports System.Data
Imports System.Data.OleDb
Private Sub frmEmployees_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles

[code].....

View 7 Replies

Asp.net - Search A Record From Sql Database Searching By First Name?

Sep 8, 2009

i want to search a record from sql database searching by first name so im using a function in the data layer but it is not working

Public Function searchCustomer(ByVal custFname As String) As DataTable
Dim tabletdata As New DataTable
Dim conn As New SqlConnection(con_string)

[code]....

View 1 Replies

Code To Update A Record After Searching ?

Aug 16, 2010

I am using this code to update a record after searching but it gives me error

here is my code

CODE:

View 3 Replies

Searching Database To Find Record

Feb 3, 2011

I am trying to search a database to find a record. Here is my code.
Private Sub mnuFind_Click()
Dim strQuote As String
Dim strCriteria As String
Dim strText As String
txtWidth.Enabled = False
txtLength.Enabled = False
[Code] .....

The problem that I am having is when I run the code it returns nothing. I have even put in bad data and I don't even get a message Data not found.

View 4 Replies

Searching For A Record From An Access Database?

Jun 11, 2011

Am working on a movie rental system in VB.NET, but there's a problem. I want a situation whereby the user will have the privilege to search for desired records by typing a search string, then hitting the search button. The results should be shown on a datagridview. Here's my code:

Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Dim MovieName As String

[Code].....

View 2 Replies

Searching The Database Record Using LINQ

Aug 3, 2010

How can search record in my DataSet (fields: Name, Address, Phone#) for a certain name, given by user by clicking a combo box?

View 3 Replies

Confirmation Delete Window - Deleting Record When Click Delete Or Cancel?

Jan 5, 2012

I have a javascript file that contains the function for calling the confirmation delete window, the code used is similar to the following:

function Delete()
{
confirm('Delete this user');

[code].....

View 3 Replies

Delete Row In Datagrid By Selecting Record Selector And Hitting Delete?

May 13, 2011

I'd like to create code for my datagrid view to be able to delete a row by first clicking the record selector column then pressing delete. Seems like some standard stuff but really difficult to create in VB 2005.

View 10 Replies

Force Users To Save Current Record (If Current Record Has Changed) Before Going To Next Record

May 17, 2010

How do I force users to save the current record (if current record has changed) and not let user go to the next record unless the save button is pressed?

View 5 Replies

Searching A Record Based On Month And Date In DataGridView?

Dec 15, 2011

Am using Visual studio 2005 with MS Access. I have a Datagridview with a date column in format 11/23/2011(Month/Date/Year).

Now i want to know how 'search criteria based on particular month and date'.

For Example if select 'Nov' as a month from combobox and click on search button, only November month details should be displayed.

View 2 Replies

Searching Record Using A Combobox To Display The Data In A Textbox Or Lablelbox

Jun 11, 2011

I have a problem searching my record using a Combobox to display the data in a textbox or lablelbox

Eg;
txtUsername.text = rs!username
lblAddress.text = rs!Address

View 1 Replies

Delete Record From GridView.Before To Ask For Confirmation Like 'Are You Sure To Delete?'

Apr 1, 2011

I want to delete record from GridView.Before to this ask for confirmation like "Are you sure to delete?"I used command field in GridView, [code] I wrote a function in javascript. [code] How I will call this on delete click.

View 4 Replies

Can't Update Record Into Inner Joined Tables

Jun 4, 2011

Private Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click
conn.Open()
Dim cmd As New OleDbCommand("Update (SELECT Employee.empno, Employee.emplname, Employee.empfname, Employee.empmidname, Employee.contactno, Admin.description FROM Admin INNER JOIN Employee ON Admin.adminNo = Employee.adminNo) Set emplname=?, empfname=?, empmidname=?,

[code]....

View 1 Replies

Delete A Record From A DB?

Jun 21, 2010

I'm working on an application which is created using VB.NET 2005 and the DB is created in SQL server 2005. I'm able to delete a record from a table when it is not used in another table as a Foreign Key. For eg. If I create a new Customer and saves it in Customer Table, i can delete it with out any problems using the following code..

If .DeleteCancelbutton.Text = "&Delete" Then
deleteDialogResult = MessageBox.Show("Delete this record?", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question)

[Code].....

View 5 Replies

Way To Delete A Record

Aug 27, 2009

I have records in table1, if the records exist, it must copy into table2. I want to delete those records in a table1 once all the records are copied into another table2. Im still a beginner in database and with some researches, i found some tutorials on d internet how to connect with database, and the codes easy to understand so i came out with this program.This codes only do the copy part and i'm still lack of the delete part. i found 2 reference in msdn, but i'm not sure and not understand on the codes given.[code]...

its only delete one rows. But what if many records involved? Do i need to consider the EOF things? DO i need to use DataGridView? Becoz the code i did didn't use DataGridView at all. i dont want the records to be displayed, i just want it to running behind.

View 5 Replies

.Net Add/Delete Record - Code So Far?

Jun 21, 2010

Im trying to add a code which adds a record for me and then saves it. I am also trying to add a code which deletes the record for me.So far, my "Add" button, clears the form, which is what I want. Then when I click on save, I get a error. I also get the same error when i Click Delete. This is my code for my "Save" button:

[Code]...

View 13 Replies

Can't Delete Record Datgridview?

Sep 9, 2009

this is my code.

Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
temp = "DaftarGaji"

[code].....

View 5 Replies

Cannot Delete A Record In A Mdb Database?

Oct 6, 2011

the code for delete a record is just below,but

im
custIdentidade
As

[code].....

View 3 Replies

Delete A Record From A Database?

Feb 4, 2011

how to delete a record from a simple database I've been working on. The code is as follows:

[Code]....

View 3 Replies

Delete A Record In Database?

Oct 1, 2010

I can;t seem to get this right. the application i'm creating lets the user select a record in a list view(lvList), and by clicking a remove/delete button, this will happen.

[code]...

View 1 Replies

Delete All Record In DatagridView?

Mar 17, 2009

I am able to delete one, but I need to delete all records, do you know any command that will work?

am using this code but still wrong databasename.table(tableName).delete() and am also cannot compact the database properly... am always get this error

" Database already Exits" .. this is my code

[Code]....

View 1 Replies







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