I'm getting the error on this line:
myCommand.Parameters["@Name"].Value=
st6.Text=(ADEntry.Properties["FullName"].Value.ToString());
I'm using windows authentication and the whole code is:
System.Web.UI.WebControls.TextBox st6=new
System.Web.UI.WebControls.TextBox();
st6=(System.Web.UI.WebControls.TextBox)e.Item.Cells[0].FindControl("txtname");
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());
and the Stack Trace:
[COMException (0x80070035): The network path was not found]
System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
+703
System.DirectoryServices.DirectoryEntry.Bind() +10
System.DirectoryServices.DirectoryEntry.get_AdsObject() +10
System.DirectoryServices.PropertyValueCollection.PopulateList()
+234
System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry
entry, String propertyName) +56
System.DirectoryServices.PropertyCollection.get_Item(String
propertyName) +97
Dash_Board.DashBoard.dgis_ItemCommand(Object source,
DataGridCommandEventArgs e) in c:\inetpub\wwwroot\dash_board
\dashboard.aspx.cs:156
System.Web.UI.WebControls.DataGrid.OnUpdateCommand(DataGridCommandEventArgs
e) +109
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source,
EventArgs e) +507
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs
args) +26
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source,
EventArgs e) +106
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs
args) +26
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
+121
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +115
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+138
System.Web.UI.Page.ProcessRequestMain() +1292