switch(System.Type.GetTypeCode(dt.Rows[i][j].GetType()))
{
case System.TypeCode.Byte:
case System.TypeCode.Char:
case System.TypeCode.Decimal:
case System.TypeCode.Double:
case System.TypeCode.Int16:
case System.TypeCode.Int32:
case System.TypeCode.Int64:
case System.TypeCode.SByte:
case System.TypeCode.Single:
case System.TypeCode.UInt16:
case System.TypeCode.UInt32:
case System.TypeCode.UInt64:
valueStr += dt.Rows[i][j].ToString() +",";
break;
case System.TypeCode.DateTime:
case System.TypeCode.String:
valueStr += "'" + dt.Rows[i][j].ToString() +"',";
break;
case System.TypeCode.Boolean:
{
if ((bool)dt.Rows[i][j]==true)
valueStr += "1,";
else
valueStr += "0,";