DataTable dt = TypeConveriontHelper.ConvretExcelToDataTable(SourceAppFilePath);
string targetPath = BatchFolderPath + @"\" + "TRANSACT.INX";
StreamWriter wrtr = null;
wrtr = new StreamWriter(targetPath);
for (int x = 0; x < dt.Rows.Count; x++)
{
string rowString = "";
for (int y = 0; y < dt.Columns.Count; y++)
{
if (y == dt.Columns.Count - 1)
{
rowString += "\"" + dt.Rows[x][y].ToString() + "\"";
}
else
{
rowString += "\"" + dt.Rows[x][y].ToString() + "\"~";
}
}
rowString = rowString.Replace("\"", String.Empty).Trim();
wrtr.WriteLine(rowString);
}
wrtr.Close();
wrtr.Dispose();
Datatable returns “Date” column which includes Time along with Date. But I need to display only the date. Provide me a solution. Thanks.
or fully implemented like:
like michele said see http://msdn.microsoft.com/en-us/library/az4se3k1.aspx for full reference