System.Web.UI.WebControls.TextBox st6=new System.Web.UI.WebControls.TextBox(); st6=(System.Web.UI.WebControls.TextBox)e.Item.Cells[0].FindControl("txtname"); SqlCommand myCommand=new SqlCommand();myCommand.Connection=con;myCommand.CommandText="insert into DashBoard (ObjectiveAchieved,Objective,MoodToday,Name) values (@ObjectiveAchieved, @Objective,@MoodToday,@Name)"; myCommand.Parameters.Add(new SqlParameter("@Name",SqlDbType.Text)); string DomainUser=System.Security.Principal.WindowsIdentity.GetCurrent().Name.Replace("\ \","/"); System.DirectoryServices.DirectoryEntry ADEntry = new System.DirectoryServices.DirectoryEntry("WinNT://"+DomainUser); myCommand.Parameters["@Name"].Value=st6.Text=(ADEntry.Properties["FullName"].Value.ToString());
Where could I be going wrong? Thanks