Showing posts with label dim. Show all posts
Showing posts with label dim. Show all posts

Monday, March 26, 2012

Object reference not set

Hi, the exception "Object reference not set to an instance of an object", was thrown when I run my code.

If Not IsPostBack Then

Dim DBConn As OdbcConnection
Dim DBCommand As OdbcDataAdapter
Dim i As Integer

For i = 0 To CarNamesDL.Items.Count - 1
If CarNamesDL.Items(i).Selected Then
DBConn = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=CarCompaniesDB;User=root;Password=soukpass;Option=3;")
DBCommand = New OdbcDataAdapter("SELECT CarID, Model From CarCompaniesDB where Make = '" & CarNamesDL.Items(i).Text & "'", DBConn)
Else : Exit For
End If
Next

DBCommand.Fill(DS, "CarCompaniesDB")

CarNamesDL.DataSource = DS.Tables("CarCompaniesDB").DefaultView

CarNamesDL.DataBind()

End If

This is the Source error:

Line 43: End If
Line 44: Next
Line 45: DBCommand.Fill(DS, "CarCompaniesDB")
Line 46:
Line 47: CarNames.DataSource = DS.Tables("CarCompaniesDB").DefaultView

I don't know what could be causing this. I don't think its because of notdeclaring a variable before its use 'cause I've checked. I'm not sureif its bad scoping, I've also made sure to Exit the For Loop

in the Else clause in case no match was found. Please take a look to see if my code is missing something or if it is incorrect, thank you in advance for yourhelp.

Hi,

Is your DS anywhere declared and new DataSet created and assigned to DS?

Even if your DS is declared somewhere else or not declared at all, you need to create new DataSet and assign it to DS variable.

DS = New DataSet()

-yuriy


please post complete post.

I dont see that you have initialize any where the "DS" that is DataSet.


Hi, thanks for your reply my code now sort of works but it still has a little problem. The following is my modified code:

If Not IsPostBack Then

Dim DBConn As OdbcConnection
Dim DBCommand As OdbcCommand
Dim i As Integer
Dim DS As New DataSet
For i = 0 To CarNamesDL.Items.Count - 1
If CarNamesDL.Items(i).Selected Then
DBConn = New OdbcConnection("Driver={MySQL ODBC 3.51Driver};Server=myServer;Database=CarCompaniesDB;User=myUser;Password=myPass;Option=3;")
DBCommand = New OdbcCommand("SELECT CarID, Model From CarCompaniesDBwhere Make = '" & CarNamesDL.Items(i).Text & "'", DBConn)

End If
Next
If Not IsNothing(DBConn) Then
DBConn.Open()
DBCommand.Connection = DBConn
Dim AD As New OdbcDataAdapter(DBCommand)

AD.Fill(DS, "CarCompaniesDB")
Me.CarNamesDL.DataTextField = "CarID"
Me.CarNamesDL.DataValueField = "Model"

CarNamesDL.DataBind()

End If
End If

Thisis the code for the button used to display the result, I don't quiteunderstand it since doing something different than what the MSDN saysits suppose to do.

Private Sub Bt_OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bt_OK.Click
lblDataSelected.Text = "Selected Text: " &CarNamesDL.SelectedItem.Text & "<BR> Selected Value: " &CarNamesDL.SelectedValue & "<BR> Selected Index: " &CarNamesDL.SelectedIndex
End Sub

How do I get it to display make "Model" and not just the listitem when a user selects a listitem? Thank you for your help.

Object reference not set to an instance

Hi,

I'm getting

'Object reference not set to an instance of an object' error when I have


Dim lblEnterNew As System.Web.UI.WebControls.Label

If DataGrid1.EditItemIndex > -1 Then
lblEnterNew.Visible = False
Else
lblEnterNew.Visible = True
End If

and my control in the page is


<asp:Label id="lblEnterNew" runat="server" class="dept"></asp:Label>

Any idea why I'm getting this error?Are you sure that the error occurs on the label? The label looks ok to me.
You are getting the error because you are dim-ing an instance of a label in a variable at the same time it is probably already dimmed in the hidden code-behind in the '#Region " Web Form Designer Generated Code " ' region. You would probably not get the error if you dimmed it wit the New statement "Dim lblEnterNew as New System.Web.UI.WebControls.Label" but then you would have problems referencing the actual control on the web page.

