hey it may be the problem with app.config settings.
u hv to code like this
<appSettings>
<add key ="ConnectionString" value="Data Source=server name;Initial Catalog=db name;User ID= sa;Password= sa"/>
</appSettings>
if u code this wrongly ,typeintializer error w'll throw.
Also if the key name is used different from app.config also exception will throw.