/// <summary> /// 获取Excel客户端 /// </summary> /// <returns>Excel客户端</returns> public unsafe TmphClient GetClient() { var provider = TmphEnum<EProviderType, THProvider>.Array(Provider); var TmphBuffer = Sql.TmphClient.SqlBuffers.Get(); try { using (var connectionStream = new TmphCharStream(TmphBuffer.Char, Sql.TmphClient.SqlBufferSize)) { connectionStream.WriteNotNull("Provider="); connectionStream.Write(provider.Name); connectionStream.WriteNotNull(";Data Source="); connectionStream.Write(DataSource); if (Password != null) { connectionStream.WriteNotNull(";Database Password="******";Extended Properties='"); connectionStream.Write(provider.Excel); connectionStream.WriteNotNull(IsTitleColumn ? ";HDR=YES;IMEX=" : ";HDR=NO;IMEX="); connectionStream.WriteNotNull(((byte)Intermixed).toString()); connectionStream.Write('\''); return (TmphClient) new Sql.TmphConnection { Type = TmphType.Excel, Connection = connectionStream.ToString() }.Client; } } finally { Sql.TmphClient.SqlBuffers.Push(ref TmphBuffer); } }
public static void ToString(decimal value, TmphCharStream jsonStream) { jsonStream.WriteNotNull(value.ToString()); }