473,587 Members | 2,533 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Undefined Value


Hi All,

What is a best way to handle an undefined value object class that returned
from a function. I have a function that call the ADO.NET ExecuteScalar()
function and returns the object to the calling function as follow:
public object FunctionA()
{
object RetVal;
... some preparation code here
RetVal = ExecuteScalar() ; // This one execute a stored procedure
which can return an empty column

Return RetVal;
}
public int FunctionB()
{
object SingleValue;
... some code here
SingleValue = FunctionA();
}

The call to the FunctionA works only if the ExecuteScalar() returns a value.
If the stored procedure returns an empty column value, and then the call to
the FunctionA() breaks out with an exception...

Any thoughts????
Nov 15 '05 #1
6 2163
Hi David,

IDbCommand.Exec uteScalar Method returns the first column of the first row
in the resultset. If there are no rows returned from your command, a null
reference is returned. If the first column of the first row is a (Null)
value, a System.DBNull object is returned. So, if you want to determine if
any object is returned from the ExecuteScalar() method, you can try the
following codes:

command.Connect ion.Open();
Object o = com.ExecuteScal ar();
com.Connection. Close();
if(o != null && o != System.DBNull.V alue)
return (Int32)o;
else
return null;

Does this answer your question? If anything is unclear, please feel free to
reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: " David N" <dq*****@netiq. com>
| Subject: Undefined Value
| Date: Sun, 5 Oct 2003 15:40:25 -0700
| Lines: 37
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OW************ **@tk2msftngp13 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: pat-50.bel.netiq.co m 65.219.170.50
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1891 08
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
|
| Hi All,
|
| What is a best way to handle an undefined value object class that returned
| from a function. I have a function that call the ADO.NET ExecuteScalar()
| function and returns the object to the calling function as follow:
|
|
| public object FunctionA()
| {
| object RetVal;
| ... some preparation code here
|
|
| RetVal = ExecuteScalar() ; // This one execute a stored procedure
| which can return an empty column
|
| Return RetVal;
| }
|
|
| public int FunctionB()
| {
| object SingleValue;
| ... some code here
|
|
| SingleValue = FunctionA();
| }
|
| The call to the FunctionA works only if the ExecuteScalar() returns a
value.
| If the stored procedure returns an empty column value, and then the call
to
| the FunctionA() breaks out with an exception...
|
| Any thoughts????
|
|
|

Nov 15 '05 #2
Hi David,

IDbCommand.Exec uteScalar Method returns the first column of the first row
in the resultset. If there are no rows returned from your command, a null
reference is returned. If the first column of the first row is a (Null)
value, a System.DBNull object is returned. So, if you want to determine if
any object is returned from the ExecuteScalar() method, you can try the
following codes:

command.Connect ion.Open();
Object o = com.ExecuteScal ar();
com.Connection. Close();
if(o != null && o != System.DBNull.V alue)
return (Int32)o;
else
return null;

Does this answer your question? If anything is unclear, please feel free to
reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: " David N" <dq*****@netiq. com>
| Subject: Undefined Value
| Date: Sun, 5 Oct 2003 15:40:25 -0700
| Lines: 37
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OW************ **@tk2msftngp13 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: pat-50.bel.netiq.co m 65.219.170.50
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1891 08
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
|
| Hi All,
|
| What is a best way to handle an undefined value object class that returned
| from a function. I have a function that call the ADO.NET ExecuteScalar()
| function and returns the object to the calling function as follow:
|
|
| public object FunctionA()
| {
| object RetVal;
| ... some preparation code here
|
|
| RetVal = ExecuteScalar() ; // This one execute a stored procedure
| which can return an empty column
|
| Return RetVal;
| }
|
|
| public int FunctionB()
| {
| object SingleValue;
| ... some code here
|
|
| SingleValue = FunctionA();
| }
|
| The call to the FunctionA works only if the ExecuteScalar() returns a
value.
| If the stored procedure returns an empty column value, and then the call
to
| the FunctionA() breaks out with an exception...
|
| Any thoughts????
|
|
|

Nov 15 '05 #3
Hi David,

I'm sorry that I made a mistake in my former post. If the return value of
the function is a Int32 type. We cannot use

else
return null;

Because Int32 is a value ype.

