September 24th, 2003, 01:03 PM
How can I REmove an Item in a DataBase ? (different way?)
I would like to know wich way I can use to delete a row in a database ?
My problem is that I have some items that need to be removed.
I know I can use a database like doing
but using a database that need to read all the lines in it and remove the one not necessary is stupid and it's take way too much time for the program. And I also got a bug when I remove 2 or + items and that I try to access to the next item in the table.
What I was thinking of using is a OleDbCommand and OleDbReader with a query that will only search the objects that I need in SQL. and then compare them and delete the ones I don't need.
but if I use a OleDb, how do I remove the items I don't want ? is there a command for that ?
or is my only possibility the DataSet and DataRow ? or is there other way to do it ? other method or something ? if you know any others that might help me. please tell me ! every opinion and idea is welcome.
I got an headache just for thinking about how I could solve all those problems.
September 24th, 2003, 01:53 PM
would it be something like that ?
OleDBCommand.CommandText = "Delete MyTable where MyNumero = " + MyVariable + ";"
???? would there be other way then this and is that the correct way to do it and correct syntax ?
Last edited by Watever; September 24th, 2003 at 01:55 PM.
September 29th, 2003, 08:50 AM
I still haven't found my problem !
what I am doing
it's not working, it's keep telling me
OleDBCommand.CommandText = "Delete adresse where (norue = '" + _
OleDataR.Item("norue") + "') and (noreleve = " + _
"(select noreleve from releve where codeprojet = '" + _
NoReleve + "'))"
" NoRue = Invalide double type "
what the hell ?
I have done some test with select etc... and it's working but this one isn't working !
but the worst part is that the bug don't happen when I Excute but when I do the CommandText of the OleDBCommand
damn it ! just crazy today
Last edited by Watever; September 29th, 2003 at 09:23 AM.
September 29th, 2003, 10:08 AM
forget about it ! I found it !
but remember that + is not a &
and in a string use "&"
September 29th, 2003, 10:57 PM
Guys please help me ! I need to solve that problem has fast has I can !
I still have a lot of test to do and I have a final date in 2 days. I don't know how I will do that !