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

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

why do I Still getthe command is incorrect?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ADO.Net

This is what I typed in after the C:\Windows\system32 promt


<customErrors mode="Off" />

View Complete Post

More Related Resource Links

Row command working on all rows not selected one?



I have this code that hides a column in a gridview.  (The column houses another nested gridview).

    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
        If e.CommandName = "Select" Then
            If GridView1.Columns(0).Visible = False Then
                GridView1.Columns(0).Visible = True
                GridView1.Columns(0).Visible = False
            End If
        End If
    End Sub

The trouble is that if I click the select link on one row that action to hide is carried out on all rows.  How can I set this up so that it only hides the row that is selected?


Print command



Is there a way of setting up a print area for a part of my webpage, I only want to print a certain part of the page, when I select print at the moment it will print the whole page and the layout is rubbish!!

command object error


Could someone please tell me what is wrong with my syntax here?  I'd be much appreciative.


objCmd = New SQLCommand("SELECT CASE WHEN objDR('Item') = 'Enter Bill of Lading' then enterbol " _  

& "WHEN objDR('Item') = 'Bill of Lading History' THEN bolhistory " _  

& "WHEN objDR('Item') = 'Request Transfer' or objDR('Item') = 'View Transfer in Progress' THEN transfers " _  

& "END  from plantGroups where plantgroupid=@plantgroupid", objConn)

Design Patterns: Simplify Distributed System Design Using the Command Pattern, MSMQ, and .NET


Service-oriented architecture is a great framework when you need to perform distributed computing tasks over the Internet. But when you want to perform processing inside your local network, a different solution may provide a better fit. That solution, based on the Command pattern, uses Windows services and Microsoft Message Queuing to implement a queued system that meets your needs better than a service-oriented solution. This article explains how to build it.

Brad King

MSDN Magazine September 2004

Command Management: Use Design Patterns to Simplify the Relationship Between Menus and Form Elements


In Windows Forms applications, similar commands, such as those in a menu and their counterparts on a toolbar, are not automatically related. They don't fire the same event or run the same handler routine. Yet code that allows the same or similar user commands to fire the same code simplifies development.This article describes the principles of command management and why it's important to have functional commands that are not exclusive to any one UI element. In order to provide an MFC-like command management infrastructure, a design pattern is developed and applied as a series of C# classes.

Michael Foster and Gilberto Araya

MSDN Magazine October 2002

override error message (The value 'test' is not valid for Age) when input incorrect data type for in


Hello everyone,

I've tried to override error message when input incorrect data type in input field on HTML form. For example I have the model like this.

public class Person
public string FirstName {get;set;}
public int Age {get;set;}


For view, I put text input for Age to get it value.

When type some string in Age text box like 'test' and press submit button. I got this error message

The value 'xxx' is not valid for Age

However, I want to change this message and try many way. There 's nothing effect this message value.

Please could you help me to solve this problem.

Menu items of Welcome control behaves incorrect in non-IE browsers.


We are using wss 3.0 sp2

I am referring to the welcome control that is part of standard sharepoint pages. This is the in the masterpage. The welcome contrrol has options such as 'sign-in as different user' , 'signout' and so on. When user takes the mouse and tries to click on the sub-menu it doesn't work as if the menu item is not getting focussed (however up/down arrow with keyboard works fine). 

I know that sharepoint sites are not best when viewed with firefox, safari, chrome etc  but is there a fix for this? Is it do with 'z' index setting or something? Can this be fixed through javascript?  

Please share your views/solution.


stsadm Import command + include user security



When I move sites from test to staging to production, I am using the stsadm –o export command with the –includeusersecurity option in the staging environment.  In production environment, I then use the stsadm –o import command with the –includeusersecurity option.  I was assuming that this option was bringing over the security on the exported site only.  This does not seem to be the case.

Last night I exported one sub site to produtction.  Today, I was notified that the security groups on other sub sites have been altered.  


So why is it when using the –includeusersecurity option effect all sub sites and not just the one sub site being moved from staging to production

Executing Command Logic in a View Model

Through the use of the Windows Presentation Foundation's (WPF) advanced data-binding capabilities, the logical structure of a user interface can relatively easily be disconnected from its presentation. Bindable components can now contain nearly all of an application's user interface logic and in most circumstances, replace the need for controller objects from the classic Model-View-Controller (MVC) pattern. So it's no wonder that a new pattern for UI design has appeared

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:


