如何用COUNT编写LINQ to SQL?
例:
var purch = from purchase in myBlaContext.purchases
select purchase;
Run Code Online (Sandbox Code Playgroud)
我怎么能在这里得到点数?
我有下一个内容类型:
图像/ GIF
图像/ PNG
应用程序/ vnd.ms
他们都工作并识别文件(gif,png,xls)......
但jpg的内容类型是什么?我知道它是jpeg的类型:
image/pjpeg,image/jpeg
但它对jpg不起作用.
(我在代码中使用它:
if (contentType == "image/JPEG") .....
if (contentType == "image/gif")...
Run Code Online (Sandbox Code Playgroud)
按类别扩展文件.也许有其他方法可以做到这一点?不是内容类型?)
我使用的是WPML语言,无法为下一步找到解决方案:
在语言切换器上我想隐藏语言,比如说 - "他",如果当前语言可以说例如"ar",那么当我们在阿拉伯语网站上我们不会在选择器上看到希伯来语,同样的事情如果我们用希伯来语,阿拉伯语就不会显示出来.
缩短词语:我想要的是 - 如果我们在阿拉伯语网站上 - 希伯来语旗帜将被隐藏.
我尝试了什么:
function language_selector_flags(){
$languages = icl_get_languages('skip_missing=0');
if(!empty($languages)){
if(ICL_LANGUAGE_CODE=='en')
{
$order = array('ar'); //Specify your sort order here
}
elseif(ICL_LANGUAGE_CODE=='he')
{
$order = array('en', 'ar'); //Specify your sort order here
}
foreach ($order as $l) {
if (isset($languages[$l])) {
$l = $languages[$l]; //grab this language from the unsorted array that is returned by icl_get_languages()
//Display whatever way you want -- I'm just displaying flags in anchors (CSS: a {float:left; display:block;width:18px;height:12px;margin:0 …Run Code Online (Sandbox Code Playgroud) 我有常规wordpress代码来显示类别描述:
<?php echo category_description( $category_id ); ?>
Run Code Online (Sandbox Code Playgroud)
但是,我如何显示Woocommerce类别描述?@@在评论建议之一后我补充说:
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
global $post, $product; $categ = $product->get_categories(); $term = get_term_by ( 'name' , strip_tags($categ), 'product_cat' ); echo $term->description;
} // end while
} // end if
?>
Run Code Online (Sandbox Code Playgroud)
不过,不行.
首先..请原谅我的英语不好,我希望能被理解.
我很高兴与LINQ合作,SQL对我来说是新的.
我正在尝试做下一件事:我在c#上有下一个方法:
public string niceMethod()
{
SqlConnection connection = new SqlConnection("Data Source=*******;Integrated Security=False;");
string commandtext = "SELECT bla FROM items WHERE main = 1";
SqlCommand command = new SqlCommand(commandtext, connection);
connection.Open();
string tDate = (string)command.ExecuteScalar();
connection.Close();
return tDate;
}
Run Code Online (Sandbox Code Playgroud)
我有页面例如: items.aspx?nID=144
我怎么能这样做SELECT命令将使用查询字符串,这将取值
来自"items"表的地址上显示的id(nID)?
该表的设计例如:id, title, bla, main.
页面网址:http://advancedmedia.co.il/data.aspx
码:
<asp:Content ID="Content2" ContentPlaceHolderID="page_content_cp" Runat="Server">
<asp:UpdatePanel runat="server" ID="UP1" UpdateMode="Conditional">
<ContentTemplate>
<section id="page_section">
<div class="data_top">
<ul class="bxslider">
<asp:ListView ID="LV_slider" runat="server" DataSourceID="**">
<ItemTemplate>
<li>
<asp:Image ID="Image11" ImageUrl='<%#XPath("big_image_url") %>' AlternateText="slider" runat="server" />
</li>
</ItemTemplate>
</asp:ListView>
</ul>
</div>
<div class="shaddow"></div>
<div class="data_bottom">
<asp:ListView runat="server" ID="LV_data_bottom" DataSourceID="**">
<ItemTemplate>
<div style="display:inline;">
<asp:LinkButton runat="server" CommandArgument='<%#XPath("big_image_url") %>' ID="LB_thumb" OnClick="lb_thumb1" ><asp:Image runat="server" ID="IMG_img1" ImageUrl='<%#XPath("small_image_url") %>' />
<asp:Label runat="server" CssClass="title" ID="bottom_label" Text='<%#XPath("title") %>'></asp:Label></asp:LinkButton>
</div>
</ItemTemplate>
</asp:ListView>
</div>
</section>
</ContentTemplate>
</asp:UpdatePanel>
<asp:XmlDataSource ID="**" runat="server"
DataFile="~/***/***" XPath="/Data/**/**">
</asp:XmlDataSource> …Run Code Online (Sandbox Code Playgroud) 我收到了这个错误:
ASP.NET Ajax客户端框架无法加载
有错误:
'Sys'未定义.
错误在底部的IE中显示(错误消息),并且仅在我在服务器上运行该站点时才会出现.在我的localhost一切正常.
我搬到新服务器,我有问题.我以前的服务器一切都很好.
问题来自ajax的SCRIPTMANAGER.
我该怎么办?在web.config中的东西,还是主机公司需要安装什么东西?
ASP.NET 4,IIS 7.5
IE上丑陋的黄色三角形并不是什么令我不安的..最大的问题是脚本管理器更新pannel - 不行!
我对一些使它们变灰的图像进行了过滤,只悬停在它们上面使它们变成颜色:
.bxslider2 img {
display: inline;
float: left;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 3.5+ */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%);
-webkit-filter: grayscale(1); /* Google Chrome, Safari 6+ & Opera 15+ */
}
.bxslider2 img:hover {
filter: none;
-webkit-filter: grayscale(0%);
-moz-filter:grayscale(0%);
}
Run Code Online (Sandbox Code Playgroud)
我想保留那些代码,但我对ie8有问题 - 只有在那里我看到图像周围的黑色.我找到了解决方案,但这个解决方案删除了灰色过滤器,我无法找到合并它的方法:
.bxslider2 img {
background: transparent;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); …Run Code Online (Sandbox Code Playgroud) 我的fxml文件上有Label:
<children>
<Label fx:id="lblTest" text="Label" />
</children>
Run Code Online (Sandbox Code Playgroud)
如何从主/控制器java文件中将文本从"标签"更改为"Hello"?
我刚刚开始学习JavaFX的基础知识,我不确定是否可能
我试图通过它slug获得id\tag of tag.
那是我的代码:
$tag = get_term_by('slug', 'hedoms', 'post_tag');
$tag_id = $tag->term_id;
<h1><?php echo $tag->name;?></h1>
Run Code Online (Sandbox Code Playgroud)
我从这里开始:https: //codex.wordpress.org/Function_Reference/get_term_by
我有slug hedoms的标签,但它<h1>是空的,它不返回值.我尝试了这个函数(get_term_by)与类别 - 和相同的结果.
第二场是slu ..
但如果我使用id而不是slug,它可以正常工作:
$tag_id = get_term_by('id', 97, 'post_tag');
echo $tag_id->name;
Run Code Online (Sandbox Code Playgroud)
看起来get_term_by只将'id'识别为字段.
我想念的是什么?它应该循环或什么?
我试图这样做的文件是archive-product.phpWoocommerce.
c# ×4
asp.net ×3
php ×3
wordpress ×3
sql ×2
ajax ×1
content-type ×1
css ×1
css3 ×1
fxml ×1
html ×1
html5 ×1
java ×1
javafx ×1
javafx-8 ×1
linq ×1
mime-types ×1
query-string ×1
updatepanel ×1
woocommerce ×1
wpml ×1