我可以使用以下URL直接将webservie调用到浏览器,它将返回我想要的所有内容:
http://localhost:64438/MySearchAutoComplete.asmx/GetCompletionList
Run Code Online (Sandbox Code Playgroud)
当我将它添加到autocompleteexetender到Default.aspx页面时,如下所示:
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1"
TargetControlID="TextBox1"
runat="server"
ServiceMethod="GetCompletionList"
ServicePath="http://localhost:64438/MySearchAutoComplete.asmx"
CompletionSetCount="12"
MinimumPrefixLength="1" />
Run Code Online (Sandbox Code Playgroud)
页面加载,我有一个文本框但每次在文本框中添加击键时我都有一个错误500.我在FireFox FireBug中看到了错误.
http://localhost:62702/ --->This is the webpage that load fine
Run Code Online (Sandbox Code Playgroud)
alt text http://clip2net.com/clip/m12122/1269451120-clip-2kb.png - >这是错误
任何的想法?我注意到我需要附加调试webservice的过程,我也可能做错了吗?
如果我去我的机器的事件查看器.我可以看到 :
Exception information:
Exception type: InvalidOperationException
Exception message: Request format is unrecognized for URL unexpectedly ending in '/GetCompletionList'.
Thread information:
Thread ID: 8
Thread account name: MTL\daok
Is impersonating: False
Stack trace: at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) …Run Code Online (Sandbox Code Playgroud) <?xml version="1.0" encoding="utf-8"?>
<xs:schema id="abc" targetNamespace="http://schemas.businessNameHere.com/SoftwareNameHere"
elementFormDefault="qualified"
xmlns="http://schemas.businessNameHere.com/SoftwareNameHere"
xmlns:mstns="http://schemas.businessNameHere.com/SoftwareNameHere"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="..." type="..." />
<xs:complexType name="...">
Run Code Online (Sandbox Code Playgroud)
我正在使用XSD生成.cs文件的项目.我的问题是关于字符串" http://schemas.businessNameHere.com/SoftwareNameHere "如果我改变它,它不起作用.但是http://不是一个有效的......背后的逻辑是什么,我在哪里可以获得有关放在那里或如何更改它的信息?
OData 协议及其 WCF 数据服务实现中是否有任何元数据版本控制支持?
假设我们有公开单个 Goods 集合的 OData 服务,并且 Goods 实体类型具有三个属性:Key(字符串)、Name(字符串)和AvailableSince(字符串)。该服务已经在运行,并且有一些消费者依赖此元数据模式。接下来,我们要更新 Goods 实体类型 - 例如用其他内容替换属性AvailableSince(string),或者将其类型从字符串更改为日期时间 - 因此我们将有两个版本的元数据,并且依赖于第一个版本元数据的消费者将无法根据第二个元数据模式发送正确的请求。
有没有办法在单个服务中提供两个元数据版本?如果是,那么消费者如何在请求中指定元数据版本,以及WCF端应如何处理它?
提前感谢大家。
我需要在Javascript文件中转换一些使用括号而不是括号的变量.例如,MyVariable(i)应该是MyVariable [i].
我使用Visual Studio 的查找和替换工具与此正则表达式:
MyVariable\({(.+)}\)
Run Code Online (Sandbox Code Playgroud)
并替换为:
MyVariable\[\1\]
Run Code Online (Sandbox Code Playgroud)
这项工作适用于以下情况:
asdas.MyVariable(i+1)
asdas.MyVariable(i)
asdas.MyVariable(i).asd
MyVariable(i+1)
Run Code Online (Sandbox Code Playgroud)
但不适用于案例
if (parseInt(OtherObject.MyVariable(i+1).Dest.XYZ)==SINK_STATE_TYPE || OtherObject.MyVariable(i).X == "ok")
Run Code Online (Sandbox Code Playgroud)
最后一个将采取第一个括号和行的最后一个并且行为很奇怪.我需要在正则表达式中进行哪些更改才能使其与具有多个括号的行一起使用.
我用Northwind数据库做了一个小项目来说明问题所在.
这是控制器的动作:
[HttpPost]
public ActionResult Edit(Product productFromForm)
{
try
{
context.Products.Attach(productFromForm);
var fromBD = context.Categories.Find(productFromForm.Category.CategoryID);
productFromForm.Category = fromBD;
context.Entry(productFromForm).State = EntityState.Modified;
context.SaveChanges();
return RedirectToAction("Index");
}
catch
{
return View();
}
}
Run Code Online (Sandbox Code Playgroud)
context在Controller的构造函数中实例化new DatabaseContext().
public class DatabaseContext:DbContext
{
public DatabaseContext()
: base("ApplicationServices") {
base.Configuration.ProxyCreationEnabled = false;
base.Configuration.LazyLoadingEnabled = false;
}
public DbSet<Product> Products { get; set; }
public DbSet<Category> Categories { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder){
modelBuilder.Configurations.Add(new ProductConfiguration());
modelBuilder.Configurations.Add(new CategoriesConfiguration());
}
private class ProductConfiguration : EntityTypeConfiguration<Product> …Run Code Online (Sandbox Code Playgroud) c# asp.net-mvc entity-framework asp.net-mvc-3 entity-framework-4.3
我有一种奇怪的行为.我想更新复杂类型的单个属性.当我指定要使用IsModified更新的属性(某些属性为true而某些属性为false)时,我没有更新任何内容.如果我没有指定复杂类型的属性,则更新复杂属性的每个字段.
public class MyEntity
{
public MyComplexClass Property1 { get; set; }
}
//... The code below doesn't work, in fact it update nothing
var entityLocal = this.Set<MyEntity>().Local.SingleOrDefault(d => d.Id == entity.Id);
if (entityLocal == null)
{
entityLocal = this.Set<MyEntity>().Attach(entity);
}
this.ChangeTracker.Entries<MyEntity>().Single(d => d.Entity == entityLocal).State = EntityState.Modified;
this.Entry(entity).Property(s => s.Property1.SubProperty1).IsModified = true;
this.Entry(entity).Property(s => s.Property1.SubProperty2).IsModified = false;//This seam to remove all update of the complex type...?
this.SaveChanges();
Run Code Online (Sandbox Code Playgroud)
这产生:
update [dbo].[MyEntity]
set @p = 0
where (([Id] = @0))
Run Code Online (Sandbox Code Playgroud)
如果我没有将SubMperty2的IsModified指定为false,我在SQL事件探查器中有以下内容: …
c# entity-framework complextype ef-code-first entity-framework-5
当我尝试在调试中编辑时,我收到此消息(见下图).这只发生在我的Vista64bits操作系统中,而不是在我的XP计算机中.为什么,我该怎么办?
更新 我发现我需要在x86中编译才能在调试时更改值.所以我的问题是为什么我不能在x64中这样做?
alt text http://img183.imageshack.us/img183/8523/changetohe5.png
这是有效的:
$curRow[1]/@gridClose
Run Code Online (Sandbox Code Playgroud)
但是我要说我不知道属性名称"gridclose".我将循环并使用代码获取此属性.
使用调试器,我可以使用:$ curCol/@ id获取值"gridClose".所以我想尝试得到类似的东西:
$curRow[1]/@{$curCol/@id}
Run Code Online (Sandbox Code Playgroud)
但它不起作用.知道我怎么能这样做吗?
错误在这一行:
dataArray[iLedMatrix][iRow] |= (byte)(bufferPattern[iRow]) & (1<<7);
Run Code Online (Sandbox Code Playgroud)
dataArray是:byte dataArray [NUMBER_LED_MATRIX] [NUMBER_ROW_PER_MATRIX];
bufferPattern是:const patternp*bufferPattern;
patternp是类型的typedef:typedef prog_uchar patternp [NUM_ROWS];
我在参考文献中可以看到prog_uchar是1个字节(0到255).所以我不明白失去精度的错误?任何的想法?
我有东西从Bin目录(SVN存储库中.exe,.dll,.pdb).我想清理存储库以清除这些文件并防止它们返回.
*.exe *.suo *.pdb /Debug/*但似乎没有正常工作.c# ×5
asp.net ×2
.net ×1
.net-2.0 ×1
asp.net-ajax ×1
asp.net-mvc ×1
astoria ×1
avr ×1
c ×1
c++ ×1
compilation ×1
complextype ×1
editing ×1
metadata ×1
odata ×1
regex ×1
replace ×1
svn ×1
tortoisesvn ×1
wcf ×1
web-services ×1
xml ×1
xsd ×1
xslt ×1