Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

1) GetItemString 2) Any Data type for retrieval Arg

6 posts in DataWindow .NET Last posting was on 2004-12-14 18:33:08.0Z
Harshad Rathod Posted on 2004-12-14 07:41:45.0Z
Sender: 20f3.41bc6ebf.1804289383@sybase.com
From: Harshad Rathod
Newsgroups: sybase.public.datawindow.net
Subject: 1) GetItemString 2) Any Data type for retrieval Arg
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41be9939.3e07.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 13 Dec 2004 23:41:45 -0800
X-Trace: forums-1-dub 1103010105 10.22.241.41 (13 Dec 2004 23:41:45 -0800)
X-Original-Trace: 13 Dec 2004 23:41:45 -0800, 10.22.241.41
Lines: 25
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:1036
Article PK: 125460

Two questions.
1) If aDatastore.GetItemString(1, myColumnName) is called
and myColumnName at row 1 happens to have null value, it
throws System.Data.SqlTypes.SqlNulValueException: Data is
Null. This method or property cannot be called on Null
values.

This works:
s = lnlp.NodeDataStore.GetItemString(iRow,
"territory_code");

The one below throws exception. I know that value returned
is null in the database.
s = lnlp.NodeDataStore.GetItemString(iRow, lnlArg.ColName);

What is the way out?

2) Datawindow.Retrieve() takes upto twenty arguments. If I
do not know the number of arguments to pass and/or data
types of those arguments, how can I call retrieve with args?
In PB it takes "any" data type and number of arguments
passed does not matter as long as it matches the expected
numbers. DW.Net does not allow "any" data types. I still
tried passing Object type, failed. Document is clear, you
have to specify types. How do I achieve this?


Gzim Posted on 2004-12-14 10:01:08.0Z
From: "Gzim" <the_matrix_3005@gmx.net>
Newsgroups: sybase.public.datawindow.net
References: <41be9939.3e07.1681692777@sybase.com>
Subject: Re: 1) GetItemString 2) Any Data type for retrieval Arg
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: zux006-057-206.adsl.green.ch
X-Original-NNTP-Posting-Host: zux006-057-206.adsl.green.ch
Message-ID: <41beb9e4@forums-1-dub>
Date: 14 Dec 2004 02:01:08 -0800
X-Trace: forums-1-dub 1103018468 81.6.57.206 (14 Dec 2004 02:01:08 -0800)
X-Original-Trace: 14 Dec 2004 02:01:08 -0800, zux006-057-206.adsl.green.ch
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:1039
Article PK: 125465

1)
a) try-catch // in catch set your variable s=""
b) declare your variable s as an object( c#: String s=new String(); )

2)
.net-languages are typesafe (I don't if 'typesafe' is correct in english).
you have to specify the type!
a) try to cast ..i.e. for integer and string
- (Int32)"String";
- yourIntVar.ToString(); //

gzim

<Harshad Rathod> schrieb im Newsbeitrag
news:41be9939.3e07.1681692777@sybase.com...

> Two questions.
> 1) If aDatastore.GetItemString(1, myColumnName) is called
> and myColumnName at row 1 happens to have null value, it
> throws System.Data.SqlTypes.SqlNulValueException: Data is
> Null. This method or property cannot be called on Null
> values.
>
> This works:
> s = lnlp.NodeDataStore.GetItemString(iRow,
> "territory_code");
>
> The one below throws exception. I know that value returned
> is null in the database.
> s = lnlp.NodeDataStore.GetItemString(iRow, lnlArg.ColName);
>
> What is the way out?
>
> 2) Datawindow.Retrieve() takes upto twenty arguments. If I
> do not know the number of arguments to pass and/or data
> types of those arguments, how can I call retrieve with args?
> In PB it takes "any" data type and number of arguments
> passed does not matter as long as it matches the expected
> numbers. DW.Net does not allow "any" data types. I still
> tried passing Object type, failed. Document is clear, you
> have to specify types. How do I achieve this?


Jim O'Neil [Sybase] Posted on 2004-12-14 15:02:28.0Z
From: "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com>
Newsgroups: sybase.public.datawindow.net
Subject: Re: 1) GetItemString 2) Any Data type for retrieval Arg
Message-ID: <atvtr0tnor1a3qou3klss5eae3tpbj5egn@4ax.com>
References: <41be9939.3e07.1681692777@sybase.com> <41beb9e4@forums-1-dub>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: joneilw2k.sybase.com
X-Original-NNTP-Posting-Host: joneilw2k.sybase.com
Date: 14 Dec 2004 07:02:28 -0800
X-Trace: forums-1-dub 1103036548 10.18.43.140 (14 Dec 2004 07:02:28 -0800)
X-Original-Trace: 14 Dec 2004 07:02:28 -0800, joneilw2k.sybase.com
Lines: 50
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:1046
Article PK: 125472


