Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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 14-Nov-12 1:01am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
v2

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



Advertise | Privacy | Mobile
Web01 | 2.8.150129.1 | Last Updated 14 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100