shaheer
shaheer

Reputation: 67

I want to change the format of DateTime field inside DataSet

I have dataset with a table Temp, and i want to change the format of a DateTime field. Is there any direct method to do that.

myDataSet->Tables->Item["Temp"]->Columns->Item["DateTimeColumnName"]

this is the column, Temp is the table and how can i achieve this? i want to do it in Ado.net.

Upvotes: 0

Views: 253

Answers (1)

Krish KvR
Krish KvR

Reputation: 1054

Try this..

foreach (DataRow row in myDataSet.Tables[0].Rows) 
{
    row["UrDateColumn"]= DateTime.Parse(String.Format("{0}:dd-MM-yyyy",dr["UrDateColumn"]));
}

Upvotes: 1

Related Questions