.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

Command arguments

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

i use greedvien and i want to have more tha one argument to passe how i do that????

                        <asp:LinkButton ID="AjoutLinkButton" runat="server" CommandName="Ajouter" CommandArgument='<%# Eval("idAgence") %>' >Ajouter</asp:LinkButton>
                        <asp:LinkButton ID="Modlink" runat="server" CommandName="Modifie" CommandArgument='<%# Eval("idAgence") %>' >Modifier</asp:LinkButton>
                        <asp:LinkButton ID="SuppLink" runat="server" CommandName="Supp" CommandArgument='<%# Eval("idAgence") %>'>Supprimer</asp:LinkButton>

View Complete Post

More Related Resource Links

Standard way to retrieve command line arguments



What is the most equivalent method to get the command line arguments in web, asp.net,

simmiliar to an executable file application?


Thanks :)

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

More Versioning Fun With Optional Arguments

In my last blog post , I covered some challenges with versioning methods that differ only by optional parameters. If you haven't read it, go read it. If I do say so myself, it's kind of interesting. ;) In this post, I want to cover another very subtle versioning issue with using optional parameters. At the very end of that last post, I made the following comment. By the way, you can add overloads that have additional required parameters. So in this way, you are in the same boat as before. However, this can lead to subtle bugs. Let's walk through a scenario. Imagine that some class library has the following method in version 1.0. public static void Foo( string s1, string s2, string s3 = "v1" ) { Console.WriteLine( "version 1"...(read more)

Versioning Issues With Optional Arguments

One nice new feature introduced in C# 4 is support for named and optional arguments . While these two features are often discussed together, they really are orthogonal concepts. Let's look at a quick example of these two concepts at work. Suppose we have a class with one method having the following signature. // v1 public static void Redirect( string url, string protocol = "http" ); This hypothetical library contains a single method that takes in two parameters, a required string url and an optional string protocol . The following shows the six possible ways this method can be called. HttpHelpers.Redirect( "http://haacked.com/" ); HttpHelpers.Redirect(url: "http://haacked.com/" ); HttpHelpers.Redirect( "http...(read more)

How to Post Code To Your Blog and other Religious Arguments

If you've got a programming blog, chances are you'll want to post some code snippets. Posting code sounds easy but it's surprisingly tricky if you consider all the ways that people will be reading your blog. There's a number of ways. Here's a few and their pros and cons . Copy Paste from your IDE (like Visual Studio, for example) If I copy paste directly from VS into my editor of choice, Windows Live Writer, I'll get a <pre> section. using System; namespace WindowsGame1 { #if WINDOWS || XBOX     static class Program     {         /// <summary>         /// The main entry point for the application.        ...(read more)

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

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 = "";

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

Process.Start - arguments length restriction to 2080 characters

Hi, I'm wondering why is there a limit to "The sum of the length of the arguments and the length of the full path to the process " to 2080? I see that the documentation says that a Win32Exception is thrown if this exceeds 2080 characters. Can someone please explain to me this limit? I'm trying to start a process and I have a lot of arguments to pass, and of course ... I exceed the limit of 2080.   Thanks, Ionut.

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