473,382 Members | 1,435 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

create dynamic object[]

Hi,
Does anyone know how to do it? I have an oCommandWrapper that has an
input paramater{{"@registrationId",DbType.String,strRegC ode}} and two
output paramerters {{"@strSessionTime",DbType.DateTime,8},
{"@strCourseName",DbType.String,200}}. The
db.ExecuteNonQuery(oCommandWrapper) is successfully executed. I am
trying to use the following code to retrieve the output values and put
them in aryRtnParams which is an object[]. So far I could only get the
last value out, due to the aryRtnParams is reinitialized at every loop.

for (byte byteThisPos=0; byteThisPos < aryOut.Length; byteThisPos++)
{
object[] aryParamStruct = (object[])aryOut[byteThisPos];
aryRtnParams = new
object[]{oCommandWrapper.GetParameterValue(aryParamStruct[0].ToString())};
}

When I tried the following code, I got an error of
"System.NullReferenceException Object reference not set to an instance
of an object".
for (byte byteThisPos=0; byteThisPos < aryOut.Length; byteThisPos++)
{
object[] aryParamStruct = (object[])aryOut[byteThisPos];
aryRtnParams[byteThisPos] = new
object[]{oCommandWrapper.GetParameterValue(aryParamStruct[0].ToString())};
}

Jan 13 '06 #1
1 1752
Hello,
I am
trying to use the following code to retrieve the output values and put
them in aryRtnParams which is an object[].


Why not trying this:

function getOutputParameterArray()
{
ArrayList paramList = new ArrayList();
for (int i = 0; i < command.Parameters.Count; i++)
{
if (command.Parameters[i].Direction == ParameterDirection.Output ||
command.Param... == ParameterDirection.InputOutput)
{
paramList.Add(command.Parameter[i].Value);
}
}
return paramList.ToArray();
}

This is the method I use to get the output parameter values.
Jan 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET)...
3
by: Kiyomi | last post by:
Hello, I create a Table1 dynamically at run time, and at the same time, I would like to create LinkButton controls, also dynamically, and insert them into each line in my Table1. I would...
3
by: RSB | last post by:
Hi Every one Having tuff time creating web controls Dynamically. All i am trying to do is read a table and generate a list of ASP TEXT Box. So how do i create this Control dynamically and where...
15
by: Amit D.Shinde | last post by:
I am adding a new picturebox control at runtime on the form How can i create click event handler for this control Amit Shinde
1
by: Tom | last post by:
Hi All Thanks However, I want to create the vbproject . One vb project (type is windows application .exe) dynamic call another vbproject (class libary .dll) . while windows application project...
0
by: Pascal Costanza | last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab,...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
1
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button...
0
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I...
18
by: Angus | last post by:
Hello We have a lot of C++ code. And we need to now create a library which can be used from C and C++. Given that we have a lot of C++ code using classes how can we 'hide' the fact that it is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.