Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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);

  • *Experts*
Posted

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

"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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...