Try removing the "Dim lblEnterNew as System.Web.UI.WebControls.Label" line from the code as this should fix the problem and there should be a statement similiar to: "Protected Withevents lblEnterNew as Label" near the top of the code behind page already.
That worked. Should all of my controls be dimmed in the '#Region' but not variables?
All controls which you create in the design mode of Visual Studio are automatically dimed in the #Region section. You can define your own variables just after the class has started!

Object reference not set to an instance of an object

Please Help

I have the following code ..

Dim

getDateCMP231As Label

getDateETH325 =

CType(FormView1.FindControl("ETH325DateLabel.text"), Label)
txtETH235.Text = getDateETH325.Text.ToString

Which throws out the following error below. I cannot seem to find the problem.

Object reference not set to an instance of an object.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 80: Line 81: getDateETH325 = CType(FormView1.FindControl("ETH325DateLabel.text"), Label)Line 82: txtETH235.Text = getDateETH325.Text.ToStringLine 83: Line 84: getDateETH212 = CType(FormView1.FindControl("ETH212DateLabel"), Label)

I hate these errors -- got a lot of experience with them and thankfully, I think yours is easy...change line 81 to

.FindControl("ETH325DateLabel"), Label)

(dump the .text)


She still no work.

The thing is I have the same type of code on another page (below) and that works, no problem. I am pulling the little hair that i already have trying to sort this out.

Any idea's

Dim

getFNameAs Label

getFName =

CType(FormView1.FindControl("FirstNameLabel"), Label)

firstName.Text = getFName.Text


Try this ...see if you get a different result.

Private departmentAs String =CType(FormView1.FindControl("Label1"), TextBox).Text

There is an error message on 'Private' saying '"Private" is not valid on a local variable declaration '


One thing to add to your code is a try/catch block: it could be that the FindControl does return null (if the control is not found). Therefore, I suggest to put these 2 lines in a try catch block.

HTH

I may be being dumb, but you seem to have several variables used in this bit of code and I think you may be getting confused between them.

You declare "getDateCMP231" as a label, butdon't appear to use it!

You do the assignment "getDateETH325 =CType(FormView1.FindControl("ETH325DateLabel.text"), Label)" but what is "getDateETH325" where is it declared? Is this supposed to be "getDateCMP231"?

Then you assign the text in the label control "ETH325DateLabel" to "txtETH235.text" which I assume is a control on your page.

Try looking carefully at the naming of the controls/variables and see if you are getting mixed up!



Thanks, I managed to sort it out, but i don't know why it works.

I moved the variable declaration (below), just below the "Inherits System.Web.UI.Page" and it works. I tried to move it back to the sub procedure and again i get the error.Hmm Thanks again

Dim getDateETH325As Label


Thanks, I managed to sort it out, but i don't know why it works.

I moved the variable declaration (below), just below the "Inherits System.Web.UI.Page" and it works. I tried to move it back to the sub procedure and again i get the error.Hmm Thanks again

Dim getDateETH325As Label

Object reference not set to an instance of an object

here is my code.. i am trying to get the zipcode information from an active directory server