On 14 Dec 2004 02:01:08 -0800, "Gzim" <the_matrix_3005@gmx.net> wrote:

>1)
>a) try-catch // in catch set your variable s=""
>b) declare your variable s as an object( c#: String s=new String(); )

c) use the IsItemNull() method to test before doing the
GetItemString()
d) use GetItemSqlString() to get a System.Data.SqlTypes.SqlString
which does support null values.

>2)
>.net-languages are typesafe (I don't if 'typesafe' is correct in english).
>you have to specify the type!
>a) try to cast ..i.e. for integer and string
> - (Int32)"String";
> - yourIntVar.ToString(); //
>
>gzim
>
><Harshad Rathod> schrieb im Newsbeitrag
>news:41be9939.3e07.1681692777@sybase.com...
>> Two questions.
>> 1) If aDatastore.GetItemString(1, myColumnName) is called
>> and myColumnName at row 1 happens to have null value, it
>> throws System.Data.SqlTypes.SqlNulValueException: Data is
>> Null. This method or property cannot be called on Null
>> values.
>>
>> This works:
>> s = lnlp.NodeDataStore.GetItemString(iRow,
>> "territory_code");
>>
>> The one below throws exception. I know that value returned
>> is null in the database.
>> s = lnlp.NodeDataStore.GetItemString(iRow, lnlArg.ColName);
>>
>> What is the way out?
>>
>> 2) Datawindow.Retrieve() takes upto twenty arguments. If I
>> do not know the number of arguments to pass and/or data
>> types of those arguments, how can I call retrieve with args?
>> In PB it takes "any" data type and number of arguments
>> passed does not matter as long as it matches the expected
>> numbers. DW.Net does not allow "any" data types. I still
>> tried passing Object type, failed. Document is clear, you
>> have to specify types. How do I achieve this?
>
>


Harshad Rathod Posted on 2004-12-14 17:26:12.0Z
Sender: 4b29.41bf1fa0.1804289383@sybase.com
From: Harshad Rathod
Newsgroups: sybase.public.datawindow.net
Subject: Re: 1) GetItemString 2) Any Data type for retrieval Arg
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41bf2234.4b5c.1681692777@sybase.com>
References: <atvtr0tnor1a3qou3klss5eae3tpbj5egn@4ax.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 Dec 2004 09:26:12 -0800
X-Trace: forums-1-dub 1103045172 10.22.241.41 (14 Dec 2004 09:26:12 -0800)
X-Original-Trace: 14 Dec 2004 09:26:12 -0800, 10.22.241.41
Lines: 71
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:1052
Article PK: 125477

Thank you both.

Further on Que. 2); My problem is that I will not know at
design time what type to cast. In PB you can call
DW.Retrieve(arg1, arg2...arg20). Then at run time, you can
pass any tpe in arg1, arg2, etc. I intend to chanage
DWObject at runtime and then call retrieve, something like
of_Retrieve() of pfc_DWSRVC.

I guess I will have to check the type of retrieval arguments
and build retrieve based on it. It will be a longer and
dirty code.

See if you have any after thoughts.

Thanks once again.

Harshad

> On 14 Dec 2004 02:01:08 -0800, "Gzim"
> <the_matrix_3005@gmx.net> wrote:
>
> >1)
> >a) try-catch // in catch set your variable s=""
> >b) declare your variable s as an object( c#: String s=new
> String(); )
>
> c) use the IsItemNull() method to test before doing the
> GetItemString()
> d) use GetItemSqlString() to get a
> System.Data.SqlTypes.SqlString which does support null
> values.
>
> >2)
> >.net-languages are typesafe (I don't if 'typesafe' is
> correct in english). >you have to specify the type!
> >a) try to cast ..i.e. for integer and string
> > - (Int32)"String";
> > - yourIntVar.ToString(); //
> >
> >gzim
> >
> ><Harshad Rathod> schrieb im Newsbeitrag
> >news:41be9939.3e07.1681692777@sybase.com...
> >> Two questions.
> >> 1) If aDatastore.GetItemString(1, myColumnName) is
> called >> and myColumnName at row 1 happens to have null
> value, it >> throws
> System.Data.SqlTypes.SqlNulValueException: Data is >>
> Null. This method or property cannot be called on Null >>
> values. >>
> >> This works:
> >> s = lnlp.NodeDataStore.GetItemString(iRow,
> >> "territory_code");
> >>
> >> The one below throws exception. I know that value
> returned >> is null in the database.
> >> s = lnlp.NodeDataStore.GetItemString(iRow,
> lnlArg.ColName); >>
> >> What is the way out?
> >>
> >> 2) Datawindow.Retrieve() takes upto twenty arguments.
> If I >> do not know the number of arguments to pass and/or
> data >> types of those arguments, how can I call retrieve
> with args? >> In PB it takes "any" data type and number
> of arguments >> passed does not matter as long as it
> matches the expected >> numbers. DW.Net does not allow
> "any" data types. I still >> tried passing Object type,
> failed. Document is clear, you >> have to specify types.
> How do I achieve this? >
> >
>


