Dim dtBranchGrid As DataTable
dtBranchGrid = CType(CType(e.CommandSource, GridView).DataSource, DataTable)
BranchID = dtBranchGrid.Rows(Index)("BranchID")

HI!
I cast datagrid into datatable inorder to fetch my relevent ID but this rply an unable to cast error.

Please reply...

try to convert datasource to datatable.....

what is the problem with that code or what are another ways?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.