小编yog*_*ate的帖子

SQL Server中的Datepart函数错误

select case  when datepart (mm,getdate())>3 then 'abc' else 2 end
Run Code Online (Sandbox Code Playgroud)

将varchar值'abc'转换为数据类型int时转换失败.

c#

2
推荐指数
1
解决办法
149
查看次数

找到Person的最后一条记录

这是我的数据

Id Name Amt

1  ABC  20
2  XYZ  30
3  ABC  25
4  PQR  50
5  XYZ  75
6  PQR  40
Run Code Online (Sandbox Code Playgroud)

我希望每个特定名称的最后一条记录如:

3  ABC  25
5  XYZ  75 
6  PQR  40
Run Code Online (Sandbox Code Playgroud)

我尝试过分组,但我错过了一些东西.

SELECT     PatientID, Balance, PReceiptNo
FROM         tblPayment
GROUP BY PatientID, Balance, PReceiptNo
Run Code Online (Sandbox Code Playgroud)

sql

2
推荐指数
1
解决办法
138
查看次数

System.UnauthorizedAccessException拒绝访问路径

尝试使用以下代码编写PDF文档:

document = new Document();
PdfWriter writer = null; ;
try
{
    writer = PdfWriter.GetInstance(document, new FileStream(@"E:\mergFiles", FileMode.Create));
}
catch (Exception xc)
{ }
Run Code Online (Sandbox Code Playgroud)

我得到一个例外:

{System.UnauthorizedAccessException: Access to the path 'E:\mergFiles' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) …
Run Code Online (Sandbox Code Playgroud)

.net c# exception pdf-writer

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

c# ×2

.net ×1

exception ×1

pdf-writer ×1

sql ×1