Hi All
Am getting the following error in my code: "The type 'System.XML.XMLElement' must be marked as serializable or have a typeconverter other that ReferenceConverter to be put in viewstate"
What i am doing is that i am accessing a database, and doing a general select statement on a particular table.
I know from that my database code is correct as i am running other statments through the same code, however just in case the actual select statement code is:
public function getClasses()
try
connect
commSQL.connection = conSQL
CommSQL.commandtype = commandtype.text
commSQL.commandtext = "Select * from classification"
daDataAdapter.selectCommand = commSQL
daDatAdapter.fill(dsDataSet)
conSQL.close
return dsDataSet
catch ex as exception
conSQL.close
Throw ex
end try
end function
In order to display the information that i am retrieving i do the following
public function display_classes()
webGrid.datasource = getClasses
webgrid.databind()
end function
'The function display_classes is called in the page load event/function
the dsDAtaSet and daDataAdapter are declared as following:
dim dsDataSet as new dataset
dim daDataAdapter as new SQLClient.SQLDataAdapter
This code is exactly the same code as i am using in other pages and it works perfectly there. Would appreciate any suggestions.
Mike
Am getting the following error in my code: "The type 'System.XML.XMLElement' must be marked as serializable or have a typeconverter other that ReferenceConverter to be put in viewstate"
What i am doing is that i am accessing a database, and doing a general select statement on a particular table.
I know from that my database code is correct as i am running other statments through the same code, however just in case the actual select statement code is:
public function getClasses()
try
connect
commSQL.connection = conSQL
CommSQL.commandtype = commandtype.text
commSQL.commandtext = "Select * from classification"
daDataAdapter.selectCommand = commSQL
daDatAdapter.fill(dsDataSet)
conSQL.close
return dsDataSet
catch ex as exception
conSQL.close
Throw ex
end try
end function
In order to display the information that i am retrieving i do the following
public function display_classes()
webGrid.datasource = getClasses
webgrid.databind()
end function
'The function display_classes is called in the page load event/function
the dsDAtaSet and daDataAdapter are declared as following:
dim dsDataSet as new dataset
dim daDataAdapter as new SQLClient.SQLDataAdapter
This code is exactly the same code as i am using in other pages and it works perfectly there. Would appreciate any suggestions.
Mike