There is already an open DataReader associated with this Command which must be closed first.


when i insert record

There is already an open DataReader associated with this Command which must be closed first.

help me.

SqlConnection conn = new SqlConnection(@"Data Source=Localhost\SQLEXPRESS;Initial Catalog=StudentDetails;Integrated Security=True");

SqlCommand cmd2 = new SqlCommand();
SqlCommand cmd1 = new SqlCommand();

if (conn.State == ConnectionState.Closed)

cmd2 = new SqlCommand("Select * from UserInfo where Standard", conn);
            SqlDataReader dr1 = cmd2.ExecuteReader();
            string stu, par,std,sec,roll;
            par = "";
            stu = "";
            std = "";

Incorrect syntax near "("


Hi, below is a sub I wrote to run an SQLDataSource UpdateCommand. This is customized layer of a createUserWizard. I know I should probably have another table for the addt'l data and just FK the UserId...but I'd rather update the existing record and add the data to the existing row in the user (membership) table.

Can someone tell me what I'm doing wrong on this sub. The error is at the last line, "DataSource.Update()"


 Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As EventArgs)
        FormsAuthentication.SetAuthCookie(CreateUserWizard1.UserName, False)

        Dim UserNameTextBox As TextBox = DirectCast(CreateUserWizardStep2.ContentTemplateContainer.FindControl("UserName"), TextBox)
        Dim DataSource As SqlDataSource = DirectCast(CreateUserWizardStep2.ContentTemplateContainer.FindControl("InsertExtraInfo"), SqlDataSource)

        Dim User As MembershipUser = Membership.GetUser(UserNameTextBox.Text)
        Dim UserGUID As Object = User.ProviderUserKey

        DataSource.UpdateParameters.Add("UserId", UserGUID.ToString())

End Sub



Incorrect Sytax ????


Can someone give me a fresh set of eyes and tell me what they see wrong?? I am getting error ... "Incorrect syntax near "Where" "

Dim Query As String = Request.QueryString("WhichImage").ToString

datasource.UpdateCommand = "Update ImageName SET" & " " & Query & " " & "Where" & " " & Query & "=" & Query & " " & "ImageName=ImageName" & ";"

Query Command to Report


I would like to generate a crystal report showing the report data based on my custom SQL query.

Where I can provide my SQL query or stored procedure.

Please give me good tutorial links on this too.

Thanks in advance.

Localization for command text Microsoft Ribbon for WPF

Hello, Is there any way I can localize the command text that comes with the ribbon, like the commands in the Ribbon context menu?   Add to Quick Access Toolbar Add gallery to Quick Access Toolbar Remove from Quick Access Toolbar Show Quick Access Toolbar above the Ribbon Show Quick Access Toolbar below the Ribbon Minimize the Ribbon Maximize the Ribbon   I got this list from the Source -- \Resources\ExceptionStringTable.txt

Command - Hyperlink

Why does the command work when I use it in a button, but not in the hyperlink? They are both bound the same way and named the same...             <Border Grid.Column="0" Width="170"                     Background="WhiteSmoke" BorderBrush="Lightgray" BorderThickness="1" CornerRadius="5" SnapsToDevicePixels="True">             <TreeView>                <TreeViewItem Header="Provinces">                   <Button Content="Show All Provinces" Command="{Binding Path=Command_ShowAllProvinces}" />                                     <Hyperlink Command="{Binding Path=Command_ShowAllProvinces}">                      <TextBlock T

Output parameters in OLEDB Command component - SSIS 2008

I have a package that I developed in SSIS 2005 and recently ported to 2008. Everything runs great except an OLE DB Command component that calls a stored procedure that uses output parameters. When I try to run this, I get this error: Error: 0xC0202009 at Data Flow Task, OLE DB Command [100]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Syntax error, permission violation, or other nonspecific error". Error: 0xC004701A at Data Flow Task, SSIS.Pipeline: component "OLE DB Command" (100) failed the pre-execute phase and returned error code 0xC0202009. When I do the same thing in SSIS2005, it works fine. So I setup a new package with 1 data flow. In that data flow, I added a source component, an OLE DB Command, and a destination.  I then tested this with a stored procedure that took no parameters. It worked fine. I then tested it with a stored procedure with 1 parameter defined as OUTPUT. This generated the error.   Is there an issue with output parameters in an OLE DB Command in SSIS 2008?   Thanks!http://bobp1339.blogspot.com
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