Click here to Skip to main content
15,896,727 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to change Datatype in datatable column in DataSet. When dataset is fill .
how can i change this datatype .I need data type change after fill dataset. is it possible .if yes pls help me.

DataSet ds = new DataSet();
ds = attendanceRepository.GetDailyLateAttendanceReport(date);
//ds.WriteXml("D:/DailyLateAttendanceReport.xml");
System.Web.HttpContext.Current.Session["rptSource"] = ds;

I retrive datetime data from database as varchar. but now i change datatype that datetime
Posted

1 solution

You cannot change the DataType of a DataColumn after populating it with data.
Refer these similar threads for alternate approach
change datatype of a datatable object in c#[^]
How To Change DataType of a DataColumn in a DataTable[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900