Having problems deleting rows

Cricket

Active member
Joined
Jan 6, 2005
Messages
28
Location
Hamilton, ON, Canada
Programming Experience
5-10
I'm deleting rows from a table that has two foriegn keys (and that's it). However when I call the DataAdapter Update method it gives me the following error; "No value given for one or more required parameters."

My guess is that the DataAdapter has problems deleting from a table without a single primary key. Does anyone know what to do in this case?

My code for the DatatAdapter DeleteCommand is as follows (just the parts in question);

VB.NET:
[size=2][/size][size=2][color=#0000ff]Private[/color][/size][size=2] [/size][size=2][color=#0000ff]Const[/color][/size][size=2] CsDeleteSeriesStandardFeature [/size][size=2][color=#0000ff]As[/color][/size][size=2] [/size][size=2][color=#0000ff]String[/color][/size][size=2] = "DELETE FROM tblSeriesStandardFeature WHERE [fuid_Series]=? AND [fuid_StandardFeature]=?"[/size]
[size=2][size=2][/size][/size] 
[size=2][size=2][color=#008000]' Create a delete command.[/color][/size][/size]
[size=2][size=2][color=#0000ff]Me[/color][/size][size=2].daSeriesStandardFeature.DeleteCommand = [/size][size=2][color=#0000ff]New[/color][/size][size=2] System.Data.OleDb.OleDbCommand(CsDeleteSeriesStandardFeature, modGlobal.ocConnection)[/size][/size]
[size=2][size=2][color=#0000ff]With[/color][/size][size=2] [/size][size=2][color=#0000ff]Me[/color][/size][size=2].daSeriesStandardFeature.InsertCommand.Parameters.Add("@fuid_Series", [/size][size=2][color=#0000ff]GetType[/color][/size][size=2]([/size][size=2][color=#0000ff]Long[/color][/size][size=2]))[/size][/size]
[size=2][size=2].SourceColumn = "fuid_Series"[/size][/size]
[size=2][size=2].SourceVersion = DataRowVersion.Original[/size][/size]
[size=2][size=2][color=#0000ff]End[/color][/size][size=2] [/size][size=2][color=#0000ff]With[/color][/size][/size]
[size=2][color=#0000ff]W[size=2]ith[/size][/color][size=2] [/size][size=2][color=#0000ff]Me[/color][/size][size=2].daSeriesStandardFeature.InsertCommand.Parameters.Add("@fuid_StandardFeature", [/size][size=2][color=#0000ff]GetType[/color][/size][size=2]([/size][size=2][color=#0000ff]Long[/color][/size][size=2]))[/size][/size]
[size=2][size=2].SourceColumn = "fuid_StandardFeature"[/size][/size]
[size=2][size=2].SourceVersion = DataRowVersion.Original[/size][/size]
[size=2][size=2][/size][/size] 
[size=2][size=2]' The following is the code I use to mark a row for deletion.[/size][/size]
[size=2][size=2][size=2][color=#0000ff]Me[/color][/size][size=2].dtSeriesStandardFeature.Rows(x).Delete()
[/size][/size][/size]
 
Top Bottom