<%
Dim entry As New DirectoryServices.DirectoryEntry("LDAP://schpdc")
Dim Dsearch As New DirectoryServices.DirectorySearcher(entry)
Dim zip As String
Dim UserName As String
Dim testname As String
zip = "error"
UserName = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Split("\")(1)
Response.Write(UserName & "<br>")
Dsearch.Filter = "(cn=" + UserName + ")"
Response.Write(Dsearch.Filter)
Try
zip = Dsearch.FindOne.Properties("zipcode").ToString()
Catch E As Exception
zip = "Error: " & E.Message
End Try
Response.Write(zip)
%>

please help.. i am now just spinning my wheels!!!

Which line is throwing the error?


To be honest i am not sure what is causing the error.. however i am pretty sure it is in the try statement as that is what actually writes it out and it always runs the catch. (sorry for the delay in reply.. i was sick yesterday)


Put breakPoint to debud the error. Usually, the error happened in Name.Split("\")(1) or Properties("zipcode").ToString(). Because you already put try.. catch for Properties("zipcode").ToString(), I am afraid the error was caused by Name.Split("\")(1).


i dont think that is the case.. i added a line to make the username = to the full return (instead of the split return) here is what i get

FORTITECH\intranet
intranet
(& (objectClass=user)(cn=intranet))Error: Object reference not set to an instance of an object.

the first line is the return unsplit user name... the second is the split user name (the user whos AD values i want returned)

line 3 is split a little all return within the () is the Dsearch.Filter and everything after is from the try statement (the catch side of course).


You know Try..Catch, right? Therefore, the error should happen before TRY. Put breakpoint at the line before Try, then debug it step by step, you should be easy to find which line caused the error.


this will probably sound incredibly stupid but i am working on a dotnetnuke module and can not find anyway to run this outside of a web browser. web developer 05 allows me to add breakpoints but will not let me run the code independently...


Try to comment out line one by one. Start from Response.Write(Dsearch.Filter). You will find the line that causes the error.

if i dont declare a dsearch.filter i get the following

(objectClass=*)Error: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

it looks as though either this line isnt pulling the right row...

Dsearch.Filter = "(& (objectClass=user)(cn=" + UserName + "))"

or this line isnt referring to a proper column

Dsearch.FindOne.Properties("postalCode")(0).ToString()

do you know a way to return the entire row? if so i could narrow it down to the first line... hopefully


I did Active Directory project long time before, I had some code as following:

search.Filter = "(SAMAccountName=" + userName + ")";
search.PropertiesToLoad.Add("cn");
SearchResult result = search.FindOne();
if(null == result)
{
return false;
}
// Update the new path to the user in the directory
_path = result.Path;
_filterAttribute = (String)result.Properties["cn"][0];

Please search Active Directory and ASP.NET online to find helps.


could you walk me through this please?


Did you check to make sure zip code in AD called "ZipCode"? I though it called "postalCode".


Also, here is the forum on Active Directory. Please search your issue here.

http://forums.asp.net/93.aspx


i have tried both. neither seemed to work as a direct replacement.


che3358:

Did you check to make sure zip code in AD called "ZipCode"? I though it called "postalCode".

Do you know what the login name property is called within active directory?

Saturday, March 24, 2012

Object reference not set to an instance of an object

Can anyone help? I getting this error on line 17:

Object reference not set to an instance of an object.

Line 15: Dim UserGUID As Object = User.ProviderUserKey
Line 16:
Line 17: DataSource.InsertParameters.Add("UserID",
UserGUID.ToString())
Line 18: DataSource.Insert()

Here's my code:

Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object,
ByVal e As System.EventArgs)

Dim UserNameTextBox As TextBox =
CType(CreateUserWizardStep1.ContentTemplateContain er.FindControl("UserName"),
TextBox)
Dim DataSource As SqlDataSource =
CType(CreateUserWizardStep1.ContentTemplateContain er.FindControl("InsertExtraInfo"),
SqlDataSource)

Dim User As MembershipUser =
Membership.GetUser(UserNameTextBox.Text)
Dim UserGUID As Object = User.ProviderUserKey

DataSource.InsertParameters.Add("UserID", UserGUID.ToString())
DataSource.Insert()

End Sub........i got it....my datasource wasn't being initiated...duh!

pj, mcdba, mcp
pj,

The User variable likely has the value null. If the specified userid is not
known then Membership.GetUser(string) will return null.

Regards,

Rob MacFadyen

"pj" <pjtort@.yahoo.comwrote in message
news:1158181026.939664.147470@.e63g2000cwd.googlegr oups.com...

Quote:

Originally Posted by

Can anyone help? I getting this error on line 17:
>
Object reference not set to an instance of an object.
>
Line 15: Dim UserGUID As Object = User.ProviderUserKey
Line 16:
Line 17: DataSource.InsertParameters.Add("UserID",
UserGUID.ToString())
Line 18: DataSource.Insert()
>
Here's my code:
>
Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object,
ByVal e As System.EventArgs)
>
Dim UserNameTextBox As TextBox =
CType(CreateUserWizardStep1.ContentTemplateContain er.FindControl("UserName"),
TextBox)
Dim DataSource As SqlDataSource =
CType(CreateUserWizardStep1.ContentTemplateContain er.FindControl("InsertExtraInfo"),
SqlDataSource)
>
Dim User As MembershipUser =
Membership.GetUser(UserNameTextBox.Text)
Dim UserGUID As Object = User.ProviderUserKey
>
DataSource.InsertParameters.Add("UserID", UserGUID.ToString())
DataSource.Insert()
>
End Sub
>


hi pj,
you are calling a method on a null object, hence the Null reference
exception. User.ProviderUserKey is null, so you can't call .ToString() on
it.
there must be something you are not initialising correctly with the user
object. i suggest you read the SDK pages for this class to see how to set
it up correctly.

tim

