通常把数据库中的大段代码复制到C#代码中,格式都会有问题,可以这样解决:
strSql = string.Format(@"SELECT TOP {0}
[ApplicationId] ,
[StatusId] ,
epa.[ApplicationTypeId] ,
[ProductId] ,
epa.[PictureListId] ,
[CoursewareId] ,
[ZipPath] ,
[ProductName] ,
[Introduction] ,
[Description] ,
[ApplictionPrice] ,
[AuditPrice] ,
[SpecialLearnOrgId] ,
[ApplicationDescription] ,
[VendorId] ,
[Period] ,
[EffectDate] ,
[ExpireDate] ,
[ApplicationDate] ,
[AuditUserId] ,
[AuditDate] ,
epa.[CreateUserId] ,
epa.[CreateDate] ,
epa.[ModifyUserId] ,
epa.[ModifyDate] ,
epl.URL
FROM [dbo].[E_ProductApplication] AS epa
JOIN dbo.D_ProductApplicationType AS dpty ON epa.ApplicationId = dpty.ApplicationTypeId
AND dpty.ApplicationTypeId = 1
JOIN dbo.E_PictureList AS epl ON epa.PictureListId = epl.PictureListId
WHERE VendorId = {1};", limitCount, vendorId);
可以看到我们并没有改变格式,这样就可以了!
strSql = string.Format(@"SELECT TOP {0}
[ApplicationId] ,
[StatusId] ,
epa.[ApplicationTypeId] ,
[ProductId] ,
epa.[PictureListId] ,
[CoursewareId] ,
[ZipPath] ,
[ProductName] ,
[Introduction] ,
[Description] ,
[ApplictionPrice] ,
[AuditPrice] ,
[SpecialLearnOrgId] ,
[ApplicationDescription] ,
[VendorId] ,
[Period] ,
[EffectDate] ,
[ExpireDate] ,
[ApplicationDate] ,
[AuditUserId] ,
[AuditDate] ,
epa.[CreateUserId] ,
epa.[CreateDate] ,
epa.[ModifyUserId] ,
epa.[ModifyDate] ,
epl.URL
FROM [dbo].[E_ProductApplication] AS epa
JOIN dbo.D_ProductApplicationType AS dpty ON epa.ApplicationId = dpty.ApplicationTypeId
AND dpty.ApplicationTypeId = 1
JOIN dbo.E_PictureList AS epl ON epa.PictureListId = epl.PictureListId
WHERE VendorId = {1};", limitCount, vendorId);
可以看到我们并没有改变格式,这样就可以了!