Dreamer Posted March 8, 2003 Posted March 8, 2003 I have a problem when I add record to database.Ii is an Access database.When I call Update method of daAlbums it throws an ecxception.Problem is that i don't know an ArtistID when I add new Artist to Artist Table. DataRowView drvArtist = vueArtists.AddNew(); DataSet1.ArtistsRow rowArtist = (DataSet1.ArtistsRow) drvArtist.Row; rowArtist.ArtistName = "asdasd"; drvArtist.EndEdit(); DataRowView drvAlbum = vueAlbums.AddNew(); DataSet1.AlbumsRow rowAlbum = (DataSet1.AlbumsRow) drvAlbum.Row; rowAlbum.ArtistID = rowArtist.ArtistID; rowAlbum.AlbumName = "qwerqw"; drvAlbum.EndEdit(); daArtists.Update(dsMp3.Artists); daAlbums.Update(dsMp3.Albums); Quote
*Experts* Nerseus Posted March 10, 2003 *Experts* Posted March 10, 2003 What's the error that you're getting? Is it related to the ArtistID you mentioned? Also, did you design the Database or someone else? -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.