"pj" <pjtort@.yahoo.comwrote in message
news:1158181026.939664.147470@.e63g2000cwd.googlegr oups.com...

Quote:

Originally Posted by

Can anyone help? I getting this error on line 17:
Object reference not set to an instance of an object.
Line 15: Dim UserGUID As Object = User.ProviderUserKey
Line 16:
Line 17: DataSource.InsertParameters.Add("UserID",
UserGUID.ToString())
Line 18: DataSource.Insert()
Here's my code:
Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object,
ByVal e As System.EventArgs)
Dim UserNameTextBox As TextBox =
CType(CreateUserWizardStep1.ContentTemplateContain er.FindControl("UserName"),
TextBox)
Dim DataSource As SqlDataSource =
CType(CreateUserWizardStep1.ContentTemplateContain er.FindControl("InsertExtraInfo"),
SqlDataSource)
Dim User As MembershipUser =
Membership.GetUser(UserNameTextBox.Text)
Dim UserGUID As Object = User.ProviderUserKey
DataSource.InsertParameters.Add("UserID", UserGUID.ToString())
DataSource.Insert()
End Sub
>

object reference not set to an instance of an object

Dim Override As TextBox = CType(uxTimeEntry.FindControl("uxOverride"),
TextBox)
Override.Attributes.Add("onblur", "Override();")

why do I get the message like "object reference not set to an instance of an
object"?
how can I fix?It doesn't find the control.

You should 99.99 % of the time check for null (Nothing in vb.net) when you
code.

Dim Override As TextBox = CType(uxTimeEntry.FindControl("uxOverride"),
TextBox)

if (Not (Override Is Nothing)) Then

Override.Attributes.Add("onblur", "Override();")
End If

Or better yet:

if (Not (Override Is Nothing)) Then
Override.Attributes.Add("onblur", "Override();")
else
Throw New ArgumentException("Excected Control was not found")
End If

...

C#

TextBox tb = uxTimeEntry.FindControl("uxOverride") as TextBox;
//or
//TextBox tb = (TextBox)uxTimeEntry.FindControl("uxOverride") ;
if (null!=tb)
{
tb.Attributes.Add("onblur", "Override();");
}

"KenLee" <KenLee@.discussions.microsoft.com> wrote in message
news:FB958839-225C-41AE-8ABF-8FC5C1D81746@.microsoft.com...
> Dim Override As TextBox = CType(uxTimeEntry.FindControl("uxOverride"),
> TextBox)
> Override.Attributes.Add("onblur", "Override();")
> why do I get the message like "object reference not set to an instance of
an
> object"?
> how can I fix?
Kenly
findcontrol returned nothing or uxtimeentry is nothing. Check to make sure
your passing in the correct controlid it might be something like uxOverride1
or the case could be incorrect. Run in debug and display
uxTimeEntry.controls one by one and try the ctype in the immediate window.

Good Luck
DWS

"KenLee" wrote:

> Dim Override As TextBox = CType(uxTimeEntry.FindControl("uxOverride"),
> TextBox)
> Override.Attributes.Add("onblur", "Override();")
> why do I get the message like "object reference not set to an instance of an
> object"?
> how can I fix?

object reference not set to an instance of an object

Dim Override As TextBox = CType(uxTimeEntry.FindControl("uxOverride"),
TextBox)
Override.Attributes.Add("onblur", "Override();")
why do I get the message like "object reference not set to an instance of an
object"?
how can I fix?It doesn't find the control.
You should 99.99 % of the time check for null (Nothing in vb.net) when you
code.
Dim Override As TextBox = CType(uxTimeEntry.FindControl("uxOverride"),
TextBox)
if (Not (Override Is Nothing)) Then
Override.Attributes.Add("onblur", "Override();")
End If
Or better yet:
if (Not (Override Is Nothing)) Then
Override.Attributes.Add("onblur", "Override();")
else
Throw New ArgumentException("Excected Control was not found")
End If
..
C#
TextBox tb = uxTimeEntry.FindControl("uxOverride") as TextBox;
//or
//TextBox tb = (TextBox)uxTimeEntry.FindControl("uxOverride") ;
if (null!=tb)
{
tb.Attributes.Add("onblur", "Override();");
}
"KenLee" <KenLee@.discussions.microsoft.com> wrote in message
news:FB958839-225C-41AE-8ABF-8FC5C1D81746@.microsoft.com...
> Dim Override As TextBox = CType(uxTimeEntry.FindControl("uxOverride"),
> TextBox)
> Override.Attributes.Add("onblur", "Override();")
> why do I get the message like "object reference not set to an instance of
an
> object"?
> how can I fix?
>
Kenly
findcontrol returned nothing or uxtimeentry is nothing. Check to make sure
your passing in the correct controlid it might be something like uxOverride1
or the case could be incorrect. Run in debug and display
uxTimeEntry.controls one by one and try the ctype in the immediate window.
Good Luck
DWS
"KenLee" wrote:

