.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

function parameter description

Posted By:      Posted Date: October 26, 2010    Points: 0   Category :ASP.Net

I have written a function and want to add some description against each paratemeter it takes, how can i do this in vb.net?

Public Function GetTopNArticles(ByVal ArticleTypeID As String, ByVal NoOfArticlesReturned As String, ByVal ExcludingArticleIDs As String) As SqlDataReader

View Complete Post

More Related Resource Links

How can i pass function as parameter to show in gridview

Hello, I have one common Data Access function which returns output as dataset which is as below   Public Shared Function ExecuteDataSet(ByVal sql As String, ByVal type As CommandType, ByVal ParamArray parameters As SqlParameter()) As DataSetDim RetVal As Object = Nothing   Try Cmd = Cmd.Connection = OpenConnection() Cmd.CommandType = type Cmd.CommandText = sql Cmd.Parameters.AddRange(parameters) Sda = Ds = Sda.Fill(Ds)       New SqlCommand()New SqlDataAdapter(Cmd)New DataSetCatch ex As ExceptionThrow New Exception(ex.Message.ToString())Finally CloseConnection() Sda.Dispose() End Try   Return Ds End Function   this function normally i use to get data from database and returns to dataset   now,I want to created one more function which output type is gridview and its parameter is  dataset which i got output in previous funtion   i want like this public funtion BindDatatoGridView(ExecuteDataSet("SELECT...",commandType.text,Parameter....)) as GridView End Function   how can i solve this, please help me out

Report Parameter Values - Can I use getdate() or now() or any other function?

Hi all,      I have a report that utilizes a calendar function but I need to make it a subscription report. Is it possible to use getdate() or now() on the Report Parameter Values? I have a text box that says Enter a Date and that is where I want to have the default value to be run with the subscription. Please let  me know if possible. Thank you.

Can MVC attributes with a string parameter be fed a function returning a string?


Ok so take for instance this attribute:

[PropertiesMustMatch("NewPassword", "ConfirmPassword", ErrorMessage = "La nuova password e la password di conferma non corrispondono.")]

You can see that the third parameter is a string that I would want to localize, hence I would like to delete that message and replace it with a function call, say something along the lines of this:

[PropertiesMustMatch("NewPassword", "ConfirmPassword", ErrorMessage = GetLocalization("strErrPassMustMatch")]

Do you think it would be possible? If I got *any* chance to do it, then good, I will be setting up a system to do this :-P otherwise, I'll have to find some other way :-)

What can you tell me?

Thank you!


Function with output parameter



is it possible to create user define function with 3 output parameter. something like ref out parameter in C#.

Best Regards. Morteza


Retrieve function's output parameter




Is it a way to retrieve the particular function's list of output parameter fields?

the following is the sample code for the list of input parameter fields.

  FROM sys.objects vw
  INNER JOIN sys.parameters p ON p.object_id = vw.object_id
  WHERE vw.type IN (N'FN', N'IF', N'TF') and is_ms_shipped = 0


Meng Chew

Invalid length parameter passed to the SUBSTRING function


Hi all,

I am having a weird issue after we upgraded our DB server to SQL 2005.

I have a SP used to extract exchange rate, and a job calls this SP daily. This job worked fine on SQL 2000, and works very well in Management studio if I call this SP seperately, but failed in sql job in 2005.

The error statement pointed to:

select left(@row, charindex(',', @row)-1),  REVERSE(left(@reversedrow, charindex(',', @reversedrow)-1))

The error message is:

Invalid length parameter passed to the SUBSTRING function.

Anyone knows what's the difference for LEFT function between sql 2000 and 2005?


Enterprize library 4.1 getting output parameter after adding record in db, plz guide



I need to get output parameter (flag) from db after saving record in database. I am using Microsoft Enterprise Library 4.1 for DB. I am inserting record using I Data reader.

Please guide


Use a column as parameter for a sds in another column; gridview


Hola, I have a gridview which is bound to a sds which returns 7 columns and I added two columns from the GUI.  What I want is to fill up the 9th column with DDLs and these  DDLS will get their data from a different sds which is using a stored procedure with a single parameter.  I created the 9th row, used template field, made the sds for 9th row, the stored_procedure, threw a DDL in Item template and all  I need now is to pass a parameter in the first column to the sds in the 9th column.  I can code this but i'm getting tired of aspx.cs :) and would like to do it from the GUI.

Content page control passes as argument to javascript function


Here is the content page:


<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="JavaDynamicCopyValue.aspx.cs" Inherits="JavaDynamicCopyValue" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <script type="text/javascript" >
 function copyValue(input, output )
   ouput.value = input.value;
   return true;
 <asp:TextBox ID="txt1" runat="server" onchange="copyValue(this,document.getElementById('<%=txt2.ClientID%>'))"></asp:TextBox>
    <br />
    <br />
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>


I got a javascript run time error says output is undefined. if I view source of the page, the txt1 markup became:

<input name="ctl00$ContentPlaceHol

Sort by gridview SortExpression parameter via Stored Procedure


I have a gridview that calls data via a stored procedure.  I am unable to enable the gridview columns to be sortable. I need to set the parameter in the Stored Procedure, can someone help me with this?

Here is my gridview:

<asp:GridView ID="AllUsersGrid" runat="server" AutoGenerateColumns="False" DataKeyNames="UserName"
                        GridLines="Vertical" Width="900px" DataSourceID="SqlDataSource1" AllowSorting="True"
                        SelectedRowStyle-Height="30px" CellPadding="4" BackColor="White">
                            <asp:TemplateField HeaderText="Full Name" SortExpression="lastname">
                                    <asp:Label ID="DisplayName" runat="server" Text='<%# Eval("firstname").ToString() & " " & Eval("lastname").ToString() %>' />
                            <asp:BoundField HeaderText="User Name" DataField="UserName" />

type object parameter



I have a problem I can't figure out.

I've been trying to add a listbox with multi select enabled as a parameter to my select statement in sqldatasource.

So i created a function like this :

string strItemTypes = "";
foreach (ListItem li in lbItemType.Items)
   if (li.Selected)
      strItemTypes += "," + li.Value;
strItemTypes = strItemTypes.Substring(1);

which gives me the selected items like this for example : "1,2,3"...
Then I've been trying to add it to my sql select statement :

SELECT tblOfficesItems.idOfficesItems, tblStockItems.Name, tblStockItems.Description, tblStockItemTypes.TypeItem, tblStockItems.Notes FROM tblOfficesItems INNER JOIN tblStockItems ON tblOfficesItems.fkItem = tblStockItems.idItem INNER JOIN tblStockItemTypes ON tblStockItems.fkTypeItem = tblStockItemTypes.idTypeItem WHERE tblStockItems.fkTypeItem IN ( @fkTypeItems )

using a hiddenfield with a controlparameter of type=object
but it just don't seem to work, seems like the data just won't bind or something and I don't get any errors so I'm confused!!

then i tried this :

SELECT tblOfficesItems.idOfficesItems, tblStockItems.Name

connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly.


I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.

 I have two SQL Server instances installed.

 1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)