Sorry for my mistake.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| X-Tomcat-ID: 46502818
| References: <OW************ **@tk2msftngp13 .phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: v-****@online.mic rosoft.com (Kevin Yu)
| Organization: Microsoft
| Date: Mon, 06 Oct 2003 02:47:42 GMT
| Subject: RE: Undefined Value
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| Message-ID: <6C************ *@cpmsftngxa06. phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| Lines: 60
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1891 32
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi David,
|
| IDbCommand.Exec uteScalar Method returns the first column of the first row
| in the resultset. If there are no rows returned from your command, a null
| reference is returned. If the first column of the first row is a (Null)
| value, a System.DBNull object is returned. So, if you want to determine
if
| any object is returned from the ExecuteScalar() method, you can try the
| following codes:
|
| command.Connect ion.Open();
| Object o = com.ExecuteScal ar();
| com.Connection. Close();
| if(o != null && o != System.DBNull.V alue)
| return (Int32)o;
| else
| return null;
|
| Does this answer your question? If anything is unclear, please feel free
to
| reply to the post.
|
| Kevin Yu
| =======
| "This posting is provided "AS IS" with no warranties, and confers no
| rights."
|
| --------------------
| | From: " David N" <dq*****@netiq. com>
| | Subject: Undefined Value
| | Date: Sun, 5 Oct 2003 15:40:25 -0700
| | Lines: 37
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| | Message-ID: <OW************ **@tk2msftngp13 .phx.gbl>
| | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| | NNTP-Posting-Host: pat-50.bel.netiq.co m 65.219.170.50
| | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
| | Xref: cpmsftngxa06.ph x.gbl
microsoft.publi c.dotnet.langua ges.csharp:1891 08
| | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| |
| |
| | Hi All,
| |
| | What is a best way to handle an undefined value object class that
returned
| | from a function. I have a function that call the ADO.NET
ExecuteScalar()
| | function and returns the object to the calling function as follow:
| |
| |
| | public object FunctionA()
| | {
| | object RetVal;
| | ... some preparation code here
| |
| |
| | RetVal = ExecuteScalar() ; // This one execute a stored procedure
| | which can return an empty column
| |
| | Return RetVal;
| | }
| |
| |
| | public int FunctionB()
| | {
| | object SingleValue;
| | ... some code here
| |
| |
| | SingleValue = FunctionA();
| | }
| |
| | The call to the FunctionA works only if the ExecuteScalar() returns a
| value.
| | If the stored procedure returns an empty column value, and then the
call
| to
| | the FunctionA() breaks out with an exception...
| |
| | Any thoughts????
| |
| |
| |
|
|

Nov 15 '05 #4
Hi David,

I'm sorry that I made a mistake in my former post. If the return value of
the function is a Int32 type. We cannot use

else
return null;

Because Int32 is a value ype.

Sorry for my mistake.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| X-Tomcat-ID: 46502818
| References: <OW************ **@tk2msftngp13 .phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: v-****@online.mic rosoft.com (Kevin Yu)
| Organization: Microsoft
| Date: Mon, 06 Oct 2003 02:47:42 GMT
| Subject: RE: Undefined Value
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| Message-ID: <6C************ *@cpmsftngxa06. phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| Lines: 60
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1891 32
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi David,
|
| IDbCommand.Exec uteScalar Method returns the first column of the first row
| in the resultset. If there are no rows returned from your command, a null
| reference is returned. If the first column of the first row is a (Null)
| value, a System.DBNull object is returned. So, if you want to determine
if
| any object is returned from the ExecuteScalar() method, you can try the
| following codes:
|
| command.Connect ion.Open();
| Object o = com.ExecuteScal ar();
| com.Connection. Close();
| if(o != null && o != System.DBNull.V alue)
| return (Int32)o;
| else
| return null;
|
| Does this answer your question? If anything is unclear, please feel free
to
| reply to the post.
|
| Kevin Yu
| =======
| "This posting is provided "AS IS" with no warranties, and confers no
| rights."
|
| --------------------
| | From: " David N" <dq*****@netiq. com>
| | Subject: Undefined Value
| | Date: Sun, 5 Oct 2003 15:40:25 -0700
| | Lines: 37
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| | Message-ID: <OW************ **@tk2msftngp13 .phx.gbl>
| | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| | NNTP-Posting-Host: pat-50.bel.netiq.co m 65.219.170.50
| | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
| | Xref: cpmsftngxa06.ph x.gbl
microsoft.publi c.dotnet.langua ges.csharp:1891 08
| | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| |
| |
| | Hi All,
| |
| | What is a best way to handle an undefined value object class that
returned
| | from a function. I have a function that call the ADO.NET
ExecuteScalar()
| | function and returns the object to the calling function as follow:
| |
| |
| | public object FunctionA()
| | {
| | object RetVal;
| | ... some preparation code here
| |
| |
| | RetVal = ExecuteScalar() ; // This one execute a stored procedure
| | which can return an empty column
| |
| | Return RetVal;
| | }
| |
| |
| | public int FunctionB()
| | {
| | object SingleValue;
| | ... some code here
| |
| |
| | SingleValue = FunctionA();
| | }
| |
| | The call to the FunctionA works only if the ExecuteScalar() returns a
| value.
| | If the stored procedure returns an empty column value, and then the
call
| to
| | the FunctionA() breaks out with an exception...
| |
| | Any thoughts????
| |
| |
| |
|
|

