.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

Inserting Property values of class into ParamArray parameters as object()

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

Hi All,

Using the properties as defined in a class, how about can I put them into the ParamArray parameters argument of my function.

The code as follows:

Public Class MyObject

   Public Property Prop1 as string

   Public Property Prop2 as integer

   Public Property Prop3 as Boolean

   Public Sub  AddNewMyObject

        MsSQL_ExecuteNonQuery("StoredProc_AddNewMyObject", ________________?)

   End Sub

End Class

Protected Function MsSQL_ExecuteNonQuery(ByVal storedProc as string, ByVal ParamArray parameters as object())

'Some Code here.

End Function

Please kindly help and advice.

Thank you in advance.

Warmest Regards,


View Complete Post

More Related Resource Links

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

Building a Custom Data Grid: Performing Ad Hoc Web Reporting with a VBScript 5.0 Class Object


A flexible, customizable grid for displaying data is a useful tool for ASP developers. It allows Web visitors to customize their view of your data. This article takes the data grid presented in "Ad Hoc Web Reporting with ADO 2.0" by John Papa and Charles Caison (MIND, December 1998) and adds handy features such as a finds feature that supports multiple finds and a mode for adding and editing records. This version also improves response time by allowing asynchronous record download and it componentizes the code so it can be used as a standalone VBScript class object that can be reused in other pages.

Randall Kindig

MSDN Magazine July 2000

send data in class object from one page to another using session


hello everybody

now i hav stored all data like user name, data fatched from database of that user

and i stored that data and user name such as:

string strUserName="user name"

dataset ds =new dataset();// data of that user

now i wan yo send d whole data from my login page to user profile page

can anybody help me for that...................

and plz tell me that how much is this way is benifitial to send data from one page to another page

plz........kindly waiting for positive rply

Object or Property is not supported in IE8 - javascript error



I am using following code line in my web app through external javascript file.






both these methods are working fine in IE6 but failing in IE8 with a error: "Object or Property is not supported".


any solution would be appreciated!



passing object values from server to client problem


I get a message that x_login is not declared.  I added Dim login as String = "123", but that didn't help.  What's the problem?

code behind....

Dim Login = "123"
x_login.Value = loginID


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<form id="simForm" runat="server" method='post' action='https://test.authorize.net/gateway/transact.dll'>
        <input id="HiddenValue" type="hidden" value="Initial Value" runat="server" />
        <input type='hidden' runat="server" name='x_login' id='x_login' />
        <input type='submit' runat="server" id='buttonLabel' />



Optional Parameters - Not taking values when supplied

All, I have a report that takes 2 optional parameters, one int and one datetime. My data tab is set up as follows: CommandType = Text, Parameters has Parameters.Value etc. for both. Report Parameters are allowed NULL value, Default Value is NULL, datatypes are Integer and Datetime as well. This only runs when the parameters are not supplied values, when I enter a date, it does not take it into account, same for the int value. I have run the proc manually to verify that the query is set up correctly, it seems like the values are not being passed? Any help debugging this would be helpful. Thanks.

