sql查询的结果
select PayerDate,PaymentAmount from Payments
Run Code Online (Sandbox Code Playgroud)
PaymentAmount - 十进制
Date Amount
12/11/2012 34.31
12/11/2012 95.60
12/11/2012 34.31
Run Code Online (Sandbox Code Playgroud)
可以获得如下查询结果:
Date Amount
12/11/2012 $34.31
12/11/2012 $95.60
12/11/2012 $34.31
Run Code Online (Sandbox Code Playgroud)
我试过但是找不到太多关于此的信息.
嗨我正在使用PayPal和NVP,以下是对SetExpressCheckout的请求
string returnURL = "http://localhost:50325/GetExpressCheckout.aspx" + "?amount=" + Amount + "¤cy=AUD";
string cancelURL = returnURL.Replace("ReviewOrder", "ExpCheckOut");
string strCredentials = "USER=" + strUsername + "&PWD=" + strPassword + "&SIGNATURE=" + strSignature;
string strNVP = strCredentials;
strNVP += "&PAYMENTACTION=Sale&AMT=" + Amount + "&BILLINGTYPE=MerchantInitiatedBilling" + "&RETURNURL=" + returnURL;
strNVP += "&PAYMENTREQUEST_0_ITEMAMT=25&L_PAYMENTREQUEST_0_NAME0=Item1";
strNVP += "&CANCELURL=" + cancelURL;
strNVP += "&METHOD=SetExpressCheckout&VERSION=" + strAPIVersion + "&NOSHIPPING=1";
HttpWebRequest wrWebRequest = (HttpWebRequest)WebRequest.Create(strNVPSandboxServer);
wrWebRequest.Method = "POST";
// write the form values into the request message
StreamWriter requestWriter = new …Run Code Online (Sandbox Code Playgroud) 我正在使用jQuery.选中复选框时,如何在表内启用或禁用文本框.这是我的edit.cshtml.
<table id="scDetails" class="dataTable">
<thead>
<tr>
<th>RItem</th>
<th>IChecked</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
@foreach (var fback in Model.Fbacks)
{
<tr>
<td @Html.DisplayFor(m => fback.RItem)</td>
<td>@Html.CheckBoxFor(m => fback.IChecked)</td>
<td>@Html.TextBoxFor(m => fback.Notes)</td>
</tr>
}
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
我试过的是:
$('td :checkbox').change(function () {
var parentTx = $(this).closest('tr').find(input[type = "text"]);
if (this.checked) {
parentTx.attr("disabled",false);
} else {
parentTx.attr("disabled", true);
}
});
Run Code Online (Sandbox Code Playgroud)
哪里做错了?我不想在控件上使用任何类来实现这一点.
我需要按单词拆分字符串,每行应有 25 个字符。例如:
string ORIGINAL_TEXT = "请编写一个程序,将此文本分成小块。每个块的最大长度应为 25 "
输出应该是:
“请写一个程序”,
“这破坏了这个文本”,
“分成小块。每个”,
“块应该有一个”,
“最大长度为25”
我尝试使用子字符串- 但它破坏了像
“请写一个程序” - 错误
“请写一个程序” - 正确
请写一个程序 - 只有 23 个字符,它可以需要更多 2 个字符,但它会破坏这个单词。
string[] splitSampArr = splitSamp.Split(',', '.', ';');
string[] myText = new string[splitSampArr.Length + 1];
int i = 0;
foreach (string splitSampArrVal in splitSampArr)
{
if (splitSampArrVal.Length > 25)
{
myText[i] = splitSampArrVal.Substring(0, 25);
i++;
}
myText[i] = splitSampArrVal;
i++;
}
Run Code Online (Sandbox Code Playgroud) sql中临时表的结果如下:
ServiceType
-----------
E
I
I
E
I
D
I
D
E
Run Code Online (Sandbox Code Playgroud)
我想要上面的结果计数像这样(其中I-Imp,E-Exp,D-Dom):
Type Count
------------
Exp 3
Imp 4
Dom 2
Run Code Online (Sandbox Code Playgroud)
任何人都可以建议我实现这一目标的最佳方法吗?我试图通过创建另一个临时表来做到这一点.
sqlselect语句的结果如下所示:
select * from table
Location Role Days
-----------------------------------
Hong Kong Senior Associate 48
Canberra Senior Associate 60
Sydney Senior Associate 55
Run Code Online (Sandbox Code Playgroud)
我想在上面的结果中添加一列 - Hours(SQL Server表中没有小时列).
Hours 应根据位置进行计算
结果应该是:
Location Role Days Hours
-----------------------------------------
Hong Kong Senior Associate 48 6.85
Canberra Senior Associate 60 8
Sydney Senior Associate 55 7.586
Run Code Online (Sandbox Code Playgroud)
我试过用select case它来检查只有一个条件(if和else)和列应该在数据库中.
select
case
when location = 'Sydney'
then Days/7
else Days/7.5
end as Hours
Run Code Online (Sandbox Code Playgroud)
但是我想要在一个SQL语句中检查所有条件并添加不在数据库中的小时列.
请任何建议.
sql ×3
sql-server ×2
c# ×1
count ×1
javascript ×1
jquery ×1
paypal ×1
paypal-nvp ×1
regex ×1
split ×1
string ×1
substring ×1