Nov 15 '05 #5
Yeap! when the function returns a null object, the caller will have
exception error without an opportunity to examine the object. That is
exactly what I have in FunctionA(), which returns a null object class to
FunctionB() - the caller. The call to

SingleValue = FunctionA(); generates the exception error.
// Have no chance to examine the SingleValue
if(SingleValue == dbnull)
......
....

"Kevin Yu" <v-****@online.mic rosoft.com> wrote in message
news:A8******** ******@cpmsftng xa06.phx.gbl...
Hi David,

I'm sorry that I made a mistake in my former post. If the return value of
the function is a Int32 type. We cannot use

else
return null;

Because Int32 is a value ype.

Sorry for my mistake.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| X-Tomcat-ID: 46502818
| References: <OW************ **@tk2msftngp13 .phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: v-****@online.mic rosoft.com (Kevin Yu)
| Organization: Microsoft
| Date: Mon, 06 Oct 2003 02:47:42 GMT
| Subject: RE: Undefined Value
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| Message-ID: <6C************ *@cpmsftngxa06. phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| Lines: 60
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1891 32 | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi David,
|
| IDbCommand.Exec uteScalar Method returns the first column of the first row | in the resultset. If there are no rows returned from your command, a null | reference is returned. If the first column of the first row is a (Null)
| value, a System.DBNull object is returned. So, if you want to determine
if
| any object is returned from the ExecuteScalar() method, you can try the
| following codes:
|
| command.Connect ion.Open();
| Object o = com.ExecuteScal ar();
| com.Connection. Close();
| if(o != null && o != System.DBNull.V alue)
| return (Int32)o;
| else
| return null;
|
| Does this answer your question? If anything is unclear, please feel free
to
| reply to the post.
|
| Kevin Yu
| =======
| "This posting is provided "AS IS" with no warranties, and confers no
| rights."
|
| --------------------
| | From: " David N" <dq*****@netiq. com>
| | Subject: Undefined Value
| | Date: Sun, 5 Oct 2003 15:40:25 -0700
| | Lines: 37
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| | Message-ID: <OW************ **@tk2msftngp13 .phx.gbl>
| | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| | NNTP-Posting-Host: pat-50.bel.netiq.co m 65.219.170.50
| | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
| | Xref: cpmsftngxa06.ph x.gbl
microsoft.publi c.dotnet.langua ges.csharp:1891 08
| | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| |
| |
| | Hi All,
| |
| | What is a best way to handle an undefined value object class that
returned
| | from a function. I have a function that call the ADO.NET
ExecuteScalar()
| | function and returns the object to the calling function as follow:
| |
| |
| | public object FunctionA()
| | {
| | object RetVal;
| | ... some preparation code here
| |
| |
| | RetVal = ExecuteScalar() ; // This one execute a stored procedure
| | which can return an empty column
| |
| | Return RetVal;
| | }
| |
| |
| | public int FunctionB()
| | {
| | object SingleValue;
| | ... some code here
| |
| |
| | SingleValue = FunctionA();
| | }
| |
| | The call to the FunctionA works only if the ExecuteScalar() returns a
| value.
| | If the stored procedure returns an empty column value, and then the
call
| to
| | the FunctionA() breaks out with an exception...
| |
| | Any thoughts????
| |
| |
| |
|
|