Jack Addington Posted on 2004-12-14 17:36:30.0Z
From: "Jack Addington" <jaddington@shaw.ca>
Newsgroups: sybase.public.datawindow.net
References: <atvtr0tnor1a3qou3klss5eae3tpbj5egn@4ax.com> <41bf2234.4b5c.1681692777@sybase.com>
Subject: Re: 1) GetItemString 2) Any Data type for retrieval Arg
Lines: 93
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
X-Original-NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
Message-ID: <41bf249e$2@forums-1-dub>
Date: 14 Dec 2004 09:36:30 -0800
X-Trace: forums-1-dub 1103045790 68.147.199.171 (14 Dec 2004 09:36:30 -0800)
X-Original-Trace: 14 Dec 2004 09:36:30 -0800, s010600e018e32f17.cg.shawcable.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:1055
Article PK: 125482

You don't neccessarily have to cast each one, just pass each one as an
object.

What I do is have an arraylist of arguments ArrayList _args.

When I want to populate my arguments I do something along the lines of:

_args.Clear();
_args.Add(someStringVariable);
_args.Add(123);
_args.Add("abc");

then I pass _args.ToArray() to my retrieval function. If you need to pass a
null then make sure you create a variable and set that to null and then pass
the variable.

hope that helps a bit.

<Harshad Rathod> wrote in message
news:41bf2234.4b5c.1681692777@sybase.com...
> Thank you both.
>
> Further on Que. 2); My problem is that I will not know at
> design time what type to cast. In PB you can call
> DW.Retrieve(arg1, arg2...arg20). Then at run time, you can
> pass any tpe in arg1, arg2, etc. I intend to chanage
> DWObject at runtime and then call retrieve, something like
> of_Retrieve() of pfc_DWSRVC.
>
> I guess I will have to check the type of retrieval arguments
> and build retrieve based on it. It will be a longer and
> dirty code.
>
> See if you have any after thoughts.
>
> Thanks once again.
>
> Harshad
>> On 14 Dec 2004 02:01:08 -0800, "Gzim"
>> <the_matrix_3005@gmx.net> wrote:
>>
>> >1)
>> >a) try-catch // in catch set your variable s=""
>> >b) declare your variable s as an object( c#: String s=new
>> String(); )
>>
>> c) use the IsItemNull() method to test before doing the
>> GetItemString()
>> d) use GetItemSqlString() to get a
>> System.Data.SqlTypes.SqlString which does support null
>> values.
>>
>> >2)
>> >.net-languages are typesafe (I don't if 'typesafe' is
>> correct in english). >you have to specify the type!
>> >a) try to cast ..i.e. for integer and string
>> > - (Int32)"String";
>> > - yourIntVar.ToString(); //
>> >
>> >gzim
>> >
>> ><Harshad Rathod> schrieb im Newsbeitrag
>> >news:41be9939.3e07.1681692777@sybase.com...
>> >> Two questions.
>> >> 1) If aDatastore.GetItemString(1, myColumnName) is
>> called >> and myColumnName at row 1 happens to have null
>> value, it >> throws
>> System.Data.SqlTypes.SqlNulValueException: Data is >>
>> Null. This method or property cannot be called on Null >>
>> values. >>
>> >> This works:
>> >> s = lnlp.NodeDataStore.GetItemString(iRow,
>> >> "territory_code");
>> >>
>> >> The one below throws exception. I know that value
>> returned >> is null in the database.
>> >> s = lnlp.NodeDataStore.GetItemString(iRow,
>> lnlArg.ColName); >>
>> >> What is the way out?
>> >>
>> >> 2) Datawindow.Retrieve() takes upto twenty arguments.
>> If I >> do not know the number of arguments to pass and/or
>> data >> types of those arguments, how can I call retrieve
>> with args? >> In PB it takes "any" data type and number
>> of arguments >> passed does not matter as long as it
>> matches the expected >> numbers. DW.Net does not allow
>> "any" data types. I still >> tried passing Object type,
>> failed. Document is clear, you >> have to specify types.
>> How do I achieve this? >
>> >
>>


