Click here to Skip to main content
15,891,409 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionNewbie question: Local file access from an ASP app. Pin
nicknotyet22-Apr-09 12:57
nicknotyet22-Apr-09 12:57 
AnswerRe: Newbie question: Local file access from an ASP app. [modified] Pin
Yusuf22-Apr-09 14:08
Yusuf22-Apr-09 14:08 
GeneralRe: Newbie question: Local file access from an ASP app. Pin
nicknotyet22-Apr-09 14:26
nicknotyet22-Apr-09 14:26 
GeneralRe: Newbie question: Local file access from an ASP app. Pin
scottgp22-Apr-09 16:10
professionalscottgp22-Apr-09 16:10 
GeneralRe: Newbie question: Local file access from an ASP app. Pin
nicknotyet22-Apr-09 16:39
nicknotyet22-Apr-09 16:39 
GeneralRe: Newbie question: Local file access from an ASP app. Pin
Yusuf23-Apr-09 3:32
Yusuf23-Apr-09 3:32 
GeneralRe: Newbie question: Local file access from an ASP app. Pin
nicknotyet23-Apr-09 10:32
nicknotyet23-Apr-09 10:32 
QuestionHandling a null value Pin
Ekjon22-Apr-09 11:40
Ekjon22-Apr-09 11:40 
I have a query suppossed to return average values (SELECT AVG(DATA_VALUE)....).
However, it returns null when no data is present for the matching criteria.

I am using a data reader to read the value. like:
<br />
dr = cmdSelect.ExecuteReader();<br />
if (dr.HasRows)<br />
{<br />
    dr.Read();<br />
    string getAvg = dr.GetString(0);<br />
    if (getAvg != null)<br />
    {<br />
        valArr[0] = Convert.ToDouble(getAvg);<br />
        log.Add(...);<br />
    }<br />
    else{...}<br />
}        <br />

Funny thing is - dr.HasRows is true because the query is returning a record even though the value is null. I also tried GetObject(0) instead of GetString(0), and tried cmd.ExecuteScalar() instead of ExecuteReader(), but still could not manage it. Its going to an Exception saying - "Data is Null. This method or property cannot be called on Null values."

Any help? Thanks.
AnswerRe: Handling a null value Pin
Yusuf22-Apr-09 14:12
Yusuf22-Apr-09 14:12 
AnswerRe: Handling a null value Pin
Perry Holman22-Apr-09 16:26
Perry Holman22-Apr-09 16:26 
GeneralRe: Handling a null value Pin
Ekjon23-Apr-09 5:15
Ekjon23-Apr-09 5:15 
Questiontree view select all child nodes when to click parent nodes Pin
T_Teef22-Apr-09 9:54
T_Teef22-Apr-09 9:54 
AnswerRe: tree view select all child nodes when to click parent nodes Pin
ToddHileHoffer22-Apr-09 10:03
ToddHileHoffer22-Apr-09 10:03 
QuestionRe: tree view select all child nodes when to click parent nodes Pin
T_Teef22-Apr-09 10:06
T_Teef22-Apr-09 10:06 
AnswerRe: tree view select all child nodes when to click parent nodes Pin
Fayu22-Apr-09 10:10
Fayu22-Apr-09 10:10 
QuestionRe: tree view select all child nodes when to click parent nodes Pin
T_Teef22-Apr-09 10:18
T_Teef22-Apr-09 10:18 
AnswerRe: tree view select all child nodes when to click parent nodes Pin
ToddHileHoffer22-Apr-09 10:21
ToddHileHoffer22-Apr-09 10:21 
GeneralRe: tree view select all child nodes when to click parent nodes Pin
T_Teef22-Apr-09 10:44
T_Teef22-Apr-09 10:44 
QuestionUsing Master Page as the DB reader which implements the reading on all child pages [modified] Pin
shabya22-Apr-09 8:20
shabya22-Apr-09 8:20 
AnswerRe: Using Master Page as the DB reader which implements the reading on all child pages Pin
ToddHileHoffer22-Apr-09 9:59
ToddHileHoffer22-Apr-09 9:59 
GeneralRe: Using Master Page as the DB reader which implements the reading on all child pages Pin
shabya23-Apr-09 7:07
shabya23-Apr-09 7:07 
QuestionViewState storing custom class Pin
Fayu22-Apr-09 8:14
Fayu22-Apr-09 8:14 
AnswerRe: ViewState storing custom class Pin
ToddHileHoffer22-Apr-09 9:58
ToddHileHoffer22-Apr-09 9:58 
GeneralRe: ViewState storing custom class Pin
Fayu22-Apr-09 10:08
Fayu22-Apr-09 10:08 
GeneralRe: ViewState storing custom class Pin
ToddHileHoffer22-Apr-09 10:19
ToddHileHoffer22-Apr-09 10:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.