Getting "wrong" data out of a microsoft.sqlserver.management.smo.database object property (using pow

My problem:I do something like this:$dbsvr = new-object microsoft.sqlserver.management.smo.server "servername"$dbsvr.databases | ft name,size -autosizeWhen i run this from two different PC's i get database sizes that are all the same (5.25 mb), the size of the first database listed - which is master.I started to try out a few things, and found out that when i run the same command from one of our servers it returns the correct sizes...Anyone have any idea if this a SMO issue, or maybe some package software version issue...- or what?

Passing Multiple Parameters in NavigateURL Property of Hyperlink

In ASP.NET 3.5, is this the only way to pass Multiple Parameters in NavigateURL Property of Hyperlink ? What about using the HyperlinkField?<asp:TemplateField HeaderText="Form Name">    <ItemTemplate>        <asp:HyperLink ID="HyperLink2" runat="server"         NavigateUrl='<%# "~/Application/" + Eval("FormType") + ".aspx?FormID=" + Eval("FormID") %>'         Text='<%# Eval("FormName") %>'>                </asp:HyperLink>     </ItemTemplate></asp:TemplateField>

Error "Object reference not set" when I try to set a Navigation Property

I'm using Entity Framework. The following code throws a runtime error "System.NullReferenceException: Object reference not set to an instance of an object." The line before the error, it looks like newControl is in fact instantiated.My model has a Control entity and a ControlType entity. Control includes the Navigation Property "ControlType." I'm trying to set ControlType.Type = 2.SurveyFormControlsModel.Control newControl = new SurveyFormControlsModel.Control(); newControl = CreateControl(childTokenName, ControlTypeEnum.TextBox); newControl.ControlType.Type = 2; // <<--ERROR HERE context.Controls.AddObject(newControl);                                SurveyFormControlsModel.Control newControl = new SurveyFormControlsModel.Control();                                 if (listItems.Count == 0)                                 {                                     newControl = CreateControl(childTokenName, ControlTypeEnum.TextBox);                    &

SelectMethod property missing from DomainDataSource class

I have an issue using WCF RIA with ASP.NET. I can't find the SelectMethod property of the Microsoft.Web.UI.WebControls.DomainDataSource class. What happened to this property? Am I using the wrong class?  I'm using VS2010 with the latest versions of Silverlight 4 Tools and RIA Services Toolkit installed. Any help with this would be greatly appreciated. Cheers, Simon

Object does not support this property or method....

This is a pretty straightforward piece of code. Why am I getting this error on line 5 char1?<script type="text/javascript"> function resubmit() { var recip = document.getElementById("web_recip"); var ind=recip.indexof("?resubmit"); if (ind>0){ recip=recip.replace("?resubmit",""); var resub=document.getElementById("resub"); resub.value="Y"; } } </script>  

how to get the value of a class property using reflection?

i have a class like this..public class MyClass{List<ValueObjectClass> SampleList {get; set;}...}how can i get the value of MyClass.SampleList using reflection and convert it to List<T>?thanks..

Referenced WebService, class constructor with parameters

Hi, I have WebService which is referenced in C# ClassLibrary project. In WebService project I have a class named User, which has two constructors - one without parameters and one whith parameters. When I try to create instance of User class from WS in ClassLibrary, I can use only constructor with parameters. My question is, how can I use in constructor with parameters like User u = new User("some@email.com", ...);. Any idea? Thansk

Calling a method with a class object as parameter data type.

   [WebMethod]    public string GetInfo(Customer inCust)    {        // Code in here    } I have a web service that resides on a remote server. I want to call a public method of theweb service named  "GetInfo". The method is shown above. The web service method expects a class object oftype "Customer". What I did to create a Customer object was to define in my asp.net project my own class named "Customer" which is exactlythe same as the class that belongs to the web service project on the remote server. I then created an instance of Customerand tried to call the web service passing in an object of type customer : my.Service ws = new my.Service(); // Get web service connectionCustomer aCustomer = new Customer();aCustomer.Initialize();ws.GetInfo(aCustomer) // call web service passing in a Customer object The problem is that the compiler gives me the following error: Value of type '_Default.Customer' cannot be converted to 'ws.Class1'. Here Default is refering to my Default.aspx.cs code. Why is this? Do I need to Cast my "aCustomer" class object to a type ofws.Customer ? How do I do that?

Inserting List Item values from a Visual web part

Hi Geeks, I am struck here with one situation that is: 1) I created a enquiry list. 2) Then I created a visual web part it contains the same fields as enquiry list  as textboxes for entry. If any body enters the data and click submit. Those data must be reflected into the enquiry list. Please enlighten me how can I do this.   Thanking you.

General Question About Remembering Property Values Between Postbacks

Here are examples of two different ways I've found to story Property values between postbacks:    private bool Initialized    {      get      {        return Convert.ToBoolean(this.Attributes["Initialized"]);      }      set      {        this.Attributes["Initialized"] = value.ToString();      }    }    private int DataTableRowIndex    {      get      {        return (int)ViewState["DataTableRowIndex"];      }      set      {        ViewState["DataTableRowIndex"] = value;      }    }I'd appreciate any comments about differences between these two approaches [Attributes vs. ViewState].  Is one better or worse?Robert
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