> Dim Override As TextBox = CType(uxTimeEntry.FindControl("uxOverride"),
> TextBox)
> Override.Attributes.Add("onblur", "Override();")
> why do I get the message like "object reference not set to an instance of
an
> object"?
> how can I fix?
>

Thursday, March 22, 2012

Object reference not set to an instance of an object.

Dim sTextBoxName As String =
e.Item.Cells(0).FindControl("tbtempDateF").ClientID() ******Error Here

CType(e.Item.FindControl("lnkCalendarF"), HyperLink).NavigateUrl =
"javascript:calendar_window=window.open('calendar.a spx?formname=Form1." &
sTextBoxName &
"','Pick_A_Date','width=154,height=210');calendar_w indow.focus();"

--
I am using the free version of SPAMfighter for private users.
It has removed 0 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!Clearly, something in that chain is coming up with a null reference. My
guess is that it cannot find the control you are telling it to via
FindControl.

"Fetty" <dfetrow410@.hotmail.com> wrote in message
news:%234MlSpxVFHA.3488@.tk2msftngp13.phx.gbl...
> Dim sTextBoxName As String =
> e.Item.Cells(0).FindControl("tbtempDateF").ClientID() ******Error Here
> CType(e.Item.FindControl("lnkCalendarF"), HyperLink).NavigateUrl =
> "javascript:calendar_window=window.open('calendar.a spx?formname=Form1." &
> sTextBoxName &
> "','Pick_A_Date','width=154,height=210');calendar_w indow.focus();"
>
> --
> I am using the free version of SPAMfighter for private users.
> It has removed 0 spam emails to date.
> Paying users do not have this message in their emails.
> Try www.SPAMfighter.com for free now!
probably..
Solved it?
Patrick

"Marina" wrote:

> Clearly, something in that chain is coming up with a null reference. My
> guess is that it cannot find the control you are telling it to via
> FindControl.
> "Fetty" <dfetrow410@.hotmail.com> wrote in message
> news:%234MlSpxVFHA.3488@.tk2msftngp13.phx.gbl...
> > Dim sTextBoxName As String =
> > e.Item.Cells(0).FindControl("tbtempDateF").ClientID() ******Error Here
> > CType(e.Item.FindControl("lnkCalendarF"), HyperLink).NavigateUrl =
> > "javascript:calendar_window=window.open('calendar.a spx?formname=Form1." &
> > sTextBoxName &
> > "','Pick_A_Date','width=154,height=210');calendar_w indow.focus();"
> > --
> > I am using the free version of SPAMfighter for private users.
> > It has removed 0 spam emails to date.
> > Paying users do not have this message in their emails.
> > Try www.SPAMfighter.com for free now!
>

Friday, March 16, 2012

Object reference not set to an instance of an object.


Sub BindData()
...
dim cmd as OleDbCommand
...
dim objDr as OleDbDataReader
objDr = cmd.ExecuteReader()

' error: Object reference not set to an instance of an object.
DropDownList8.SELECTEDITEM.text = objDr.item( "LYLT" )

...

How can I read and print record on screen from db.Hi,

I don't see you instantiating the OleDbCommand anywhere?

You posted code:


dim cmd as OleDbCommand

This is just declaring the variable but are you instantiating the OleDbCOmmand somewhere?

i.e


dim cmd asNew OleDbCommand

Also you need to call Read method for DataReader at least once before accessing any of its items. And inside If loop i.e


If objDr.Read() Then
DropDownList8.SELECTEDITEM.text = objDr.item( "LYLT" )
End If
objDr.Close

Still continue this error,

I instanting OleDbCommand like;


dim dbbag as new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; DATA Source=d:\..\...mdb")
dbbag.open()

dim cmd as OleDbCommand
Cmd = new OleDbCommand("Select * from bck1 order by date desc", dbbag)

DropDownList8.SELECTEDITEM.text = objDr.item( "LOYALTY" )


