In addition to the information Cor asked for, can you also tell us:
Are you storing your data in SQL Server (full version or MSDE), Access, or
some other database?
Are you familiar with SQL queries? (INSERT, SELECT, DELETE)
Are you familiar with stored procedures?
What information forms the primary key for your NameTable?
What information forms the foreign key for the carinfotable?
While Jeff responded with a very technical answer, I'd like to repeat one of
the key points he made:
If you are using referential integrity in your database, you will have to
delete rows from the carinfotable first and then from the NameTable. I
would add: If you are not using referential integrity in your database, you
should be. ;-)
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Mike & Dyan" <mi******@comcast.net> wrote in message
news:M5********************@comcast.com...
I was able to figure out how to insert new data into my database. But for
some reason and a lot of reading I can't seem to figure out how to delete
any data.
My app is going to be used for tracking info on vehicles. My app is MDI
with 3 children. 1 is for selecting a car(already in the database) and
input info.Then you can add that car and info to the database. Another is
used for just adding or deleting a car to the database. The 3rd is where
the data is viewed via a datagrid. I have 2 tables. 1 is car names, carID,
model,Etc..the other is for maintenance logs ie miles and etc....
Either I just don't get it or the method for deleting data is not
explained very well. I have been only using .NET for a few months and
have very little programming experience.
I need to be able to delete the car name from the NameTable and then
delete all info on that car from the carinfotable.
If anyone can point me in the right direction I would be greatful
Thx in advance.