Hi,
I am trying to load control as a record is being updated in a backend
database. The codes reads like this:
Dim ds As DataSet
CType(Page.FindControl("ddlStatus"),
DropDownList).SelectedValue = _status
Dim sql As String = "select * from _loanApp where status=" &
_status
ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings("DSN"), _
CommandType.Text, sql)
CType(Page.FindControl("dgList"), DataGrid).DataSource = ds
CType(Page.FindControl("dgList"), DataGrid).DataBind()
but it is giving me this error.
System.NullReferenceException: Object reference not set to an instance
of an object.
The stack trace reads:
[NullReferenceException: Object reference not set to an instance of an
object.]
Any help is appreciated. 4 1106
What line gives the error? It will be one of the Page.FindControl commands
not finding the control you're asking for.
"AlecL" <sa********@hotmail.comwrote in message
news:11*********************@h3g2000cwc.googlegrou ps.com...
Hi,
I am trying to load control as a record is being updated in a backend
database. The codes reads like this:
Dim ds As DataSet
CType(Page.FindControl("ddlStatus"),
DropDownList).SelectedValue = _status
Dim sql As String = "select * from _loanApp where status=" &
_status
ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings("DSN"), _
CommandType.Text, sql)
CType(Page.FindControl("dgList"), DataGrid).DataSource = ds
CType(Page.FindControl("dgList"), DataGrid).DataBind()
but it is giving me this error.
System.NullReferenceException: Object reference not set to an instance
of an object.
The stack trace reads:
[NullReferenceException: Object reference not set to an instance of an
object.]
Any help is appreciated.
On Feb 1, 10:51 am, "Aidy" <a...@noemail.xxxa.comwrote:
What line gives the error? It will be one of the Page.FindControl commands
not finding the control you're asking for.
"AlecL" <salmaan...@hotmail.comwrote in message
news:11*********************@h3g2000cwc.googlegrou ps.com...
Hi,
I am trying to load control as a record is being updated in a backend
database. The codes reads like this:
Dim ds As DataSet
CType(Page.FindControl("ddlStatus"),
DropDownList).SelectedValue = _status
Dim sql As String = "select * from _loanApp where status=" &
_status
ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings("DSN"), _
CommandType.Text, sql)
CType(Page.FindControl("dgList"), DataGrid).DataSource = ds
CType(Page.FindControl("dgList"), DataGrid).DataBind()
but it is giving me this error.
System.NullReferenceException: Object reference not set to an instance
of an object.
The stack trace reads:
[NullReferenceException: Object reference not set to an instance of an
object.]
Any help is appreciated.- Hide quoted text -
- Show quoted text -
Yes it is the CType(Page.FindControl("ddlStatus"),
DropDownList).SelectedValue = _status line .
Thanks
Debug it. Set a breakpoint and see what returns null.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"AlecL" <sa********@hotmail.comwrote in message
news:11*********************@h3g2000cwc.googlegrou ps.com...
Hi,
I am trying to load control as a record is being updated in a backend
database. The codes reads like this:
Dim ds As DataSet
CType(Page.FindControl("ddlStatus"),
DropDownList).SelectedValue = _status
Dim sql As String = "select * from _loanApp where status=" &
_status
ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings("DSN"), _
CommandType.Text, sql)
CType(Page.FindControl("dgList"), DataGrid).DataSource = ds
CType(Page.FindControl("dgList"), DataGrid).DataBind()
but it is giving me this error.
System.NullReferenceException: Object reference not set to an instance
of an object.
The stack trace reads:
[NullReferenceException: Object reference not set to an instance of an
object.]
Any help is appreciated.
ddlStatus won't be a dropdownlist with view state enabled then.
Can;t really say much more given the relevant code.
"AlecL" <sa********@hotmail.comwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...
On Feb 1, 10:51 am, "Aidy" <a...@noemail.xxxa.comwrote:
>What line gives the error? It will be one of the Page.FindControl commands not finding the control you're asking for.
"AlecL" <salmaan...@hotmail.comwrote in message
news:11*********************@h3g2000cwc.googlegro ups.com...
Hi,
I am trying to load control as a record is being updated in a backend
database. The codes reads like this:
Dim ds As DataSet
CType(Page.FindControl("ddlStatus"),
DropDownList).SelectedValue = _status
Dim sql As String = "select * from _loanApp where status=" &
_status
ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings("DSN"), _
CommandType.Text, sql)
CType(Page.FindControl("dgList"), DataGrid).DataSource = ds
CType(Page.FindControl("dgList"), DataGrid).DataBind()
but it is giving me this error.
System.NullReferenceException: Object reference not set to an instance
of an object.
The stack trace reads:
[NullReferenceException: Object reference not set to an instance of an
object.]
Any help is appreciated.- Hide quoted text -
- Show quoted text -
Yes it is the CType(Page.FindControl("ddlStatus"),
DropDownList).SelectedValue = _status line .
Thanks This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Douglas Buchanan |
last post by:
I am using the following code instead of a very lengthly select case
statement.
(I have a lot of lookup tables in a settings form that are selected
from a ListBox. The data adapters are given a...
|
by: Eamonn O'Connell |
last post by:
Hi,
We have an ASP.net application, where we dynamically add controls, in the
Page_Load. Occasionally, when the user posts back the page (e.g. clicks Save
button on the page), we get a "Failed...
|
by: Michael |
last post by:
Hi,
Any one know the problem of the following error:
Thanks,
m
Failed to load viewstate. The control tree into which
viewstate is being loaded must match the control tree
that was used to...
|
by: Patrick |
last post by:
I understand it is built in behaviour that if an ASP.NET's web.config is set
to:
<customErrors
mode="RemoteOnly"
/>
then I only get a detailed error message on screen when the ASP.NET...
|
by: MarkD |
last post by:
I have an ASP.NET (VB.NET) application that calls all VB6 COM DLL via
Interop. The DLL uses functionality contained in a Custom OCX Control
(Also VB6) that in turn contains a standard TreeView...
|
by: Carl Howarth |
last post by:
Hello there,
I am currently in the process of 'getting strict' with some of our aspx.vb
files. I have a function that is called either when a datarepeater is bound
or when a button on the...
|
by: HKSHK |
last post by:
This list compares the error codes used in VB.NET 2003 with those used
in VB6.
Error Codes:
============
3: This Error number is obsolete and no longer used. (Formerly:
Return without GoSub)...
|
by: Justin Dutoit |
last post by:
Hey. I'm trying to dynamically add User Controls to my page. It appears to
work sometimes, but more often I get the error:
Unable to cast object of type 'ASP.SearchControl' to type...
|
by: davidr |
last post by:
Hi,
I have a panel that I load user Control in no problem. The problem
arrises when I do a post back on one of these user controls. I have
button it does a click event. In this click event I...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |