尝试显示表单设计师时出现错误。
查看错误图片:
屏幕代码:
public partial class frmCanalVenda : frmEdit
{
public frmCanalVenda(CanalVenda canal, Cliente cli)
: base(canal)
{
InitializeComponent();
bdsCliente.DataSource = cli;
eabBar.ReadOnlyView = false;
}
private void frmCanalVenda_Load(object sender, EventArgs e)
{
try
{
Cursor.Current = Cursors.WaitCursor;
bdsAgrupamento.DataSource = Agrupamento.GetAll(DatabaseAFV.Connection);
bdsCanal.DataSource = Canal.GetAll(DatabaseAFV.Connection);
bdsSubCanal.DataSource = SubCanal.GetAll(DatabaseAFV.Connection);
bdsEspecializacao.DataSource = Especializacao.GetAll(DatabaseAFV.Connection);
bdsOperacao.DataSource = Operacao.GetAll(DatabaseAFV.Connection);
bdsPorte.DataSource = Porte.GetAll(DatabaseAFV.Connection);
}
finally
{
Cursor.Current = Cursors.Default;
}
}
}
图像文本
在加载设计器之前,必须解决以下错误以防止可能的数据丢失:
值不在预期范围内。
此错误的实例(1)
- 隐藏呼叫堆栈 在System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)处引发异常,在Microsoft.VisualStudio.NativeMethods.ThrowOnFailure(Int32 hr, Int32[] expectedHRFailure)处引发异常,在Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetFileDocData(String fileName, FileAccess access, String createTemplate, Boolean addToHostList, Boolean nestedItem)处引发异常,在Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetChildDocData(String name, FileAccess access, String createTemplate)处引发异常,在Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.GetResourceDocData(CultureInfo info, FileAccess access)处引发异常,在Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.System.ComponentModel.Design.IResourceService.GetResourceReader(CultureInfo info)处引发异常,在System.ComponentModel.Design.Serialization.ResourceCodeDomSerializer.SerializationResourceManager.GetMetadata()处引发异常,以及在System.ComponentModel.Design.Serialization.ResourceCodeDomSerializer.SerializationResourceManager.GetMetadataEnumerator()处引发异常。在System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertiesFromResources(IDesignerSerializationManager manager, Object value, Attribute[] filter)处反序列化属性,然后在System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)处反序列化类型声明。在Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)和System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)中执行加载。