Harshad Rathod Posted on 2004-12-14 18:33:08.0Z
Sender: 4b29.41bf1fa0.1804289383@sybase.com
From: Harshad Rathod
Newsgroups: sybase.public.datawindow.net
Subject: Re: 1) GetItemString 2) Any Data type for retrieval Arg
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41bf31e4.4c91.1681692777@sybase.com>
References: <41bf249e$2@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 Dec 2004 10:33:08 -0800
X-Trace: forums-1-dub 1103049188 10.22.241.41 (14 Dec 2004 10:33:08 -0800)
X-Original-Trace: 14 Dec 2004 10:33:08 -0800, 10.22.241.41
Lines: 105
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:1057
Article PK: 125483

Excellent! This is what I was looking for.

Jim/David, for the benifit of DW users from PB to .Net, this
could be a good candidate to include in documentation or
even a wrapper built in function.

Thanks.

Harshad

> You don't neccessarily have to cast each one, just pass
> each one as an object.
>
> What I do is have an arraylist of arguments ArrayList
> _args.
>
> When I want to populate my arguments I do something along
> the lines of:
>
> _args.Clear();
> _args.Add(someStringVariable);
> _args.Add(123);
> _args.Add("abc");
>
> then I pass _args.ToArray() to my retrieval function. If
> you need to pass a null then make sure you create a
> variable and set that to null and then pass the variable.
>
> hope that helps a bit.
>
> <Harshad Rathod> wrote in message
> news:41bf2234.4b5c.1681692777@sybase.com...
> > Thank you both.
> >
> > Further on Que. 2); My problem is that I will not know
> > at design time what type to cast. In PB you can call
> > DW.Retrieve(arg1, arg2...arg20). Then at run time, you
> > can pass any tpe in arg1, arg2, etc. I intend to
> > chanage DWObject at runtime and then call retrieve,
> > something like of_Retrieve() of pfc_DWSRVC.
> >
> > I guess I will have to check the type of retrieval
> > arguments and build retrieve based on it. It will be a
> > longer and dirty code.
> >
> > See if you have any after thoughts.
> >
> > Thanks once again.
> >
> > Harshad
> >> On 14 Dec 2004 02:01:08 -0800, "Gzim"
> >> <the_matrix_3005@gmx.net> wrote:
> >>
> >> >1)
> >> >a) try-catch // in catch set your variable s=""
> >> >b) declare your variable s as an object( c#: String
> s=new >> String(); )
> >>
> >> c) use the IsItemNull() method to test before doing the
> >> GetItemString()
> >> d) use GetItemSqlString() to get a
> >> System.Data.SqlTypes.SqlString which does support null
> >> values.
> >>
> >> >2)
> >> >.net-languages are typesafe (I don't if 'typesafe' is
> >> correct in english). >you have to specify the type!
> >> >a) try to cast ..i.e. for integer and string
> >> > - (Int32)"String";
> >> > - yourIntVar.ToString(); //
> >> >
> >> >gzim
> >> >
> >> ><Harshad Rathod> schrieb im Newsbeitrag
> >> >news:41be9939.3e07.1681692777@sybase.com...
> >> >> Two questions.
> >> >> 1) If aDatastore.GetItemString(1, myColumnName) is
> >> called >> and myColumnName at row 1 happens to have
> null >> value, it >> throws
> >> System.Data.SqlTypes.SqlNulValueException: Data is >>
> >> Null. This method or property cannot be called on Null
> >> >> values. >>
> >> >> This works:
> >> >> s = lnlp.NodeDataStore.GetItemString(iRow,
> >> >> "territory_code");
> >> >>
> >> >> The one below throws exception. I know that value
> >> returned >> is null in the database.
> >> >> s = lnlp.NodeDataStore.GetItemString(iRow,
> >> lnlArg.ColName); >>
> >> >> What is the way out?
> >> >>
> >> >> 2) Datawindow.Retrieve() takes upto twenty
> arguments. >> If I >> do not know the number of arguments
> to pass and/or >> data >> types of those arguments, how
> can I call retrieve >> with args? >> In PB it takes "any"
> data type and number >> of arguments >> passed does not
> matter as long as it >> matches the expected >> numbers.
> DW.Net does not allow >> "any" data types. I still >>
> tried passing Object type, >> failed. Document is clear,
> you >> have to specify types. >> How do I achieve this? >
> >> >
> >>
>
>