Click here to Skip to main content
12,889,437 members (46,314 online)
Rate this:
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);
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 0:01am

1 solution

Rate this: bad
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[^]

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 14 Nov 2012
Copyright © CodeProject, 1999-2017
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