我的数据库中有一个表叫做CompanyDetails
.它有一个名为的列CharacterID varchar(255)
.我只是将它从NOT NULL
列更改为NULL
列.我在模型浏览器和EDMX文件查看器中运行了"从数据库更新模型..."命令.这就是它在设计师中创造的内容:
/// <summary>
/// There are no comments for Property CharacterId in the schema.
/// </summary>
[global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
[global::System.Runtime.Serialization.DataMemberAttribute()]
public string CharacterId
{
get
{
return this._CharacterId;
}
set
{
this.OnCharacterIdChanging(value);
this.ReportPropertyChanging("CharacterId");
this._CharacterId = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, false);
this.ReportPropertyChanged("CharacterId");
this.OnCharacterIdChanged();
}
}
private string _CharacterId;
partial void OnCharacterIdChanging(string value);
partial void OnCharacterIdChanged();
/// <summary>
/// There are no comments for Property URLDomain in the schema.
/// </summary>
[global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
[global::System.Runtime.Serialization.DataMemberAttribute()]
public string URLDomain
{ …
Run Code Online (Sandbox Code Playgroud) 我有一个(简单的)站点地图,我试图找出为什么某个子菜单始终可见.
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/Login.aspx" title="Home" description="RivWorks" roles="*">
<siteMapNode url="" title="Dashboard" description="" roles="campaigns, auto_negotiation">
<siteMapNode url="CampaignBuilder.aspx" title="Campaign Manager" description="Manage your campaign settings" roles="campaigns" />
<siteMapNode url="ProductManager.aspx" title="Negotiation Manager" description="Manage your product and negotiation settings" roles="auto_negotiation" />
</siteMapNode>
<siteMapNode url="" title="Support Options" description="" roles="customers, customer_super, riv_admins, riv_super">
<siteMapNode url="ChangePassword.aspx" title="Change Password" description="" roles="customers, customer_super, riv_admins, riv_super" />
<siteMapNode url="http://rivworks.zendesk.com/requests/anonymous/new" title="Submit a Support Ticket" description="" roles="customers, customer_super, riv_admins, riv_super" />
<siteMapNode url="http://rivworks.zendesk.com/forums/49919/entries" title="Tips & Tricks" …
Run Code Online (Sandbox Code Playgroud) 我一直在fx3.5上使用WCF学习和构建JSONP Web服务.您可以阅读我在.NET ASMX上的一些试验- 返回Pure JSON?我终于得到了一个样本运行,但现在我正在将它拖入我的应用程序中.
该服务的web.config:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="JsonpServiceBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="RivWorks.Web.Service.CustomerService">
<endpoint address=""
binding="customBinding"
bindingConfiguration="jsonpBinding"
behaviorConfiguration="JsonpServiceBehavior"
contract="RivWorks.Web.Service.ICustomerService" />
</service>
<service name="RivWorks.Web.Service.NegotiateService">
<endpoint address=""
binding="customBinding"
bindingConfiguration="jsonpBinding"
behaviorConfiguration="JsonpServiceBehavior"
contract="RivWorks.Web.Service.INegotiateService" />
</service>
</services>
<bindings>
<customBinding>
<binding name="jsonpBinding" >
<jsonpMessageEncoding />
<httpTransport manualAddressing="true"/>
</binding>
</customBinding>
</bindings>
<extensions>
<bindingElementExtensions>
<add name="jsonpMessageEncoding"
type="RivWorks.Web.Service.JSONP.JsonpBindingExtension
, RivWorks.Web.Service
, Version=1.0.0.0
, Culture=neutral
, …
Run Code Online (Sandbox Code Playgroud) 我想要这个输出:
<a href="\Catalog\Flooring">
<img src="http://site.com/dot.jpg" width="100px" height="100px" alt="" />
<span>Some text here</span>
</a>
Run Code Online (Sandbox Code Playgroud)
使用类似于的RouteLink:
<%= Html.RouteLink(myFPV.ProductTypeName, "CatalogType", new { controller = "Catalog", action = "Types", group = myFPV.ProductGroupName, type = myFPV.ProductTypeName })%>
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚如何在我的标签中添加<img>
和<span>
(带文本)标签<a>
.
合理?
要获得记录列表,我通常会做以下事情:
var efCompany = from a in _dbRiv.Company where a.CompanyId == companyFeedInfo.CompanyId select a;
Run Code Online (Sandbox Code Playgroud)
要获得单个记录,当我知道我使用PK来检索它时,我使用类似的东西:
var efCompany = (from a in _dbRiv.Company where a.CompanyId == companyFeedInfo.CompanyId select a).First();
Run Code Online (Sandbox Code Playgroud)
现在,使用单记录方法,如果PK是一个错误的值(就像它有目的地在测试中),第二行会抛出一个错误.
获得单个记录并处理它的最佳实践方法是什么?
我试图将一个click事件添加到LI元素,但它没有在页面中触发.我的页面标记看起来像:
<div id="Navigation">
<ul>
<li class="navPrevNext inactive">|< First Page</li>
<li class="navPrevNext inactive">< Prev Page</li>
<li class="navIndex selected" title="0 ">1</li>
<li class="navIndex notselected" title="1 ">2</li>
<li class="navIndex notselected" title="2 ">3</li>
<li class="navPrevNext active" title="1">Next Page ></li>
<li class="navPrevNext active" title="2">Last Page >|</li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
在我的JS代码中,我有:
$("#Navigation li").live('click', function(e) { e.preventDefault; this.blur(); return updateNavigation($(this).attr('title')); });
Run Code Online (Sandbox Code Playgroud)
有什么想法吗?
TIA
在使用实体框架时,我将其拆分为自己的项目:
网站上的所有内容都运行良好.我可以调用Controller并获得有效的模型.当我从Web.Service尝试相同的事情时,我收到此错误:
错误:
基础提供程序在ConnectionString上失败.
STACK TRACE:
System.Data
上的System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
中的System.Data.EntityClient.EntityConnection..ctor(String connectionString)
上的System.Data.EntityClient.EntityConnection.ChangeConnectionString (String newConnectionString)
位于RivWorks.Model.Entities.RivFeedsEntities1..ctor(String connectionString)
的RivWorks.Model.FeedStoreReadOnly..ctor(String connectionString)
位于RivWorks.Controller.ProductManager.LookupProduct的.Objects.ObjectContext..ctor(String connectionString,String defaultContainerName)(String productID,String sku,String urlRef,String env,String logPath)
我有点困惑为什么和挖掘错误日志我终于弄清楚连接字符串没有从网站的配置文件中读取.所以,我添加了一些代码来捕捉它,并且,现在,硬编码值.喜欢:
public dataObjects.NegotiateSetup LookupProduct(string productID, string sku, string urlRef, string env, string logPath)
{
string feedConnString = "";
string rivConnString = "";
log.InitializeLogFile(logPath);
dataObjects.NegotiateSetup resultSet = new dataObjects.NegotiateSetup();
try { feedConnString = AppSettings.FeedAutosEntities_connString; }
catch { feedConnString = @"metadata=res://*/Entities.FeedEntities.csdl|res://*/Entities.FeedEntities.ssdl|res://*/Entities.FeedEntities.msl;provider=System.Data.SqlClient;provider connection string='Data Source=***.***.***.***;Initial …
Run Code Online (Sandbox Code Playgroud) 我正在使用Win7和IIS7在我的笔记本电脑上运行localhost实例(因此域不是我的问题!).我在我的网站和我的一个虚拟目录上收到身份验证错误.
default website - localhost:80 c:\mydirectory\localhost
virtual directory - c:\mydirectory\weborb30
Run Code Online (Sandbox Code Playgroud)
请注意这些不在c:\ inetpub\wwwroot下!
现在,我做了一些谷歌搜索/ binging,并发现我需要将我的[machinename $]添加到ACL中.(希望我说得对.)我这样做了,即使它是域名的东西.没有改变.我进一步读到IIS7现在正在使用ApplicationPoolIdentity,我尝试在我的本地机器上找到它 - 那里没有运气.因此,我将App Pool更改为在另一个内置帐户下运行.现在,我不仅得到身份验证错误,我不能再将AttachProcess传递给W3WP.
你怎么在WIN7机箱上正确设置VS2005,IIS7才能在本地运行???
我有2个类feed_Auto和具有多个匹配属性的Product.对于这个特殊问题,AutoID是我需要使用的唯一字段.
我有List<FeedsAuto>
几百个独特的条目.我有一个小List<Product>
的10,20个独特的条目.我现在想要从大列表中删除小列表中的所有项目.
如何使用RemoveAll({lambda expression})来完成此任务?我发现的所有示例都取决于通用列表是简单类型(字符串,整数等).
private static int DoInserts(ref List<Model.feeds_Auto> source, ref List<Model.Product> target, Guid companyID)
{
List<Model.Product> newProductList = new List<Model.Product>();
List<Model.Product> dropSourceList = new List<Model.Product>();
using (var db = Helpers.GetProdDB())
{
foreach (var src in source)
{
var tgt = target.Where(a => a.alternateProductID == src.AutoID && a.LastFeedUpdate < src.DateModified).FirstOrDefault();
if (tgt == null)
{
newProductList.Add(new Model.Product{...});
dropSourceList.Add(src);
}
}
db.SaveChanges();
if (dropSourceList.Count > 0)
{
source.RemoveAll(????);
} …
Run Code Online (Sandbox Code Playgroud) 我的img
标签定义了一些CSS:
img
{
width: auto !important;
height: auto !important;
max-width: 100%;
}
Run Code Online (Sandbox Code Playgroud)
它在我尝试的一些移动浏览器以及桌面上的谷歌浏览器中运行良好.但是,它似乎不适用于IE或FireFox.我的意思是,当你调整窗口大小时.看看我正在研究的沙箱网站:http: //terraninstitute.com.我有意将主页上的图像设置为一幅巨幅图片.还可以导航到信息(主菜单),然后导航到新手(侧面菜单)并注意底部的地图图像.在我的Droid(以及其他一些我能掌握的设备)以及谷歌浏览器中,这看起来非常不错.在IE和FireFox中,并非如此.
我错过了什么吗?冲突的风格定义?如果是的话,我还没有发现它们.
TIA
.net ×3
c# ×3
asp.net ×2
asp.net-mvc ×2
wcf ×2
collections ×1
connection ×1
css ×1
events ×1
generics ×1
iis-7 ×1
jquery ×1
jsonp ×1
lambda ×1
routes ×1
sitemap ×1
updatemodel ×1
web-config ×1
windows-7 ×1