Error While Deleteing Row From Database Using ExecuteNonQuery
From: Kevin (Kevin_at_discussions.microsoft.com)
Date: 01/20/05
- Next message: Arun: "Accessing Oracle Database"
- Previous message: Rajat Tandon: ""Restructure a Windows application" from scratch in 2 months"
- Next in thread: R. Thomas, aka Xtreme.Net: "RE: Error While Deleteing Row From Database Using ExecuteNonQuery"
- Reply: R. Thomas, aka Xtreme.Net: "RE: Error While Deleteing Row From Database Using ExecuteNonQuery"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 19 Jan 2005 19:05:03 -0800
I want to delete a row in database using SQL delete statement, with
parameters and Executenonquery capturing the return to confirm the number of
rows deleted. I code this in a standard way such as "Delete From Clients
Where ClientID = @ClientID And FName = @OldFname...." The paramters are
assigned in With statements like:
.Add("@ClientID", sqldbtype.int)
.Parameters("@ClientID").value = client.clientID
The error I keep getting is that the variable name @ClientID must be unique...
I don't know if it matters but ClientID is the primary key for this table.
I have tried some variations including just listing the ClientID field in
the SQL Statment. While this in fact deleted the row in the database,
Executenonquery returned a 0 showing no rows changed.
Any suggestions or tips would be appreciated.
- Next message: Arun: "Accessing Oracle Database"
- Previous message: Rajat Tandon: ""Restructure a Windows application" from scratch in 2 months"
- Next in thread: R. Thomas, aka Xtreme.Net: "RE: Error While Deleteing Row From Database Using ExecuteNonQuery"
- Reply: R. Thomas, aka Xtreme.Net: "RE: Error While Deleteing Row From Database Using ExecuteNonQuery"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|