registrationpage error
-
i wrote code in web form , when i run it says error like error couldnot find the file"c:\inetpub\wwwroot\Web.config" my code is : try { DataSet ds=new DataSet (); ds.ReadXml(Server .MapPath ("./../Web.config")); DataRow row; row=ds.Tables [6].NewRow (); ds.Tables [6].Constraints .Add ("usr_pk",ds.Tables [6].Columns [0],true); row[0]=TextBox1 .Text ; row[1]=FormsAuthentication .HashPasswordForStoringInConfigFile (TextBox1 .Text ,"md5"); row[2]=0; ds.Tables [6].Rows .Add (row); DataRow row1; row1=ds.Tables [8].Rows [0]; row1.BeginEdit (); row1[0]+=","+TextBox1 .Text ; row1.EndEdit (); ds.WriteXml (Server .MapPath ("./../Web.config")); lblmsg.Text ="user registeed"; } catch(Exception ex) { lblmsg.Text ="error"+ex.Message ; } aslam
-
i wrote code in web form , when i run it says error like error couldnot find the file"c:\inetpub\wwwroot\Web.config" my code is : try { DataSet ds=new DataSet (); ds.ReadXml(Server .MapPath ("./../Web.config")); DataRow row; row=ds.Tables [6].NewRow (); ds.Tables [6].Constraints .Add ("usr_pk",ds.Tables [6].Columns [0],true); row[0]=TextBox1 .Text ; row[1]=FormsAuthentication .HashPasswordForStoringInConfigFile (TextBox1 .Text ,"md5"); row[2]=0; ds.Tables [6].Rows .Add (row); DataRow row1; row1=ds.Tables [8].Rows [0]; row1.BeginEdit (); row1[0]+=","+TextBox1 .Text ; row1.EndEdit (); ds.WriteXml (Server .MapPath ("./../Web.config")); lblmsg.Text ="user registeed"; } catch(Exception ex) { lblmsg.Text ="error"+ex.Message ; } aslam
Well, do you have a web.config file there, or not ?
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert