I Have Error When I used This Code ..
My Error Inside
See My Full Code Abou Delete
My Error Inside
VB.NET:
[COLOR=#800000]"DELETE FROM thebank [/COLOR][SIZE=2][COLOR=#800000]WHERE id = ?;"[/COLOR][/SIZE][SIZE=2] & _
[/SIZE][SIZE=2][COLOR=#800000]"DELETE FROM Data WHERE id = ?;"[/COLOR][/SIZE]
VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] objCommand [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] OleDbCommand = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDbCommand()
[/SIZE][SIZE=2][COLOR=#008000]' Set the Command object properties...
[/COLOR][/SIZE][SIZE=2]objCommand.Connection = cn
objCommand.CommandText = [/SIZE][SIZE=2][COLOR=#800000]"DELETE FROM thebank "[/COLOR][/SIZE][SIZE=2] & _
[/SIZE][SIZE=2][COLOR=#800000]"WHERE id = ?;"[/COLOR][/SIZE][SIZE=2] & _
[/SIZE][SIZE=2][COLOR=#800000]"DELETE FROM Data WHERE id = ?;"
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]' Parameter for the title_id field...
[/COLOR][/SIZE][SIZE=2]objCommand.Parameters.AddWithValue _
([/SIZE][SIZE=2][COLOR=#800000]"?"[/COLOR][/SIZE][SIZE=2], BindingContext(MyDataView).Current([/SIZE][SIZE=2][COLOR=#800000]"id"[/COLOR][/SIZE][SIZE=2]))
[/SIZE][SIZE=2][COLOR=#008000]' Open the database connection...
[/COLOR][/SIZE][SIZE=2]cn.Open()
[/SIZE][SIZE=2][COLOR=#008000]' Execute the SqlCommand object to update the data...
[/COLOR][/SIZE][SIZE=2]objCommand.ExecuteNonQuery()
[/SIZE][SIZE=2][COLOR=#008000]' Close the connection...
[/COLOR][/SIZE][SIZE=2]cn.Close()
[/SIZE]