Nov 15 '05 #6
Hi David,

Did you mean that the exception was thrown from FunctionA()? If so, you
have to use a Try block in FunctionA().
Please try to write FunctionA() as the code snippet I wrote in my last
post, and put it in a Try block. If any exception is thrown, it will be
caught in the Catch block.

Try
command.Connect ion.Open();
Object o = com.ExecuteScal ar();
com.Connection. Close();
if(o != null && o != System.DBNull.V alue)
return (Int32)o;
else
return 0;
Catch
return 0;

In my code 0 is the error code. No exception will be thrown out of
FunctionA().

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: " David N" <dq*****@netiq. com>
| References: <OW************ **@tk2msftngp13 .phx.gbl>
<6C************ *@cpmsftngxa06. phx.gbl>
<A8************ **@cpmsftngxa06 .phx.gbl>
| Subject: Re: Undefined Value
| Date: Mon, 6 Oct 2003 09:41:58 -0700
| Lines: 149
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <O0************ **@TK2MSFTNGP12 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: pat-50.bel.netiq.co m 65.219.170.50
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1892 99
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Yeap! when the function returns a null object, the caller will have
| exception error without an opportunity to examine the object. That is
| exactly what I have in FunctionA(), which returns a null object class to
| FunctionB() - the caller. The call to
|
| SingleValue = FunctionA(); generates the exception error.
|
|
| // Have no chance to examine the SingleValue
| if(SingleValue == dbnull)
| .....
| ...
|
|
|
|
|
| "Kevin Yu" <v-****@online.mic rosoft.com> wrote in message
| news:A8******** ******@cpmsftng xa06.phx.gbl...
| > Hi David,
| >
| > I'm sorry that I made a mistake in my former post. If the return value
of
| > the function is a Int32 type. We cannot use
| >
| > else
| > return null;
| >
| > Because Int32 is a value ype.
| >
| > Sorry for my mistake.
| >
| > Kevin Yu
| > =======
| > "This posting is provided "AS IS" with no warranties, and confers no
| > rights."
| >
| > --------------------
| > | X-Tomcat-ID: 46502818
| > | References: <OW************ **@tk2msftngp13 .phx.gbl>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain
| > | Content-Transfer-Encoding: 7bit
| > | From: v-****@online.mic rosoft.com (Kevin Yu)
| > | Organization: Microsoft
| > | Date: Mon, 06 Oct 2003 02:47:42 GMT
| > | Subject: RE: Undefined Value
| > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| > | Message-ID: <6C************ *@cpmsftngxa06. phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| > | Lines: 60
| > | Path: cpmsftngxa06.ph x.gbl
| > | Xref: cpmsftngxa06.ph x.gbl
| microsoft.publi c.dotnet.langua ges.csharp:1891 32
| > | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
| > |
| > | Hi David,
| > |
| > | IDbCommand.Exec uteScalar Method returns the first column of the first
| row
| > | in the resultset. If there are no rows returned from your command, a
| null
| > | reference is returned. If the first column of the first row is a
(Null)
| > | value, a System.DBNull object is returned. So, if you want to
determine
| > if
| > | any object is returned from the ExecuteScalar() method, you can try
the
| > | following codes:
| > |
| > | command.Connect ion.Open();
| > | Object o = com.ExecuteScal ar();
| > | com.Connection. Close();
| > | if(o != null && o != System.DBNull.V alue)
| > | return (Int32)o;
| > | else
| > | return null;
| > |
| > | Does this answer your question? If anything is unclear, please feel
free
| > to
| > | reply to the post.
| > |
| > | Kevin Yu
| > | =======
| > | "This posting is provided "AS IS" with no warranties, and confers no
| > | rights."
| > |
| > | --------------------
| > | | From: " David N" <dq*****@netiq. com>
| > | | Subject: Undefined Value
| > | | Date: Sun, 5 Oct 2003 15:40:25 -0700
| > | | Lines: 37
| > | | X-Priority: 3
| > | | X-MSMail-Priority: Normal
| > | | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | | Message-ID: <OW************ **@tk2msftngp13 .phx.gbl>
| > | | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| > | | NNTP-Posting-Host: pat-50.bel.netiq.co m 65.219.170.50
| > | | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
| > | | Xref: cpmsftngxa06.ph x.gbl
| > microsoft.publi c.dotnet.langua ges.csharp:1891 08
| > | | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| > | |
| > | |
| > | | Hi All,
| > | |
| > | | What is a best way to handle an undefined value object class that
| > returned
| > | | from a function. I have a function that call the ADO.NET
| > ExecuteScalar()
| > | | function and returns the object to the calling function as follow:
| > | |
| > | |
| > | | public object FunctionA()
| > | | {
| > | | object RetVal;
| > | | ... some preparation code here
| > | |
| > | |
| > | | RetVal = ExecuteScalar() ; // This one execute a stored
procedure
| > | | which can return an empty column
| > | |
| > | | Return RetVal;
| > | | }
| > | |
| > | |
| > | | public int FunctionB()
| > | | {
| > | | object SingleValue;
| > | | ... some code here
| > | |
| > | |
| > | | SingleValue = FunctionA();
| > | | }
| > | |
| > | | The call to the FunctionA works only if the ExecuteScalar() returns
a
| > | value.
| > | | If the stored procedure returns an empty column value, and then the
| > call
| > | to
| > | | the FunctionA() breaks out with an exception...
| > | |
| > | | Any thoughts????
| > | |
| > | |
| > | |
| > |
| > |
| >
|
|
|

