SqlCommand detailsCommand = new SqlCommand("SELECT bd.bookName, bd.authorName, bd.publishDate bc.description, bd.keyWords FROM bookCart as bc, bookDetails as bd WHERE bc.bookCode = bd.code");
DataTable detailsTable = book.showData(detailsCommand);
String BookName = detailsTable.Rows[0]["bookName"].ToString();
String AuthorName = detailsTable.Rows[1]["authorName"].ToString();
String PublishDate = detailsTable.Rows[2]["publishDate"].ToString();
String Describe = detailsTable.Rows[3]["describtion"].ToString();
String KeyWords = detailsTable.Rows[4]["keyWords"].ToString();
It gives me an IndexOutOfRangeException
in the last two lines.
I guess it's because the describe is in another table, but I could not solve it, can you help me with this please?