Hi,
I am trying to get the column names and col/row count from a datagrid but it seems that i am stucked. I have tried the following which i got from searching the forum but i got an error : An unhandled exception of type 'System.InvalidCastException' occurred in WindowsApplication1.exe
Additional information: Specified cast is not valid.
VB Code:
'Dg is a datagrid Dim dt As DataTable dt = Dg.DataSource MsgBox(dt.Rows.Count.ToString) MsgBox(dt.Columns.Count.ToString)
thanks for your time




Reply With Quote