Nov 15 '05 #7

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

Similar topics

0
2548
by: Gene Mat | last post by:
Hi, I'm trying to build a simple Perl program to get a list of newsgroups. Here's what I have... #!/opt/local/bin/perl use Net::NNTP; $nntp = Net::NNTP->new("nntp.perl.org",Debug,10); $LIST=$nnpt->list; $nntp->quit; Can't call method "list" on an undefined value at ./getnntp.pl line 13.
2
5227
by: Guinness Mann | last post by:
Greetings, I asked this question over on the ADO.NET newsgroup and couldn't scrape up an answer. I realize that it is more of an ADO question than an SQL Server question, but I'm hoping there might be an ADO programmer here that can explain this to me. I'm developing database applications using C# on VS.NET 2003 and SQL Server Standard...
0
1852
by: Dave | last post by:
Hi everyone, (I already posted this to the VS.NET IDE news group without any responses, so I'm attempting one more time in this group) The issue I'm having is occuring in the IDE of VS.NET 2003, although I'm not sure what is actually causing the problem. I can't summarize the issue, so please read on to find out more. I've created a...
1
3999
by: Jean Stax | last post by:
Hi ! I created a sample library project. In my second project I reference this library and make the following call, which returns "undefined value": Type myType = Type.GetType("SampleLib.MyClass"); My guess was that the function fails because my library isn't loaded yet.
3
29734
by: Mark Sullivan | last post by:
When I trace through a csharp program I came to a situation where a certain values has an "undefined value" as shown in the debugger DbgClr. I want to check this but the following statements did not recognize this "non"-value if (type.Particle != Undefined.Value) { .... or if (type.Particle != null) { .....
5
3401
by: Steven Prasil | last post by:
I have a C# program with an if statement similar to if (obj.myvar != Undefined.Value) { ...... } When I test it in the CSharp CLR debugger this debugger does not recoginze that the value is currently <undefined value> as shown in the watch list of the Debugger. Hence the program branches into the if statement although it should skip it...
3
1789
by: Girish | last post by:
Hi , I am migrating from VC 6.0 to VC 7.0 with ( windows Control Lib option in vc dot net ) where I want to draw an image using StretchDIBits. I am not able to get the HDC of the Window. I tried using get_handel() which gives undefined value. Any help regarding this will be great. Thanx in Advance, G.Girish
1
2251
by: Joseph Geretz | last post by:
Why isn't the ASP.NET runtime providing a valid reference for this object to my WebService? I'm trying to use WSE and DIME to send attachments via Web Service. I've provided a whole lot of information in the thread below: DIME: Attachments.Add - Object reference not set to an instance of an object. Bu when all is said and done, the crux...
1
5898
by: OtisUsenet | last post by:
Hi, I have a bookmarklet that works perfectly in Firefox, IE, Konqueror, and Opera, but in Safari 2.0.3 (417.9.2) it doesn't work. I enabled debugging and I can see "TypeError - Undefined value" reported in the Javascript console, but I'm not sure where the error is. The bookmarklet in question is here: javascript:if...
0
7852
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8216
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6629
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.