But when i try to add a database to my VS website project I get the following error:

Connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly. please verify the installation of the component or download from the URL: go.microsoft.com/fwlink/?linkId=4925

I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)

and changed the "SQLEXPRESS" to "USERLT\SQL2005".

But I still get the same error message. Any ideas how i can resolve this issue?

Public Shared function doubt????

I am using VB.net/ASP.NET and SQL Server 2000 for a web application.

For populating the dropdowns, I wrote a Public Shared function LoadDDL(), in which I pass the dataset and dropdown name to set.

I have my doubts that this function will produce unexpected results for concurrent users. And will mix the results among sessions because it is a Shared function.

I am confused here. Is it the right way to go?

Please advice. Thanks in advance.


MDX Query parameter from SSRS


I've a MDX Query that has where clause as shown below.
I'm designing report using SSRS 2008. How can i pass date as parameter ? I tried to setup @from and @to as parameter but not working ?
any ideas....

WHERE ( {[Date Central].[Calendar Date].[2010-04-01 00:00:00]:[Date Central].[Calendar Date].[2010-08-30 00:00:00]} )

need it to work as
WHERE ( {[Date Central].[Calendar Date].[@From]:[Date Central].[Calendar Date].[@To]} )



Get ServerReport selected Parameter value to use in vb query


I'm using ReportViewer in Asp.net 2.0 to view a SSRS report. I need the value of the selected parameter to use in a vb query. The parameters are populated on the server and its a single selection. Doing searches I've come across  ReportViewer1.ServerReport.GetParameters() but I can't figure out if I can use this to determine which value the user has selected in the parameter dropdownlist. Any help would be appreciated.

Crystal Report parameter value window.


 Hi friends,

   I am using Crystal report which displays the result of stroed procedure which have 2 paramater.

  When i run report it shows two window for getting each parameter.

  My need is, can i have one window for getting all the paramter value for stored procedure.


  With Advanced thanks,






Crystal Report vs 2003 convert to vs 2008 parameter problem


Hi friend,

I have a project develop with Visual Studio 2003, when i convert the project to Visual Studio 2005 is work well. But when i convert to Visual Studio 2008, the crystal report when have pass parameter will prompt the parameter field to re-type then show the report.

But in this converted project i create a new report and pass the parameter is ok. That means i wan re-do all report @.@??

Does someone can help me solve this problem??

Thank you

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