Last post Feb 25, 2011 10:12 AM by TigerWoods
Feb 25, 2011 05:26 AM|TigerWoods|LINK
i use the code below:
protected void ObjectDataSourceWebsitesInfo_ObjectCreated(object sender, ObjectDataSourceEventArgs e)
if (e.ObjectInstance != null)
SqlConnection conn = new SqlConnection();
conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["MyConnectionStringNameInWeb.Config"].ConnectionString;
e.ObjectInstance.GetType().GetProperty("Connection").SetValue(e.ObjectInstance, conn, null);
and i got this error:
I need your help plz.
Feb 25, 2011 05:53 AM|TigerWoods|LINK
i use 3-tier programming. DAL , BLL and Presentation Layer
on localhost ObjectDataSource works without any problem but on remote server when i uploaded it on my remote host it returns the error i mentioned.
Feb 25, 2011 10:12 AM|TigerWoods|LINK
i found out the answer.
in DAL layer in Properties section there is a file with the name of Settings.settings and a sub file with the name of Settings.Designer.cs
You must change the connectionstring there to solve your problem.