.net - UserPrincipal.FindByIdentity Insists "There Is No Such Object On The Server"
Nov 10, 2011
I am currently aiming to implement a read-only role provider for an ASP.NET application based on domain security groups using the utilities in the System.DirectoryServices.AccountManagement assembly. I have the following piece of code which works fine on my development domain, but fails in the deployment environment:
Using myContext As New PrincipalContext(ContextType.Domain, Nothing, "DC=My,DC=Controller", accountName, accountPassword)
Try
Dim p As UserPrincipal = UserPrincipal.FindByIdentity(myContext, IdentityType.SamAccountName, userName)
[code]....
I know the obvious "gotcha" here is to be certain the object actually, well... exists on the server. However, I can confirm without a doubt that no matter which account's SAM Account Name I use, I receive the same result from the call. Additionally, Microsoft's ActiveDirectoryMembershipProvider has no trouble authenticating against the same SAM Account Name and I am able to find the object using that information with the DirectorySearcher class. The only differences I can identify between the development network and deployment is that the deployment environment's DC is a Windows Server 2003 box, whereas locally I am developing with a Windows Server 2008 DC. What might I be overlooking?
View 2 Replies
ADVERTISEMENT
Feb 14, 2012
I'm writing a simple function to verify if a given user or group exists in my domain, here is the code:
Dim ctxDomain As New PrincipalContext(ContextType.Domain)
Dim upX As UserPrincipal
upX = UserPrincipal.FindByIdentity(ctxDomain, IdentityType.SamAccountName, strUser[code].....
if I pass a user the function works well if I pass a group the function return always false, why?
View 1 Replies
Jan 25, 2012
I have an old programme that was written with 'option strict off' I have been steadily working through it mainly sorting out casting issues but have come up against some that I dont understand.for instance I have a checkbox called tickbox
dim Tickbox as new checkbox
later in the code
dim blah as boolean = Me.Tickbox.CheckState
but option strict insists i cast it as a boolean
dim blah as boolean = CBool(Me.Tickbox.CheckState)
surely the checkbox.checkstate is Booleean?
View 6 Replies
Jun 29, 2010
I'm writing a program which assists users update passwords for our windows systems and some other applications. Everything is working except when I call the UserPrincipal.Current.ChangePassword command cached credentials are not updated like they are when you change a password using the windows OS password change.
That is: when a remote user who is VPN'd in uses my application to change passwords, when they reboot and VPN is disconnected, they are forced to login to windows using there old password.
Is there a way I can force windows to update the cached credentials to the new password so upon reboot they are able to login using this new password?
View 1 Replies
Mar 4, 2010
Here is the code for the button click event;
Protected Sub CompetenciesButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CompetenciesButton.Click
Dim con As String = WebConfigurationManager.ConnectionStrings("foo").ToString()
[code].....
View 1 Replies
Mar 5, 2012
I need to create a COM object on server.In VB you can do this: (tutorial)xlApp = CreateObject("Excel.Application", "\MyServer")But how to do same thing on C#?I know how to do it locally: var infsrv = new InfoServ.TInfoServerClass();But don't know how to do it on server..
View 3 Replies
May 10, 2012
I have an no such object is found on the following code i reposted from my earlier code because I decided to start a new thread instead of post to the old one again:
Dim results1 As SearchResult
AD = New DirectoryEntry(LDAP://10.253.97.10/OU=TopOU,OU=Staff,DC=garrard,DC=ketsds,DC=net,"","", AuthenticationTypes.Secure)
AD2 = New DirectoryEntry("LDAP://10.253.97.10/OU=_Exchange Resources,OU=Staff,DC=garrard,DC=ketsds,DC=net", "", "", AuthenticationTypes.Secure)
[code]....
When running the code results1 = ADFind.FineOne returns no such object found on server from the above code Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt.
View 9 Replies
Jun 12, 2006
I am having problems calling a Com object that I created under Visual Studio 2005 with Standard ASP I registered it using regasm.exe.Below is my code (VB) . have tried creating the object two ways.What am I doing wrong ?
Server.CreateObject("TestCom2.TestFunction") and
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
[code].....
View 10 Replies
Oct 9, 2011
I want to make a button like this:The first image is a normal button, but the second is a button with mouseEnter event fired. The bottom part of the button in the second image is not clickable and it acts like a tool tip. How can I make this kind of a button? Do I need to use a tool tip? Please give me some code examples.
EDIT:Here's F Ruffel's code which I modified:
[code]...
Now the last problem is: the expanded part pushes all controls down, and that's what I don't want. Please modify this code to make the extended part overlay controls that are below it, just like in the image.
View 4 Replies
Oct 7, 2010
My project uses .NET remoting. The client connects to the server hosted in IIS to do database operations.
We have a class library that is referenced both by the client and the server. This contains basic static (shared) functions used throughout the project. An example would be a function that takes a customer/invoice number and pads it with zeros/spaces to our desired format. This works fine. There is a copy of the dll with the client and on the server in the IIS virtual directory. Both the server and the client can call these functions and they work correctly.
Now, in that same class library, I've defined two things: an enumeration (enum) and a serializable class. If I try to call a function on the server from the client that passes/returns an instance of either the enumeration or the class, I get the following
[Code]...
View 2 Replies
May 13, 2011
I am kinda new to VB, but have used C# to pull data from a SQL Server db using DataTables and Reader, etc, however I am at a loss as to how to accomplish this in VB.I have a variable, which the user specifies, that I wish to use as a parameter in a SQL string, much like the following: "SELECT x FROM y WHERE x = '@param'" The result will then be stored in a string variable and I wiill do what I have to do with it.
[code]...
View 9 Replies
Aug 10, 2010
I am trying to send an Arraylist over to my server to broadcast to all other clients but I am not sure after serializing it, how do I proceed to send across. [code]....
View 1 Replies
May 18, 2009
I am trying to read JSON data from a server to a dataset object, any idea on how this can be done. I have tried using the DataContractJsonSerializer class but it only seems to work for objects.
JSON Data
{
"firstName": "John",
"lastName": "Smith",
[code]....
The code above works to an object, but I want to parse the JSON data to a dataset object.
View 2 Replies
Dec 28, 2010
The context of this question is that I am trying to debug performance issues (apart from the obvious ones I already know about and can find).I inherited a code base (VB.NET) for an ASP.NET app. This is an app that was developed way back in .NET 1.1 days, and was the first .NET app for a lot of the developers who worked on it.
In this code base is a class called DatabaseUtility that contains several Shared Public methods as well as non-Shared Public Functions and Subs for CRUD operations to the database (SQL Server).
It is common in my "BL" that a method creates an instance of the DatabaseUtility which essentially figures out what the connection string should be and opens a connection, as well as giving the developer a handle to the other methods contained within it.Dim utility as New DatabaseUtility()
Once I have that, I start to create parameters that I am going to pass to one of the methods in DatabaseUtility (like GetDataSet). There is a Shared method in my DatabaseUtility called CreateParameter which does essentially that. It creates a SqlParameter object so I can add it to a Parameters collection.
Now, the code base is littered with a lot of this:
utility.CreateParameter(...)However, because CreateParameter is a Shared method, I am not sure what is going on behind the scenes. I know because it is a Shared member that an instance of the DatabaseUtility is not created when I call it like this:DatabaseUtility.CreateParameter(...)
However, because I am calling it from an instance (utility), does that change the behavior at all?
View 1 Replies
Oct 14, 2011
I am performing a simple exercise of opening an SQL Server database connection, pulling the first record of a table from a DataReader object, and then closing the object. However, I have noticed that theres bit of a delay, about 5 seconds or so, in closing the connection. However, the delay only occurs after the command object executes the specified query. I've worked in a setup like this before and don't remember there being such a long delay while closing the connection. [Code] The connection closes almost immediately. What gives? I have narrowed it down to the where the .ExecuteReader line that causes the delay in the connection close. Whats causing the delay and how do I resolve it?
View 2 Replies
Jun 9, 2008
I have a combobox where the user can type the sql server name. Then a connect button that, when the user click, I want it to populate another combobox with all the databases from the server in the previous combobox. Unfortunately, I am getting the error object reference is not set....!
Here is where I am getting the error:
For Each objDB As Database In Me.SMOServer.Databases
I am new to VB ...I'm using vb2008 connecting to sql server 2005.
Here is my complete code:
Imports Microsoft.SqlServer.Management.Smo
Imports Microsoft.SqlServer.Management.Common
Public Class Form1
'Public Class frmSQLConnection
Private m_objServer As Server
[Code] .....
View 1 Replies
Aug 14, 2010
Is it possible to spoof the referrer of a webbrowser object that is posting data to a server? I would change to WebRequests, but this needs to be done via a browser.
View 2 Replies
Jun 21, 2010
When i am running my ASP Page I got the following error.
Error Type:Server object, ASP 0177 (0x800401F3)
Invalid class string /Test/setup.asp, line 15
I register all required Dll's and I create the corresonding components too
View 3 Replies
Jan 16, 2012
I am trying to save a new object to the database using petapoco.I have an object that uses a Guid for the primary key.Here is an example of the objects primary key property.
<PetaPoco.Column()> _
Public ReadOnly Property Primkey() As Guid Implements IStandardDocument.Primkey
Get
[code]....
Here is an example of the save method.
database.Save("Reservations", "Primkey", reservation)
The sql that is generated is an update with a primkey of 00000000-0000-0000-0000-000000000000 instead of an insert. So new records are never inserted.If I have an existing object with a valid guid the update and delete all work correctly.
View 3 Replies
Aug 6, 2009
Simulating the web Client/web server interaction in a winform using a webbrowser object in vb2005.net
In short I'm using the web browser object as a gui for a giant treeview folder list, in the html there is a form that needs to submit to perform the action, del, rename, etc.
How do I make my program catch the submit, process it and spit out the new info out to the webbrowser item in vb2005 winform?
View 1 Replies
Jul 13, 2010
In my application, I've built an object that communicates with an OPC server and whenever the value of a certain OPC item changes, it logs all the OPC items to a database. This all works beautifully. However, I'm having a problem with disposing of the instances of this class. Whenever I want to remove an instance of this class from the application, I'm dereferencing the object (objDevice = Nothing) and letting GC take care of the rest. I've inserted breakpoints and am monitoring to ensure that the object is dereferenced (it is).
Problem is, even after the object has been dereferenced and is CONFIRMED to be equal to Nothing, the object is still logging data to the database. I'm still trying to get a handle on disposing of objects properly, but most everything I read tells me to dereference and let Garbage Collection take over.
View 5 Replies
Jul 10, 2010
I am somewhat new to object oriented programming and am attempting to flatten a Linq object hierarchy by using a shim class.how to initalize a derived class with property values from a base class?I have two objects, a base object with about 100 properties, and a derived object which inherits from the base object and adds a few additional properties beyond those of the base object. My simple constructor creates the derived object, but I am looking for a way to initialize the derived object properties with values from the base object.Right now I am using reflection to iterate over the properties individually and I suspect there may be a better way. The following example shows my shim class constructor for the derived class, and two properties:
newProperty1 - a new string property of the derived class
flattenedProperty2 - a new string property of the derived class, copied from a 2nd-level object of the base class
Code example:
Public Class derivedObj
Inherits baseObj
Private _newProperty1 As String[code].......
Is this the correct constructor approach to flatten the object hierarchy using a shim class? My second question relates to initialization of properties in the derived class. The constructor above creates the derived object, but what is the best way to initialize the derived object properties with values from the base object? The following code uses reflection to iterate over the properties individually, but I suspect there may be a better way.
Code example:
' property names are in the string array fieldNames
'baseObjQuery is an ienumerable of baseObj
'derivedObjList is a list of derivedObj[code].....
Is there a simple way to initialize values for the properties in the derived object based upon the values of the common properties in the base object?
View 7 Replies
May 23, 2011
Can I send an object from client-side javascript to server-side code via ASP.NET ?
View 5 Replies
Feb 1, 2007
Does anyone have an example of how to register an automation server in the ROT (Runtime Object Table) using IRunningObjectTable.Register and how to revoke it using IRunningObjectTable.Revoke?
View 1 Replies
Oct 7, 2011
I have this code
[Code]....
I keep getting an invalid object name orders_table error When I go directly to SQL Server and type in the insert statement, it works.
View 3 Replies
Dec 5, 2011
I made this procedure re-use a select query:
[code..]
And I use it like this if I would want the selected value placed in a textbox and it works fine
[code...]
However if I want the value to be passed in a string like so:
[code...]
The string ends up having an empty string value. How do I assign the value I queried to that String?
View 2 Replies
Dec 16, 2009
I have a couple of NET 2.0 projects on the go, but in one of them, I can't access the "Server" object to get at its HtmlEncode property. i.e Server.HtmlEncode("xxx") does not work.
I get the following error displayed in Visual Studio design time error log: "Local variable 'server' cannot be referred to before it is declared."
I have tried to add a manual reference to System.Web, but although the dll file is present, it doesn't add itself on - or at least it doesn't display on the "Add Reference" dialog as being added. BUT here is what's interesting - I can access other intrinsic objects such as "Request", "Response"...etc. All except "Server"!
View 2 Replies
Dec 16, 2009
I have a couple of NET 2.0 projects on the go, but in one of them, I can't access the "Server" object to get at its HtmlEncode property.i.e Server.HtmlEncode("xxx") does not work.
I get the following error displayed in Visual Studio design time error log: "Local variable 'server' cannot be referred to before it is declared." I have tried to add a manual reference to System.Web, but although the dll file is present, it doesn't add itself on - or at least it doesn't display on the "Add Reference" dialog as being added. BUT here is what's interesting - I can access other intrinsic objects such as "Request", "Response"...etc. All except "Server" This is only happening to 1 particular project. In other projects, I can access the "Server" object just fine.
View 1 Replies
Jun 21, 2010
I am getting this error saying "the call to the server.CreateObject falied while cheking permissions. Access is denied to this object".I get this error every time I create a new DLL after compiling my VB6 code and drop it in the component services.i am using these DLL's for the web application i am working on. Is this a DLL registration issue, or is this because the DLL is not being generated correctly. What are your thoughts on this? i have attached the error message for reference
View 1 Replies
Jul 29, 2011
I am getting following error whenever I want to use IIf function inside entity framework query.
LINQ to Entities does not recognize the method 'System.Object IIf(Boolean, System.Object, System.Object)' method, and this method cannot be translated into a store expression.
View 1 Replies