我正在使用SQL Server 2005.
我的查询是:
SELECT (
SELECT COUNT(1) FROM Seanslar WHERE MONTH(tarihi) = 4
GROUP BY refKlinik_id
ORDER BY refKlinik_id
) as dorduncuay
Run Code Online (Sandbox Code Playgroud)
而错误:
除非还指定了TOP或FOR XML,否则ORDER BY子句在视图,内联函数,派生表,子查询和公用表表达式中无效.
如何ORDER BY在子查询中使用?
可能重复:
点击退出时删除cookie
我想在用户注销时删除cookie.
这是我的代码:
if (HttpContext.Current.Request.Cookies["currentUser"] != null)
{
DeleteCookie(HttpContext.Current.Request.Cookies["currentUser"]);
}
public void DeleteCookie(HttpCookie httpCookie)
{
try
{
httpCookie.Value = null;
httpCookie.Expires = DateTime.Now.AddMinutes(-20);
HttpContext.Current.Request.Cookies.Add(httpCookie);
}
catch (Exception ex)
{
throw (ex);
}
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用.你有什么建议吗?
我有一个javascript文件,我想在这个js文件中包含jquery.你有什么建议吗?
我使用Entity Framework 4.0.是否有可能SaveChanges()返回0但不会抛出异常?例如,添加后.
这是我的代码:
try
{
_context.CodeProducts.Add(entity);
_context.SaveChanges();
//Shell I control return result from SaveChanges() in here.
//However doesn't throw an exceoption?
return new MethodResponse()
{
ResultText = "Successful",
Type = MethodResponse.ResponseType.Succeed
};
}
catch (OptimisticConcurrencyException exc)
{
throw exc;
}
catch (UpdateException exc)
{
throw exc;
}
catch (Exception exc)
{
throw exc;
}
Run Code Online (Sandbox Code Playgroud) 我想使用公钥/私钥技术加密数据.我的意思是,用接收器的公钥加密,接收器可以用自己的私钥解密.
我怎样才能做到这一点?您有任何建议或示例代码吗?
c# encryption cryptography public-key-encryption private-key
我正在使用Visual Studio 2008和C#.
我有一个.xsd文件,它有一个表适配器.我想更改表适配器的命令超时.
谢谢你的帮助.
我有一些XML
<Users>
<User Name="Z"/>
<User Name="D"/>
<User Name="A"/>
</User>
Run Code Online (Sandbox Code Playgroud)
我想按名字排序.我使用加载xml XDocument.如何查看按名称排序的xml?
我的Web服务连接有问题.它说,
可能的SOAP版本不匹配:Envelope命名空间 http://schemas.xmlsoap.org/wsdl/是意外的.期待 http://schemas.xmlsoap.org/soap/envelope/.
当我调用webservice的方法时.你对我的问题有任何想法吗?
这是我的SQL查询.
CREATE FUNCTION UF_GetOrderProducts
(
@OrderId int
)
RETURNS VARCHAR(500)
AS
BEGIN
SELECT Identity(int,1,1) ID, ProductId INTO #Temp FROM OrderProduct WHERE OrderId = @OrderId
Declare @Id int,
@Count int,
@LoopCount int,
@ProductList VARCHAR(500),
@ProductListTemp VARCHAR(500)
SET @Count = (Select Count(*) From #Temp)
SET @LoopCount = 1
SET @ProductList = ''
WHILE @LoopCount <= @Count
BEGIN
SET @ProductListTemp =( SELECT Name FROM Product WHERE ProductId =(Select ProductId from #Temp Where ID = @LoopCount))
SET @ProductList +=@ProductListTemp + '<br/>'
Set @LoopCount=@LoopCount + …Run Code Online (Sandbox Code Playgroud) 我有两个列表,其中一个有5个元素,另一个有4个元素.它们有一些相同的元素,但它们也有不同的元素.我想创建一个包含不同元素的列表.我该怎么做?
注意:5个元素列表是我的主要列表.
c# ×6
asp.net ×2
.net ×1
c#-4.0 ×1
command ×1
cookies ×1
cryptography ×1
dataset ×1
encryption ×1
include ×1
javascript ×1
jquery ×1
linq ×1
linq-to-xml ×1
private-key ×1
sorting ×1
sql-order-by ×1
sql-server ×1
t-sql ×1
temp ×1
timeout ×1
web-services ×1