“OSGeo.OGR.Ogr”的类型初始值设定项引发异常

展开阅读全文

“NHibernate.Proxy.CastleProxyFactory”的类型初始值设定引发异常

09-16

小弟刚学用NHibernate,第一个程序就出现了“NHibernate.Proxy.CastleProxyFactory”的类型初始值设定项引发异常rnrn这是Person.cs文件rnusing System;rnusing System.Collections;rnrnnamespace Test.Modelrnrn #region Personrnrn /// rn /// Person object for NHibernate mapped table 'Person'.rn /// rn public class Personrn rn #region Member Variablesrn rn protected int _id;rn protected string _name;rnrn #endregionrnrn #region Constructorsrnrn public Person() rnrn #endregionrnrn #region Public Propertiesrnrn public virtual int Idrn rn get return _id;rn set _id = value;rn rnrn public virtual string Namern rn get return _name; rn setrn rn if ( value != null && value.Length > 50)rn throw new ArgumentOutOfRangeException("Invalid value for Name", value, value.ToString());rn _name = value;rn rn rnrn rnrn #endregionrn rn #endregionrnrnrn这是主程序:rnusing System;rnusing System.Collections.Generic;rnusing System.Text;rnusing NHibernate;rnusing NHibernate.Cfg;rnusing Test.Model;rnrnnamespace Console1rnrn class Programrn rn static void Main(string[] args)rn rn rn Configuration config = new Configuration().AddAssembly("Test.Model");rn ISessionFactory factory = config.BuildSessionFactory();rn ISession session = factory.OpenSession();rnrn Person person = new Person();rn person.Name = "Jackie Chan";rnrn ITransaction trans = session.BeginTransaction();rn tryrn rn session.Save(person);rn trans.Commit();rn Console.WriteLine("Insert Success!");rn rn catch (Exception ex)rn rn trans.Rollback();rn Console.WriteLine(ex.Message);rn rnrnrn rn rnrn 论坛

“Web.help.SQLHelp”的类型初始值设定引发异常

08-15

using System;rnusing System.Data;rnusing System.Configuration;rnusing System.Web;rnusing System.Web.Security;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.WebControls.WebParts;rnusing System.Web.UI.HtmlControls;rnusing System.Data.SqlClient;rnusing System.Collections.Generic;rnusing Web.LoginDAL;rnusing Web.EnitiyLogin;rnusing Web.help;rnusing Web.LoginDALID;rn/// rn/// LoginDal 的摘要说明rn/// rnnamespace Web.LoginDALrnrn public class LoginDal : IDLoginDAlrn rn public bool insertlogin(LoginClass insertlogin)rn rn SqlParameter[] parmeters =rn rn new SqlParameter ("@Ues_Card",SqlDbType.NChar,50),rn new SqlParameter("@Ues_Password",SqlDbType.NChar,50),rn new SqlParameter("@RealName",SqlDbType.NChar,50),rn new SqlParameter("@IdNumber",SqlDbType.NChar,50),rn new SqlParameter("@Nickename",SqlDbType.NChar,50),rn new SqlParameter("@SecurityCode",SqlDbType.NChar,50),rn new SqlParameter("@Email",SqlDbType.NChar,50),rn ;rn parmeters[0].Value = insertlogin.Rw_Card;rn parmeters[1].Value = insertlogin.Rw_password;rn parmeters[2].Value = insertlogin.Rw_realname;rn parmeters[3].Value = insertlogin.Rw_idnumber;rn parmeters[4].Value = insertlogin.Rw_nickename;rn parmeters[5].Value = insertlogin.Rw_securitycode;rn parmeters[6].Value = insertlogin.Rw_email;rnrnrn tryrn rn SQLHelp.ExecuteProcedureNonQurey("inserttablelogin", parmeters);rn return true;rn rn catchrn rn return false;rnrn rnrn rn rnrn用三层做的 出现异常“Web.help.SQLHelp”的类型初始值设定项引发异常。 论坛

“ThreadContext”的类型初始值设定引发异常

07-22

rnrn未处理 System.TypeInitializationExceptionrnMessage=“ThreadContext”的类型初始值设定项引发异常。rnSource=System.Windows.FormsrnTypeName=ThreadContextrnStackTrace:rn在 System.Windows.Forms.Application.ThreadContext.FromCurrent()rn在 System.Windows.Forms.WindowsFormsSynchronizationContext..ctor()rn在 System.Windows.Forms.WindowsFormsSynchronizationContext.InstallIfNeeded()rn在 System.Windows.Forms.Control..ctor(Boolean autoInstallSyncContext)rn在 System.Windows.Forms.ScrollableControl..ctor()rn在 System.Windows.Forms.ContainerControl..ctor()rn在 System.Windows.Forms.Form..ctor()rn在 Microsoft.VisualStudio.HostingProcess.ParkingWindow..ctor()rn在 Microsoft.VisualStudio.HostingProcess.HostProc.RunParkingWindowThread()rn在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)rn在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)rn在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)rn在 System.Threading.ThreadHelper.ThreadStart()rnInnerException: System.ArgumentOutOfRangeExceptionrnMessage=加载因子需要介于 0.1 和 1.0 之间。rn参数名: loadFactorrnSource=mscorlibrnParamName=loadFactorrnStackTrace:rn在 System.Collections.Hashtable..ctor(Int32 capacity, Single loadFactor)rn在 System.Windows.Forms.Application.ThreadContext..cctor()rnrnInnerException: rnrnrnrnrnrn请问这个是什么异常?如何解决? 论坛

没有更多推荐了,返回首页