I am getting the following error: "Specified cast is not valid"

----



Private Sub cmdCalcTotal_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdCalcTotal.Click


Dim ds As DataSet

Try

ds = CType(dgrOrderDetails.DataSource, DataSet)

'Other code here to calculate the order total

Catch ex As Exception

MessageBox.Show(ex.Message, "Cannot set the dataset to the datagrid
datasource")

End Try

End Sub

----

Suggestions are greatly appreciated.