Did you read the last couple of lines in my previous post? You need to call the Read method of OleDbDataReader at least once before you can access its contents (of course, create the reader using ExecuteReader before trying to loop through it)
Sorry,
I can understand why call the read method inside if or for loop and how can call!
I think I can't explain my problem because of in pieces codes.
My whole code;

Sub BindData()

dim dbbag as new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; DATA Source=d:\...\...mdb")
dbbag.open()
dim cmd as OleDbCommand
Cmd = new OleDbCommand("Select * from bcksrv1 order by TARIH desc", dbbag)

dim objDr as OleDbDataReader
objDr = cmd.ExecuteReader()

if objDr.Read()then

respons.text = objDr.item("RESPONS")

DropDownList8.SELECTEDITEM.text = objDr.item( "LOYALTY" )
end if
objDr.Close()


Many Than for your patience
Ok,

and you get the error in the:


DropDownList8.SELECTEDITEM.text = objDr.item( "LOYALTY" )

Try to change that as follows:


DropDownList8.SelectedIndex=DropDownList8.Items.IndexOf(DropDownList8.Items.FindByText(objDr.item( "LOYALTY" )))

e.g if the field LOYALTY matches the text in DropDownList, it selects it. If you want to do the same but based on DropDownList values, you'd use FindByValue method of Items property (ListItemCollection). Note that this assumes that the field is non-null.

But another question is that what does your query return? You are trying to select from DDL what the first row of the query returns?
I.It ir running BUT list is empty.


Sub Page_Load(Obj as Object, E as eventargs)
If Not Page.IsPostBack Then
BindData
end if
end sub

Sub BindData()

dim dbbag as new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; DATA Source=d:\...\...mdb")
dbbag.open()

dim Cmd as new OleDbCommand("Select * from bcksrv1 order by TARIH desc", dbbag)

dim objDr as OleDbDataReader
objDr = Cmd.ExecuteReader()

if objDr.Read()then

DropDownList8.SELECTEDITEM.text = objDr.item( "LOYALTY" )
end if


II. It is running :?

Sub Page_Load(Obj as Object, E as eventargs)

If Not IsPostBack Then
dim dbbag as new OledbConnection("provider=Microsoft.Jet.OLEDB.4.0; DATA Source=d:\...\...mdb")
dbbag.open()

dim cmd as New OledbCommand("Select * from bcksrv1 order by TARIH desc", dbbag)

dim objDr as OleDbDataReader
objDr= cmd.ExecuteReader()

If veri.read() then

DropDownList8.SELECTEDITEM.text = objDr.item( "LOYALTY" )


What is your opionion.? and suggestion about first example.
2. question How can call the sub Page_load somewhere?

Object reference not set to an instance of an object.

Dim sTextBoxName As String =
e.Item.Cells(0).FindControl("tbtempDateF").ClientID() ******Error Here
CType(e.Item.FindControl("lnkCalendarF"), HyperLink).NavigateUrl =
"java script:calendar_window=window.open('calendar.aspx?formname=Form1." &
sTextBoxName &
" ','Pick_A_Date','width=154,height=210');
calendar_window.focus();"
I am using the free version of SPAMfighter for private users.
It has removed 0 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!Clearly, something in that chain is coming up with a null reference. My
guess is that it cannot find the control you are telling it to via
FindControl.
"Fetty" <dfetrow410@.hotmail.com> wrote in message
news:%234MlSpxVFHA.3488@.tk2msftngp13.phx.gbl...
> Dim sTextBoxName As String =
> e.Item.Cells(0).FindControl("tbtempDateF").ClientID() ******Error Here
> CType(e.Item.FindControl("lnkCalendarF"), HyperLink).NavigateUrl =
> "java script:calendar_window=window.open('calendar.aspx?formname=Form1." &
> sTextBoxName &
> " ','Pick_A_Date','width=154,height=210');
calendar_window.focus();"
>
> --
> I am using the free version of SPAMfighter for private users.
> It has removed 0 spam emails to date.
> Paying users do not have this message in their emails.
> Try www.SPAMfighter.com for free now!
>
probably..
Solved it?
Patrick
"Marina" wrote:

> Clearly, something in that chain is coming up with a null reference. My
> guess is that it cannot find the control you are telling it to via
> FindControl.
> "Fetty" <dfetrow410@.hotmail.com> wrote in message
> news:%234MlSpxVFHA.3488@.tk2msftngp13.phx.gbl...
>
>