.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Error: Invalid dn syntax specified

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net


I tried to use Authentication form with LDAP but when I run
my web application I received error: Invalid dn syntax specified. This is my code:

public bool IsAuthenticated(string domain, string username, string password)
// string domainAndUsername = domain + @"\" + username;
string domainAndUsername = "http://localhost:389\rjsmith";
// DirectoryEntry entry = new DirectoryEntry(_path, domainAndUsername, password);// _path = LDAP://localhost:389/dc=example,dc=com
DirectoryEntry entry = new DirectoryEntry("LDAP://localhost:389",domainAndUsername,"rJsmitH");
Object obj = entry.NativeObject;
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(SAMAccountName=" + username + ")";

SearchResult result = search.FindOne();

if(null == result)
return false;
_path = result.Path;
_filterAttribute = (String)result.Properties[&quo

View Complete Post

More Related Resource Links

invalid syntax near '/' error


First time using parameters, not having much luck.

Keep getting 'invalide syntax near '/' when trying this code.

Any idea what might be the issue?:

string strConnString = ConfigurationManager.ConnectionStrings["WebConfigConnectionString"].ConnectionString;
            SqlConnection sqlConn = new SqlConnection(strConnString);
            SqlCommand sqlComm = new SqlCommand();
            sqlComm = sqlConn.CreateCommand();
            sqlComm.CommandText = @"DELETE FROM Assets WHERE Image = @/Images/mypic1.jpg";
            sqlComm.Parameters.Add("@/Images/mypic1.jpg", SqlDbType.NVarChar);
            sqlComm.Parameters["@/Images/mypic1.jpg"].Value = "Image";

Syntax error (missing operator) in query expression

Good Day Gurus!

I have a Excel user application which has a user form (named 'Registo') that displays criteria and an image that has been entered in it's corresponding spreadsheet. This works the way it should.  There's also the ability to search the spreadsheet via a form (by clicking 'Pesquisar' button) this opens a search form. However, I having a bit of a problem with it. When I try to search for something it basically doesn't do anything at all. It just sits there. So I tried to debug it and I think I'm having a problem with either the JET db engine or somethign with teh query or maybe I don't have the correct reference.

I 'borrowed' this Excel application from another forum because it's exactly what I'm looking for! However, I suck at vb.

So I was hoping somebody could take a look at the code and see if I'm missing something?  I'm kinda' desparate to get this working because I'm been trying to figure it out for days and I'm running out of time.  Cry
Option Explicit

'constantes para auxiliar na verificação do código
Private Const Ascendente As Byte = 0

Linq2Sql error: "Invalid attempt to call Read when reader is closed."


I've read up on this error from other posts and on other sites, but haven't found a solid resolution to the issue yet. My setup is as follows:

I have a RepositoryBase class that fields certain db calls that all repositories need to perform. In one such call, "GetSecurityGroup", it works most of the time, but will seemingly at random throw an exception with the error "Invalid attempt to call Read when reader is closed." All other Repository classes inherit from this one, and they all use the same DataContext object, which I understand isn't thread safe. Since there could be multiple calls to the DataContext object on the same page, perhaps one is using the DataContext when the next tries to do so. I'm not sure. What can I do to ensure this doesn't happen?

WebResource.axd - Padding is invalid and cannot be removed error



I'm working on a site that is hosted externally, and the admin just sent me an email syaing they're getting this following error:


Event code: 3005 

Event message: An unhandled exception has occurred.

Event time: 11/17/2008 8:11:24 AM

Event time (UTC): 11/17/2008 8:11:24 AM

Event ID: 5d3b54c09a24463ca8fb03f22692e0bb

Event sequence: 731

Event occurrence: 3

Event detail code: 0

Application information:

Application domain: /LM/W3SVC/1776482879/ROOT-1-128713348984007217

Trust level: Full

Application Virtual Path: /

Application Path: D:\....

Machine name: ****

Process information:

Process ID: 2272

Process name: w3wp.exe

Account name: ****

Exception information:

Exception type: CryptographicException

Exception message: Padding is invalid and cannot be removed.

Request information:

Request URL: http://sitename/WebResource.axd?d=_O9D297IUE-qcgMP0yFe-w2&t=633468747532779057

Request path: /WebResource.axd

User host address:


Is authenticated: False

Authentication Type:

Thread ac

Incorrect syntax near 'GO' error while running a sql script ?


I am using Visual Studio 2008

I have one Database A

now i want to create Database B just like Database A

I generated a script of Database A

and created fresh Database B

Now, when i try to run the generated script against Database B, i get this error, why ? how to fix it ?

sql error

For your information:

I have checked in my script it is:


and i have also tried to save the sql script in notepad as: ANSI, UTF-8 and UNICODE

and then i copied from txt file to query but still doesn't work and getting the same error

and these are the option that i selected/used while creating my script:


syntax error in calling mailhelper class??


I use to program with VB.NEt. I am just learning C#.  I need to learn C# b/c I am a SharePoint developer and Admin and thats what SharePoint is coded from.


so I am trying to create a simple form that sends an email but am getting an error with calling this function:

       mailHelper.SendMailMessage("admin@pointeightpower.com", "jstevens@pointeightpower.com", null, null, "August Heat Stress", String.Concat(txtSupervisorName.Text.Trim, "reviewed this month's training on ", System.DateTime.Now));


it says param string has some invalid arguements. I dont know why. it works in VB.Net. any help? Thanks

While dispose the com+, encounter error: failed due to the following error: Old format or invalid ty

I have web service to invoke com+ to do business layer checking. recently, the application encountered intermittently the following error while tried to dispose the com+ instance. Appreciate anyone who help for this. thanks!   System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'System.IDisposable'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{805D7A98-D4AF-3F0F-967F-E5CF45312D2C}' failed due to the following error: Old format or invalid type library. (Exception from HRESULT: 0x80028019 (TYPE_E_UNSUPFORMAT)).   Server stack trace:    at System.IDisposable.Dispose()    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)    at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)    at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)   Exception rethrown at [0]:    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage

XML Task error message hexadecimal invalid character

I am developing a SSIS package to add data from an XML file to an existing SQL Server table.  I have completed several similar projects, but on this XML file I am getting the error from the Data Flow tab between the XML Task and Data Flow Task: Error: 0xC002F304 at XML Task, XML Task: An error occurred with the following error message: "'', hexadecimal value 0x15, is an invalid character. Line 28, position 54.". Error: 0xC002928F at XML Task, XML Task: Property "New Source" has no source Xml text; Xml Text is either invalid, null or empty string. Task failed: XML Task Warning: 0x80019002 at zSTU_TS_Element: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (2) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. SSIS package "zStu_TS_Element.dtsx" finished: Failure. Do you know how I can fix this? This is the line it is referring to: <z:row c0='12' c1='80' c2='2006-04-17' c3='539' c4='1M2083N4N5N6N75800901110 11 '/>

Trying to use distrib but gets error, invalid column name 'publisher'

I have a pull subscription setup between sql server standard 2005 and windows 7 sql server 2008 express. When I run the distrib exe I get the error "invalid column name 'publisher'". I have searched the internet for a solution to this problem and keep coming up empty. Can someone help me debug this error?

LINQ to SQL compiler error CS1519: Invalid token 'void' in class, struct, or interface member decl

I get the following compiler errors when creating my first LINQ to SQL class (I just dragged a table "ProfileExtended" onto the designer and hit build):DataClasses.designer.cs(31,11): error CS1519: Invalid token 'void' in class, struct, or interface member declaration these are the offending lines of autogenerated code:#region Extensibility Method Definitions  partial void OnCreated();  partial void InsertProfileExtended(ProfileExtended instance);  partial void UpdateProfileExtended(ProfileExtended instance);  partial void DeleteProfileExtended(ProfileExtended instance);  #endregion

Strange Problem - SSIS Fails with "Syntax error, permission violation, or other nonspecific error".

Hello, I have a strange issue while I am deploying a package to one of the environment server. I have 2 XML Source, in the DataFlow, and one will extracted based on a value of variable that is passed from run time (package is executed from a Job) and other will be extracted all time. The next Step I have is a Execute SQL Task in ControlFlow wihich will execute after DataFlow. This has 2 input parameters and some SQL query that uses the param. Now this one fail on the target environment with below error: failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. I got the error when I did a SSIS Text File Log. Note: If I run the package in BIDS with the same XML files it work. Also when I deploy the package to my Dev Server it works. When I compare the Dev DB with the target environment DB - Both are same. The Service Acount has permission - as I can see the DataFlow task completed. Another Point: The XML Load Data Flow that executes based on the Variable Value does not execute on target environment, even if the value is passed as "True" (It is Boolean Type) But this variable is NOT an input for the Execute SQL task that fails. I am not sure w

The specified view is invalid error when browsing for images

Hello All, Currently using MOSS 2007 publishing site and using the CMS elements to publish content to the web.  One of our users is experiencing a strange problem whereby when they try to insert an image into the Sharepoint content editor using the Insert Picture functionality they get the following error when trying to browse to an image: The specified view is invalid.   at Microsoft.Sharepoint.SPViewCollection.get_Item(String strDisplayName) at Microsoft.Sharepoint.Publishing.Internal.States.AssetPickerDetailState.InitGridView(GridView grid) at Microsoft.Sharepoint.Publishing.Internal.States.AssetPickerDetailState.Configure(SMObjectList objectlist) at Microsoft.Sharepoint.Publishing.Internal.WebControls.SMObjectList.Handle_LoadCompleteEvent(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Page.OnLoadComplete(EventArgs e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) Only one user is experiencing this problem, others are fine. Does anyone have ANY ideas what is causing this issue or how to fix it? Thanks

Invalid object error on temp table on a particular environment

Hi, I am using a temp table in my sp. I have written the following tsql before and after using the temp table. IF OBJECT_ID('tempdb..##TEMP') IS NOT NULL DROP TABLE tempdb..##TEMP; Data will be inserted to the temp table consecutively using a cursor. I use SELECT * INTO tempdb..##TEMP FROM EXEC('query') to fill this temp table for the first time and INSERT INTO tempdb..##TEMP(<fields>) EXEC('query') for the remaining times. The SP is working fine in my laptop, but I am getting an Invalid Object error on this temp table name in the production server. Could anyone tell me the possible causes please? Thanks Sree

Invalid URL error on InfoPath Form Publish on an External List

I am using SP2010 Enterprise on Windows 7 and SPD 2010 & InfoPath 2010 all on the same machine in test.  I create an External List based on a ECT and Click on the 'Design Forms in InfoPath' icon and 'Item' which drops down from it.  That launches InfoPath Designer 2010 & downloads the form from http://<site>/lists/<mylistname>/Item/template.xsn and sets you up in an edit session.  I can make changes on the form but when I publish via File | Publish | External List (Publish Form To An External List) I get a save prompt for local copy & then an error: The following URL is not valid: http://<site>/lists/<mylistname>/Item/template.xsn  (same URL as it started with during the initial download). I took screen shots of the messages to make sure. Some things I have tried & observations: If I change to an internal Custom List the publish step (to list not external of course) works just fine. I also ran this test launching SPD as Administrator with no difference.  I stopped the System Event Notification service per http://serena-yeoh.blogspot.com/2006/08/infopathformurlnotvalid.html  'net stop sens' with no difference Any ideas are welcome. BTW I notice that this step of launching the InfoPath designer does change the form on the list in Sharepoint albeit slightly -

A MOF syntax error occurred - SQL Server ENT 2008 R2 on Windows Server 2008 R2

Having trouble getting SQL Server 2008 R2 installed on a Windows Server 2008 R2. Getting an MOF syntax error at this point durring the installation "SqlEngineConfigAction_install_confignonrc_Cpu64". Below is the section of the Details.txt file that includes the error. Any help on this would be greatly appreciated.   2010-07-28 10:51:35 Slp: Running: C:\Windows\system32\WBEM\mofcomp.exe "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\xesospkg.mof" 2010-07-28 10:51:35 Slp: Microsoft (R) MOF Compiler Version 6.1.7600.16385 2010-07-28 10:51:35 Slp: Copyright (c) Microsoft Corp. 1997-2006. All rights reserved. 2010-07-28 10:51:35 Slp: Parsing MOF file: C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\xesospkg.mof 2010-07-28 10:51:35 Slp: MOF file has been successfully parsed 2010-07-28 10:51:35 Slp: Storing data in the repository... 2010-07-28 10:51:36 Slp: An error occurred while processing item 17 defined on lines 201 - 222 in file C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\xesospkg.mof: 2010-07-28 10:51:36 Slp: Compiler returned error 0x800706beError Number: 0x800706be, Facility: Win32 2010-07-28 10:51:36 Slp: Description: The remote procedure call failed. 2010-07-28 10:51:36 Slp: 2010-07-28 10:51:36 Slp: Sco: Compile operation for mof file C:\Program Files\Microsoft SQL S

Drilldown Causes Error: Invalid offset for item.

I have a SSRS 2008 R2 Tablix with two date parameters (StartDate and EndDate). The report generates fine no matter the date range. With a small date range selected (say 1 week) the column/row drilldowns work perfectly. But when I select a wider date range (say a month) and drill into one of the columns I get the following error: An internal error occurred on the report server. See the error log for more details. (rsInternalError) I took a look at the ExecutionLog and the Status showed as rsSuccess for this execution. I then looked in the Error Log and found:  library!ReportServer_0-18!1ba8!09/10/2010-06:22:23:: i INFO: RenderFromSession('/ExigoReports/SalesByStateWarehouse') library!ReportServer_0-18!1ba8!09/10/2010-06:22:24:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: Invalid offset for item. ReferenceID: fffffffffffffbdc, Offset: -1060, Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details.; library!ReportServer_0-18!1ba8!09/10/2010-06:22:30:: i INFO: Exception InternalCatalogException dumped to: C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\Logfiles flags= ReferencedMemory, AllThreads, SendToWatson library!ReportServer_0-18!1ba8!09/10/2010-06:22:30:: w WARN: Microsoft.Re

Error occurred in deployment step 'Activate Features': Invalid field name.

Hi, I've a empty sharepoint project where i've added a content type that looks like this: <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Field ID="{45067EC7-078C-46A1-A075-E422C000215E}" Name="Schedule" DisplayName="Schedule" Group="Custom Fields" Type="Choice" Required="TRUE"> <CHOICES> <CHOICE>Minute</CHOICE> <CHOICE>Hour</CHOICE> <CHOICE>Day</CHOICE> </CHOICES> <Default>Hour</Default> </Field> <Field ID="{938CAAA4-C1AD-4E39-93D8-9C463391E006}" Name="Interval" DisplayName="Interval" Group="Custom Fields" Type="Integer" Required="TRUE" /> <Field ID="{3AD33CEA-6382-4BEE-8BB2-1C0902F13472}" Name="LastRun" DisplayName="Last Run" Group="Custom Fields" Type="Text" MaxLength="255" Required="FALSE" ReadOnly="TRUE" ShowInDisplayForm="TRUE" /> <!-- Parent ContentType: Document (0x0101) --> <ContentType ID="0x010100c293443c01ed4ac893ea199180df0244" Name="My Content Type" Group="Custom Content Types" Description=&quo
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend