Click here to Skip to main content
15,915,042 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: window in internet explorer. [modified] Pin
sathish s9-Jun-06 1:07
sathish s9-Jun-06 1:07 
QuestionRemote capture SharePoint? Pin
Lane Yu8-Jun-06 17:17
Lane Yu8-Jun-06 17:17 
QuestionMessage Box Alerting Pin
donle0698-Jun-06 11:42
donle0698-Jun-06 11:42 
AnswerRe: Message Box Alerting Pin
Steve Echols8-Jun-06 19:16
Steve Echols8-Jun-06 19:16 
QuestionCoding for a resume grabber Pin
SuperBert8-Jun-06 10:48
SuperBert8-Jun-06 10:48 
AnswerRe: Coding for a resume grabber Pin
SuperBert8-Jun-06 10:52
SuperBert8-Jun-06 10:52 
Questionimage javascript while run process Pin
raquidd228-Jun-06 6:37
raquidd228-Jun-06 6:37 
Questionnull reference, object reference not set to instance of object Pin
uglyeyes8-Jun-06 3:07
uglyeyes8-Jun-06 3:07 
Hi all,

my exception details is:

NullReferenceException: Object reference not set to an instance of an object. at ShirePlan.ShirePlanSub.GetRecords(String scID) in c:\inetpub\wwwroot\ShirePlan\ShirePlanSub.aspx.vb:line 120

my aspx code:
==================================================================================================
<asp:datalist id="dlScHead" runat="server" ShowFooter="False" ShowHeader="False" CellSpacing="0"
CellPadding="0" Width="100%">
<ItemTemplate>
<table style="FONT-SIZE: 0.8em; font-face: Arial" cellPadding="5" width="100%" align="center"
border="0">
<tr>
<td style="BORDER-RIGHT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-BOTTOM: #000000 2px solid"
colSpan="3"><b>
<%# ctype(DataBinder.Eval(Container.DataItem,"ScoreCardID"),string) %>
&nbsp;&nbsp;
<%# ctype(DataBinder.Eval(Container.DataItem,"scorecarddesc"),string) %>
</b>
<br>
<%# ctype(DataBinder.Eval(Container.DataItem,"BusinessGoal"),string) %>
</td>
</tr>
</table>
<asp:datalist ID="dlScChart" Width="100%" DataSource='<%# (GetRecords(Cstr(DataBinder.Eval(Container.DataItem, "scoreCardId"))))%>' runat="server">
<ItemStyle VerticalAlign="Top" BackColor="#EEEEEE"></ItemStyle>
<ItemTemplate>
<table>
<tr valign="top">
<td>
<asp:PlaceHolder id="Placeholder1" runat="server"></asp:PlaceHolder>
</td>
</tr>
</table>
</ItemTemplate>
</asp:datalist>
<table style="FONT-SIZE: 0.8em; font-face: Arial" cellPadding="5" width="100%" align="center"
border="0">
<tr>
<td colSpan="3">
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter1").tostring()) %>
<br>
<br>
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter2").tostring()) %>
<br>
<br>
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter3").tostring()) %>
<br>
<br>
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter4").tostring()) %>
<br>
<br>
</td>
</tr>
</table>
</ItemTemplate>
</asp:datalist>

==================================================================================================
my vb code.
=============================
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dlScHead.DataSource = GetRecords(Nothing)
dlScHead.DataBind()

End Sub

Function GetRecords(ByVal scID As String) As SqlDataReader
Dim bizProgName As String = Request.QueryString("bizProgId")
Dim CommandText As String


Try
objConn = New SqlConnection(dbPath)
objConn.Open()

If scID = Nothing Then
Dim da As New SqlDataAdapter
da.SelectCommand = New SqlCommand
da.SelectCommand.Connection = objConn
da.SelectCommand.CommandText = "select scorecardId,bizProgId,scorecarddesc,businessgoal,strategy,quarter1,quarter2,quarter3,quarter4 from textData where bizProgID='" & Request.QueryString("bizProgId") & "'"
dr = da.SelectCommand.ExecuteReader(CommandBehavior.CloseConnection)
If dr.HasRows Then
'lblError.Text = ""
Else
'lblError.Text = "No records returned"
End If
GetRecords = dr

Else

cmd = New SqlCommand("select distinct measure_id from measuredata where scoreCardId = '" & scID & "'", objConn)

Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dtId As New DataTable("MeasureId")

da.Fill(dtId)

'select all columns with ID
Dim cmd1 As SqlCommand = New SqlCommand("select * from measureData where scoreCardId = '" & scID & "'", objConn)

Dim da1 As SqlDataAdapter = New SqlDataAdapter(cmd1)
Dim dt As New DataTable("MeasureSource")

da1.Fill(dt)

Dim datarow As DataRow

For Each datarow In dtId.Rows
Dim chart As New DataGrid
Dim myView As New DataView(dt)

' Dim chart As New Mycos.MycosChartWeb
myView.RowFilter = String.Format("Measure_Id='{0}'", datarow.Item("measure_Id"))

chart.DataSource = myView
chart.DataBind()
Dim i As Integer
For i = 0 To dlScChart.Items.Count - 1
dlScChart.Items(i).FindControl("Placeholder1").Controls.Add(chart)
Next
Next datarow

End If

Catch ex As Exception
Response.Write("error on child" + ex.ToString)
Finally



End Try
===============================================================
please help me i try to debug it but i just dont know why i am getting null reference exception.


AnswerRe: null reference, object reference not set to instance of object Pin
uglyeyes8-Jun-06 15:19
uglyeyes8-Jun-06 15:19 
Questionjavascirpt validation Pin
Goodway8-Jun-06 0:42
Goodway8-Jun-06 0:42 
AnswerRe: javascirpt validation Pin
WoutL8-Jun-06 1:39
WoutL8-Jun-06 1:39 
Questiondream weaver Pin
abdelhameed817-Jun-06 8:18
abdelhameed817-Jun-06 8:18 
QuestionHow i can get a free space for ASP.NET? Pin
yodern7-Jun-06 3:36
yodern7-Jun-06 3:36 
AnswerRe: How i can get a free space for ASP.NET? Pin
Guffa7-Jun-06 3:43
Guffa7-Jun-06 3:43 
GeneralRe: How i can get a free space for ASP.NET? Pin
yodern7-Jun-06 4:22
yodern7-Jun-06 4:22 
AnswerRe: How i can get a free space for ASP.NET? Pin
Vasudevan Deepak Kumar9-Jun-06 0:15
Vasudevan Deepak Kumar9-Jun-06 0:15 
QuestionIE7 JS Library LOCKS UP IE Pin
quantass7-Jun-06 0:58
quantass7-Jun-06 0:58 
QuestionActivex Control Pin
kumarprabhakar746-Jun-06 21:34
kumarprabhakar746-Jun-06 21:34 
QuestionBizare web service proxy server issue Pin
Mr Brown Shoes6-Jun-06 19:16
Mr Brown Shoes6-Jun-06 19:16 
AnswerRe: Bizare web service proxy server issue Pin
Mr Brown Shoes7-Jun-06 19:01
Mr Brown Shoes7-Jun-06 19:01 
QuestionIIS Log Parsing Pin
MrEyes6-Jun-06 11:30
MrEyes6-Jun-06 11:30 
Questionhow do i filling items in a drop down box in asp? Pin
keroed_edmond6-Jun-06 5:23
keroed_edmond6-Jun-06 5:23 
AnswerRe: how do i filling items in a drop down box in asp? Pin
CWIZO6-Jun-06 22:35
CWIZO6-Jun-06 22:35 
GeneralRe: how do i filling items in a drop down box in asp? Pin
AfriDiesel8-Jun-06 5:55
AfriDiesel8-Jun-06 5:55 
QuestionMigrating to .NET 2.0 Pin
Vlad Gabovich6-Jun-06 4:59
Vlad Gabovich6-Jun-06 4:59 

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.