473,412 Members | 5,385 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,412 software developers and data experts.

Array of obj

Hi, I want to pass an array of object of different type
to a function and use it in the function.

I am not able to have it working.

Function that create the array...

public virtual DataSet GetFacturesClientListeDS(string
client)
{
Object[] parametre = new object[4]
{"client",OleDbType.Char,60,client};

string select = "SELECT distinct
details.d_nfacture,project.p_name FROM project,details
where project.p_client = ? and project.p_refno =
details.d_refno and !empty(details.d_nfacture) ORDER BY
d_nfacture";

DataSet myDS = SqlGenericDataSet
(select,"client","SQLPME","AUCUNE",parametre);
return myDS;
}

Function to use the array,

public DataSet SqlGenericDataSet(string sqlquery,string
tablename,string ConfigConnectionKey, string fonction,
Object[] aParameter)
{
SqlConnection GenericConnection = new
System.Data.SqlClient.SqlConnection
(ConfigurationSettings.AppSettings[ConfigConnectionKey]);
SqlCommand GenericCommand = new
System.Data.SqlClient.SqlCommand(sqlquery,
GenericConnection);

for (int a = 1;a<=aParameter.GetLength(0);a++)
{
GenericCommand.Parameters.Add((string)aParameter.G etValue
(a,0),(SqlDbType)aParameter.GetValue(a,1),(int)
aParameter.GetValue(a,2));

GenericCommand.Parameters[(string)aParameter.GetValue
(a,0)].Value = (string)aParameter.GetValue(a,3);
}
Any idea's??

Carl
Nov 15 '05 #1
6 1852

Hi Carl,

Where is the problem that the code does not work?
What is your code snippet's function?
However, I found that your aParameter shoud be 2-dimension array.
And your GenericConnection should be opened after construct.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Carl" <Ca**@cb-cinc.com>
| Sender: "Carl" <Ca**@cb-cinc.com>
| Subject: Array of obj
| Date: Mon, 25 Aug 2003 19:23:53 -0700
| Lines: 53
| Message-ID: <07****************************@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNreRgzgUdYKA3HSZSLulpbpF1Jow==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:179302
| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi, I want to pass an array of object of different type
| to a function and use it in the function.
|
| I am not able to have it working.
|
| Function that create the array...
|
| public virtual DataSet GetFacturesClientListeDS(string
| client)
| {
| Object[] parametre = new object[4]
| {"client",OleDbType.Char,60,client};
|
| string select = "SELECT distinct
| details.d_nfacture,project.p_name FROM project,details
| where project.p_client = ? and project.p_refno =
| details.d_refno and !empty(details.d_nfacture) ORDER BY
| d_nfacture";
|
| DataSet myDS = SqlGenericDataSet
| (select,"client","SQLPME","AUCUNE",parametre);
| return myDS;
| }
|
| Function to use the array,
|
| public DataSet SqlGenericDataSet(string sqlquery,string
| tablename,string ConfigConnectionKey, string fonction,
| Object[] aParameter)
| {
| SqlConnection GenericConnection = new
| System.Data.SqlClient.SqlConnection
| (ConfigurationSettings.AppSettings[ConfigConnectionKey]);
| SqlCommand GenericCommand = new
| System.Data.SqlClient.SqlCommand(sqlquery,
| GenericConnection);
|
| for (int a = 1;a<=aParameter.GetLength(0);a++)
| {
| GenericCommand.Parameters.Add((string)aParameter.G etValue
| (a,0),(SqlDbType)aParameter.GetValue(a,1),(int)
| aParameter.GetValue(a,2));
|
| GenericCommand.Parameters[(string)aParameter.GetValue
| (a,0)].Value = (string)aParameter.GetValue(a,3);
| }
|
|
| Any idea's??
|
| Carl
|
|
|

Nov 15 '05 #2
My trouble is with the array ,how do you iterate trough
it, my syntax is probably not ok.

The line giving me the error in the previous post is

GenericCommand.Parameters.Add((string)aParameter.G etValue
(a,0),(SqlDbType)aParameter.GetValue(a,1),(int)
aParameter.GetValue(a,2));
This is the message I receive,

An unhandled exception of
type 'System.Web.Services.Protocols.SoapException'
occurred in system.web.services.dll

Additional information:
System.Web.Services.Protocols.SoapException: Server was
unable to process request. ---> System.ArgumentException:
Array was not a two-dimensional array.
at System.Array.GetValue(Int32 index1, Int32 index2)
at WS_PME.DB.SqlGenericDataSet(String sqlquery, String
tablename, String ConfigConnectionKey, String fonction,
Object[] aParameter) in f:\structure\projets\vs2003
\pme\ws_pme\components\db_dataset.cs:line 92
at WS_PME.DB.GetFacturesClientListeDS(String client)
in f:\structure\projets\vs2003
\pme\ws_pme\components\db_dataset.cs:line 125
at WS_PME.WSPME.FacturesClientListeDS(String client)
in f:\structure\projets\vs2003
\pme\ws_pme\pme.asmx.cs:line 63
--- End of inner exception stack trace ---
-----Original Message-----

Hi Carl,

Where is the problem that the code does not work?
What is your code snippet's function?
However, I found that your aParameter shoud be 2- dimension array.And your GenericConnection should be opened after construct.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: "Carl" <Ca**@cb-cinc.com>
| Sender: "Carl" <Ca**@cb-cinc.com>
| Subject: Array of obj
| Date: Mon, 25 Aug 2003 19:23:53 -0700
| Lines: 53
| Message-ID: <07****************************@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300| Thread-Index: AcNreRgzgUdYKA3HSZSLulpbpF1Jow==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:179302| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi, I want to pass an array of object of different type| to a function and use it in the function.
|
| I am not able to have it working.
|
| Function that create the array...
|
| public virtual DataSet GetFacturesClientListeDS(string
| client)
| {
| Object[] parametre = new object[4]
| {"client",OleDbType.Char,60,client};
|
| string select = "SELECT distinct
| details.d_nfacture,project.p_name FROM project,details
| where project.p_client = ? and project.p_refno =
| details.d_refno and !empty(details.d_nfacture) ORDER BY| d_nfacture";
|
| DataSet myDS = SqlGenericDataSet
| (select,"client","SQLPME","AUCUNE",parametre);
| return myDS;
| }
|
| Function to use the array,
|
| public DataSet SqlGenericDataSet(string sqlquery,string| tablename,string ConfigConnectionKey, string fonction,
| Object[] aParameter)
| {
| SqlConnection GenericConnection = new
| System.Data.SqlClient.SqlConnection
| (ConfigurationSettings.AppSettings [ConfigConnectionKey]);| SqlCommand GenericCommand = new
| System.Data.SqlClient.SqlCommand(sqlquery,
| GenericConnection);
|
| for (int a = 1;a<=aParameter.GetLength(0);a++)
| {
| GenericCommand.Parameters.Add((string) aParameter.GetValue| (a,0),(SqlDbType)aParameter.GetValue(a,1),(int)
| aParameter.GetValue(a,2));
|
| GenericCommand.Parameters[(string)aParameter.GetValue
| (a,0)].Value = (string)aParameter.GetValue(a,3);
| }
|
|
| Any idea's??
|
| Carl
|
|
|

.

Nov 15 '05 #3
Simplify story.

I want to have one obj array of 4 columns to pass my
parameters for SQL when required, could have multiple
rows or just one.

Columns 1 = string
Columns 2 = OleDbType.Char
Columns 3 = int
Columns 4 = string

Here is my declaration, client is a string variable.

Object[,,,] parametre = new object[4]
{"client",OleDbType.Char,60,client};

Here is the errors when compiling,

F:\Structure\Projets\VS2003
\PME\WS_PME\Components\DB_dataset.cs(122): Cannot
implicitly convert type 'object[]' to 'object[*,*,*,*]'

Now if this was working, on another function I want to
use does value inside the array. How do you access them,
I try a lot of ways but nothing is working so far.

Here is how I try to access it the last time,

public DataSet SqlGenericDataSet(string sqlquery,string
tablename,string ConfigConnectionKey, string fonction,
Object[,,,] aParameter)

for (int a = 0;a<=aParameter.GetLength(0);a++)
{
GenericCommand.Parameters.Add((string)aParameter.G etValue
(a,0),(SqlDbType)aParameter.GetValue(a,1),(int)
aParameter.GetValue(a,2));

GenericCommand.Parameters[(string)aParameter.GetValue
(a,0)].Value = (string)aParameter.GetValue(a,3);
}

Seam simple to do, but....

Carl,
Nov 15 '05 #4

Hi Carl,

As you can see in the error message, the object array should be 2 dimension.
I changed your code like this:
public virtual DataSet GetFacturesClientListeDS(string job_id)
{
Object[,] parametre = new object[,]
{{"job_id",OleDbType.SmallInt,60,job_id}}; //use 2-dimension array
string select = "SELECT * from jobs";
DataSet myDS =
SqlGenericDataSet(select,"client","SQLPME","AUCUNE ",parametre);
return myDS;
}

public DataSet SqlGenericDataSet(string sqlquery,string tablename,string
ConfigConnectionKey, string fonction, Object[,] aParameter)
{
try
{
SqlConnection GenericConnection = new
System.Data.SqlClient.SqlConnection("server=localh ost;database=pubs;uid=sa;p
wd=");
GenericConnection.Open(); //open the connection
SqlCommand GenericCommand = new
System.Data.SqlClient.SqlCommand(sqlquery,GenericC onnection);

for (int a = 0;a<aParameter.GetLength(0);a++)
{

GenericCommand.Parameters.Add((string)aParameter.G etValue(a,0),(SqlDbType)aP
arameter.GetValue(a,1),(int)aParameter.GetValue(a, 2));
GenericCommand.Parameters[(string)aParameter.GetValue(a,0)].Value =
(string)aParameter.GetValue(a,3);
}
}
catch(Exception e)
{
Console.WriteLine (e.Message );
}
return new DataSet ();
}

I use my default sql server database on my machine and i only create a row
of object array.

I make some small changes to your code:
1. object array changed to 2 dimension
2. add open method to GenericConnection
3.in the for loop, change a<=aParameter.GetLength(0) to
a<aParameter.GetLength(0)

It works well on my machine.

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Carl" <ca**@cb-cinc.com>
| Sender: "Carl" <ca**@cb-cinc.com>
| References: <07****************************@phx.gbl>
<bR**************@cpmsftngxa06.phx.gbl>
<0d****************************@phx.gbl>
| Subject: RE: Array of obj
| Date: Tue, 26 Aug 2003 09:47:11 -0700
| Lines: 47
| Message-ID: <0f****************************@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNr8bH5J5D2F7YVSNiRHck/QpyBcQ==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:179552
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Simplify story.
|
| I want to have one obj array of 4 columns to pass my
| parameters for SQL when required, could have multiple
| rows or just one.
|
| Columns 1 = string
| Columns 2 = OleDbType.Char
| Columns 3 = int
| Columns 4 = string
|
| Here is my declaration, client is a string variable.
|
| Object[,,,] parametre = new object[4]
| {"client",OleDbType.Char,60,client};
|
| Here is the errors when compiling,
|
| F:\Structure\Projets\VS2003
| \PME\WS_PME\Components\DB_dataset.cs(122): Cannot
| implicitly convert type 'object[]' to 'object[*,*,*,*]'
|
| Now if this was working, on another function I want to
| use does value inside the array. How do you access them,
| I try a lot of ways but nothing is working so far.
|
| Here is how I try to access it the last time,
|
| public DataSet SqlGenericDataSet(string sqlquery,string
| tablename,string ConfigConnectionKey, string fonction,
| Object[,,,] aParameter)
|
| for (int a = 0;a<=aParameter.GetLength(0);a++)
| {
| GenericCommand.Parameters.Add((string)aParameter.G etValue
| (a,0),(SqlDbType)aParameter.GetValue(a,1),(int)
| aParameter.GetValue(a,2));
|
| GenericCommand.Parameters[(string)aParameter.GetValue
| (a,0)].Value = (string)aParameter.GetValue(a,3);
| }
|
| Seam simple to do, but....
|
| Carl,
|
|
|

Nov 15 '05 #5
Hi Jeffrey,

Thanks for the answers I get a little further, I also
notice another mistake from my part, the OleDbType should
also be SqlDbType for SQL.

Right now I do have the following errors reported,

-------------------------------
An unhandled exception of
type 'System.Web.Services.Protocols.SoapException'
occurred in system.web.services.dll

Additional information:
System.Web.Services.Protocols.SoapException: Server was
unable to process request. --->
System.Data.SqlClient.SqlException: Line 1: Incorrect
syntax near 'client'.
at System.Data.SqlClient.SqlCommand.ExecuteReader
(CommandBehavior cmdBehavior, RunBehavior runBehavior,
Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteReader
(CommandBehavior behavior)
at
System.Data.SqlClient.SqlCommand.System.Data.IDbCo mmand.Ex
ecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillFromCommand
(Object data, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet, String srcTable)
at WS_PME.DB.SqlGenericDataSet(String sqlquery, String
tablename, String ConfigConnectionKey, String fonction,
Object[,] aParameter) in f:\structure\projets\vs2003
\pme\ws_pme\components\db_dataset.cs:line 101
at WS_PME.DB.GetFacturesClientListeDS(String clientID)
in f:\structure\projets\vs2003
\pme\ws_pme\components\db_dataset.cs:line 125
at WS_PME.WSPME.FacturesClientListeDS(String client)
in f:\structure\projets\vs2003
\pme\ws_pme\pme.asmx.cs:line 63
--- End of inner exception stack trace ---
------------------------------------

From the function SqlGenericDataSet, in line
GenericDA.Fill(GenericDS, tablename);
-------------------------------------

public DataSet SqlGenericDataSet(string sqlquery,string
tablename,string ConfigConnectionKey, string fonction,
Object[,] aParameter)
{
SqlConnection GenericConnection = new
System.Data.SqlClient.SqlConnection
(ConfigurationSettings.AppSettings[ConfigConnectionKey]);
GenericConnection.Open();
SqlCommand GenericCommand = new
System.Data.SqlClient.SqlCommand(sqlquery,
GenericConnection);

for (int a = 0;a<aParameter.GetLength(0);a++)
{
GenericCommand.Parameters.Add((string)aParameter.G etValue
(a,0),(SqlDbType)aParameter.GetValue(a,1),(int)
aParameter.GetValue(a,2));
GenericCommand.Parameters[(string)aParameter.GetValue
(a,0)].Value = (string)aParameter.GetValue(a,3);
}

GenericCommand.CommandTimeout = 30;
SqlDataAdapter GenericDA = new SqlDataAdapter();
GenericDA.SelectCommand = GenericCommand;
DataSet GenericDS = new DataSet();
GenericDA.Fill(GenericDS, tablename);
GenericConnection.Close();
return GenericDS;
}
-----------------------------------------------

Here is the function calling SqlGenericDataSet.
------------------------------------------------
public virtual DataSet GetFacturesClientListeDS
(string clientID)
{
Object[,] parametre = new object
[,] {{"client",SqlDbType.Char,60,clientID}}; //use 2-
dimension array
string select = "SELECT distinct
details.d_nfacture,project.p_name FROM project,details
where project.p_client = ? and project.p_refno =
details.d_refno and !empty(details.d_nfacture) ORDER BY
d_nfacture";
DataSet myDS = SqlGenericDataSet
(select,"client","SQLPME","AUCUNE",parametre);
return myDS;
------------------------------------------

This error message occurs in the Reference.cs of the web
service, at the following line,
-------------------------------------------
object[] results = this.Invoke
("FacturesClientListeDS", new object[] {
client});
--------------------------------------------
from the following function,
--------------------------------------------
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute
("http://tempuri.org/FacturesClientListeDS",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse .Literal
,
ParameterStyle=System.Web.Services.Protocols.SoapP arameter
Style.Wrapped)]
public System.Data.DataSet FacturesClientListeDS
(string client) {
object[] results = this.Invoke
("FacturesClientListeDS", new object[] {
client});
return ((System.Data.DataSet)(results[0]));
}
-------------------------------------------------------

I can see that the variable client contains the good
string value from the debugger.
Again, thanks for your time....

Carl,

Nov 15 '05 #6

Hi Carl,

I think you should post your article in this newsgroup:
microsoft.public.dotnet.framework.aspnet
In there, our engineer will help you indeep.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Carl" <Ca**@cb-cinc.com>
| Sender: "Carl" <Ca**@cb-cinc.com>
| References: <07****************************@phx.gbl>
<bR**************@cpmsftngxa06.phx.gbl>
<0d****************************@phx.gbl>
<0f****************************@phx.gbl>
<oE**************@cpmsftngxa06.phx.gbl>
| Subject: RE: Array of obj
| Date: Wed, 27 Aug 2003 09:14:53 -0700
| Lines: 134
| Message-ID: <09****************************@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNstlk5Cc/ZX/tjRSy8zlBKCXixmQ==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:179890
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi Jeffrey,
|
| Thanks for the answers I get a little further, I also
| notice another mistake from my part, the OleDbType should
| also be SqlDbType for SQL.
|
| Right now I do have the following errors reported,
|
| -------------------------------
| An unhandled exception of
| type 'System.Web.Services.Protocols.SoapException'
| occurred in system.web.services.dll
|
| Additional information:
| System.Web.Services.Protocols.SoapException: Server was
| unable to process request. --->
| System.Data.SqlClient.SqlException: Line 1: Incorrect
| syntax near 'client'.
| at System.Data.SqlClient.SqlCommand.ExecuteReader
| (CommandBehavior cmdBehavior, RunBehavior runBehavior,
| Boolean returnStream)
| at System.Data.SqlClient.SqlCommand.ExecuteReader
| (CommandBehavior behavior)
| at
| System.Data.SqlClient.SqlCommand.System.Data.IDbCo mmand.Ex
| ecuteReader(CommandBehavior behavior)
| at System.Data.Common.DbDataAdapter.FillFromCommand
| (Object data, Int32 startRecord, Int32 maxRecords, String
| srcTable, IDbCommand command, CommandBehavior behavior)
| at System.Data.Common.DbDataAdapter.Fill(DataSet
| dataSet, Int32 startRecord, Int32 maxRecords, String
| srcTable, IDbCommand command, CommandBehavior behavior)
| at System.Data.Common.DbDataAdapter.Fill(DataSet
| dataSet, String srcTable)
| at WS_PME.DB.SqlGenericDataSet(String sqlquery, String
| tablename, String ConfigConnectionKey, String fonction,
| Object[,] aParameter) in f:\structure\projets\vs2003
| \pme\ws_pme\components\db_dataset.cs:line 101
| at WS_PME.DB.GetFacturesClientListeDS(String clientID)
| in f:\structure\projets\vs2003
| \pme\ws_pme\components\db_dataset.cs:line 125
| at WS_PME.WSPME.FacturesClientListeDS(String client)
| in f:\structure\projets\vs2003
| \pme\ws_pme\pme.asmx.cs:line 63
| --- End of inner exception stack trace ---
| ------------------------------------
|
| From the function SqlGenericDataSet, in line
| GenericDA.Fill(GenericDS, tablename);
| -------------------------------------
|
| public DataSet SqlGenericDataSet(string sqlquery,string
| tablename,string ConfigConnectionKey, string fonction,
| Object[,] aParameter)
| {
| SqlConnection GenericConnection = new
| System.Data.SqlClient.SqlConnection
| (ConfigurationSettings.AppSettings[ConfigConnectionKey]);
| GenericConnection.Open();
| SqlCommand GenericCommand = new
| System.Data.SqlClient.SqlCommand(sqlquery,
| GenericConnection);
|
| for (int a = 0;a<aParameter.GetLength(0);a++)
| {
| GenericCommand.Parameters.Add((string)aParameter.G etValue
| (a,0),(SqlDbType)aParameter.GetValue(a,1),(int)
| aParameter.GetValue(a,2));
| GenericCommand.Parameters[(string)aParameter.GetValue
| (a,0)].Value = (string)aParameter.GetValue(a,3);
| }
|
| GenericCommand.CommandTimeout = 30;
| SqlDataAdapter GenericDA = new SqlDataAdapter();
| GenericDA.SelectCommand = GenericCommand;
| DataSet GenericDS = new DataSet();
| GenericDA.Fill(GenericDS, tablename);
| GenericConnection.Close();
| return GenericDS;
| }
| -----------------------------------------------
|
| Here is the function calling SqlGenericDataSet.
| ------------------------------------------------
| public virtual DataSet GetFacturesClientListeDS
| (string clientID)
| {
| Object[,] parametre = new object
| [,] {{"client",SqlDbType.Char,60,clientID}}; //use 2-
| dimension array
| string select = "SELECT distinct
| details.d_nfacture,project.p_name FROM project,details
| where project.p_client = ? and project.p_refno =
| details.d_refno and !empty(details.d_nfacture) ORDER BY
| d_nfacture";
| DataSet myDS = SqlGenericDataSet
| (select,"client","SQLPME","AUCUNE",parametre);
| return myDS;
| ------------------------------------------
|
| This error message occurs in the Reference.cs of the web
| service, at the following line,
| -------------------------------------------
| object[] results = this.Invoke
| ("FacturesClientListeDS", new object[] {
| client});
| --------------------------------------------
| from the following function,
| --------------------------------------------
| [System.Web.Services.Protocols.SoapDocumentMethodAt tribute
| ("http://tempuri.org/FacturesClientListeDS",
| RequestNamespace="http://tempuri.org/",
| ResponseNamespace="http://tempuri.org/",
| Use=System.Web.Services.Description.SoapBindingUse .Literal
| ,
| ParameterStyle=System.Web.Services.Protocols.SoapP arameter
| Style.Wrapped)]
| public System.Data.DataSet FacturesClientListeDS
| (string client) {
| object[] results = this.Invoke
| ("FacturesClientListeDS", new object[] {
| client});
| return ((System.Data.DataSet)(results[0]));
| }
| -------------------------------------------------------
|
| I can see that the variable client contains the good
| string value from the debugger.
|
|
| Again, thanks for your time....
|
| Carl,
|
|

Nov 15 '05 #7

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

Similar topics

2
by: Brian | last post by:
I'm diddlying with a script, and found some behavior I don't understand. Take this snippet: for ($i = 0; $i <= count($m); $i++) { array_shift($m); reset($m); }
2
by: Stormkid | last post by:
Hi Group I'm trying to figure out a way that I can take two (two dimensional) arrays and avShed and shed, and subtract the matching elements in shed from avShed I've pasted the arrays blow from a...
15
by: lawrence | last post by:
I wanted to test xml_parse_into_struct() so I took the example off of www.php.net and put this code up on a site: <?php $simple = <<<END <item>
8
by: vcardillo | last post by:
Hello all, Okay, I am having some troubles. What I am doing here is dealing with an employee hierarchy that is stored in an array. It looks like this: $employees = array( "user_id" => array(...
12
by: Sam Collett | last post by:
How do I remove an item with a specified value from an array? i.e. array values 1,2,2,5,7,12,15,21 remove 2 from array would return 1,5,7,12,15,21 (12 and 21 are NOT removed, duplicates are...
8
by: Mike S. Nowostawsky | last post by:
I tried using the "toUpperCase()" property to change the value of an array entity to uppercase BUT it tells me that the property is invalid. It seems that an array is not considered an object when...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
104
by: Leszek | last post by:
Hi. Is it possible in javascript to operate on an array without knowing how mamy elements it has? What i want to do is sending an array to a script, and this script should add all values from...
7
by: Jim Carlock | last post by:
Looking for suggestions on how to handle bad words that might get passed in through $_GET variables. My first thoughts included using str_replace() to strip out such content, but then one ends...
17
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hi Gurus, I need to transfer a jagged array of byte by reference to unmanaged function, The unmanaged code should changed the values of the array, and when the unmanaged function returns I need...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.