473,326 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Checking Value Detail View

Hi All,
I am trying to check a fields value (boolean in this case) in the
ItemUpdated event. The following does not work. I am very new to .NET
(VB6 guy) so sorry if this is way off.

If Me.DetailsView1.Fields.Item(6) = True Then
'do something
End If
It complains with the following error.
Error 1 Operator '=' is not defined for types
'System.Web.UI.WebControls.DataControlField' and
'Boolean'.
H:\Programming\Web\MSF_OP_Compliance_New\OP_Comp_D etail.aspx.vb 8
12 H:\...\MSF_OP_Compliance_New\
Please help. Very simple thing is causing me headaches. Thanks

Dec 18 '06 #1
5 2638
You need

If DirectCast(Me.DetailsView1.Fields.Item(6).Value,bo olean) = true Then

Or more simply:

If DirectCast(Me.DetailsView1.Fields.Item(6).Value,bo olean) Then

Skip wrote:
Hi All,
I am trying to check a fields value (boolean in this case) in the
ItemUpdated event. The following does not work. I am very new to .NET
(VB6 guy) so sorry if this is way off.

If Me.DetailsView1.Fields.Item(6) = True Then
'do something
End If
It complains with the following error.
Error 1 Operator '=' is not defined for types
'System.Web.UI.WebControls.DataControlField' and
'Boolean'.
H:\Programming\Web\MSF_OP_Compliance_New\OP_Comp_D etail.aspx.vb 8
12 H:\...\MSF_OP_Compliance_New\
Please help. Very simple thing is causing me headaches. Thanks
Dec 18 '06 #2
..value is not valid for this. It complains about not being a member.
All I want to do is to access/check the fields value. I should not have
to do any datatype conversions?? I tried some other things using
DataItem and it complains about a NullReferenceException.

If Me.DetailsView1.DataItem(6) = True Then

End If
Thanks
wf****@gmail.com wrote:
You need

If DirectCast(Me.DetailsView1.Fields.Item(6).Value,bo olean) = true Then

Or more simply:

If DirectCast(Me.DetailsView1.Fields.Item(6).Value,bo olean) Then

Skip wrote:
Hi All,
I am trying to check a fields value (boolean in this case) in the
ItemUpdated event. The following does not work. I am very new to .NET
(VB6 guy) so sorry if this is way off.

If Me.DetailsView1.Fields.Item(6) = True Then
'do something
End If
It complains with the following error.
Error 1 Operator '=' is not defined for types
'System.Web.UI.WebControls.DataControlField' and
'Boolean'.
H:\Programming\Web\MSF_OP_Compliance_New\OP_Comp_D etail.aspx.vb 8
12 H:\...\MSF_OP_Compliance_New\
Please help. Very simple thing is causing me headaches. Thanks
Dec 18 '06 #3
I apologize, I misread your first post.

If this is in the itemupdated event use the formviewupdatedeventargs
object
http://msdn2.microsoft.com/en-us/lib...newvalues.aspx
for example:
If DirectCast(e.NewValues(6),boolean) then
Skip wrote:
.value is not valid for this. It complains about not being a member.
All I want to do is to access/check the fields value. I should not have
to do any datatype conversions?? I tried some other things using
DataItem and it complains about a NullReferenceException.

If Me.DetailsView1.DataItem(6) = True Then

End If
Thanks
wf****@gmail.com wrote:
You need

If DirectCast(Me.DetailsView1.Fields.Item(6).Value,bo olean) = true Then

Or more simply:

If DirectCast(Me.DetailsView1.Fields.Item(6).Value,bo olean) Then

Skip wrote:
Hi All,
I am trying to check a fields value (boolean in this case) in the
ItemUpdated event. The following does not work. I am very new to .NET
(VB6 guy) so sorry if this is way off.
>
If Me.DetailsView1.Fields.Item(6) = True Then
'do something
End If
>
>
It complains with the following error.
>
>
Error 1 Operator '=' is not defined for types
'System.Web.UI.WebControls.DataControlField' and
'Boolean'.
H:\Programming\Web\MSF_OP_Compliance_New\OP_Comp_D etail.aspx.vb 8
12 H:\...\MSF_OP_Compliance_New\
>
>
Please help. Very simple thing is causing me headaches. Thanks
Dec 19 '06 #4
Also, you're not doing any data type conversions but you must do a cast
to avoid compiler errors (if option strict is on, which it should be).
wfa...@gmail.com wrote:
I apologize, I misread your first post.

If this is in the itemupdated event use the formviewupdatedeventargs
object
http://msdn2.microsoft.com/en-us/lib...newvalues.aspx
for example:
If DirectCast(e.NewValues(6),boolean) then
Skip wrote:
.value is not valid for this. It complains about not being a member.
All I want to do is to access/check the fields value. I should not have
to do any datatype conversions?? I tried some other things using
DataItem and it complains about a NullReferenceException.

If Me.DetailsView1.DataItem(6) = True Then

End If
Thanks
wf****@gmail.com wrote:
You need
>
If DirectCast(Me.DetailsView1.Fields.Item(6).Value,bo olean) = true Then
>
Or more simply:
>
If DirectCast(Me.DetailsView1.Fields.Item(6).Value,bo olean) Then
>
Skip wrote:
Hi All,
I am trying to check a fields value (boolean in this case) in the
ItemUpdated event. The following does not work. I am very new to .NET
(VB6 guy) so sorry if this is way off.

If Me.DetailsView1.Fields.Item(6) = True Then
'do something
End If


It complains with the following error.


Error 1 Operator '=' is not defined for types
'System.Web.UI.WebControls.DataControlField' and
'Boolean'.
H:\Programming\Web\MSF_OP_Compliance_New\OP_Comp_D etail.aspx.vb 8
12 H:\...\MSF_OP_Compliance_New\


Please help. Very simple thing is causing me headaches. Thanks
Dec 19 '06 #5
Thanks that worked great. Not what I was expecting, it shows my .NET
inexperience.

Another question since you were so helpful.

This check is being used to set another field's value. What is the
proper way to directly set a fields value?

Thanks

wf****@gmail.com wrote:
Also, you're not doing any data type conversions but you must do a cast
to avoid compiler errors (if option strict is on, which it should be).
wfa...@gmail.com wrote:
I apologize, I misread your first post.

If this is in the itemupdated event use the formviewupdatedeventargs
object
http://msdn2.microsoft.com/en-us/lib...newvalues.aspx
for example:
If DirectCast(e.NewValues(6),boolean) then
Skip wrote:
.value is not valid for this. It complains about not being a member.
All I want to do is to access/check the fields value. I should not have
to do any datatype conversions?? I tried some other things using
DataItem and it complains about a NullReferenceException.
>
If Me.DetailsView1.DataItem(6) = True Then
>
End If
>
>
Thanks
>
>
wf****@gmail.com wrote:
You need

If DirectCast(Me.DetailsView1.Fields.Item(6).Value,bo olean) = true Then

Or more simply:

If DirectCast(Me.DetailsView1.Fields.Item(6).Value,bo olean) Then

Skip wrote:
Hi All,
I am trying to check a fields value (boolean in this case) in the
ItemUpdated event. The following does not work. I am very new to .NET
(VB6 guy) so sorry if this is way off.
>
If Me.DetailsView1.Fields.Item(6) = True Then
'do something
End If
>
>
It complains with the following error.
>
>
Error 1 Operator '=' is not defined for types
'System.Web.UI.WebControls.DataControlField' and
'Boolean'.
H:\Programming\Web\MSF_OP_Compliance_New\OP_Comp_D etail.aspx.vb 8
12 H:\...\MSF_OP_Compliance_New\
>
>
Please help. Very simple thing is causing me headaches. Thanks
Dec 19 '06 #6

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

Similar topics

0
by: Hunters | last post by:
Once you reorder the listview items, largeicon or smallicon view will not follow the order of list or detail view which is the correct order. For example with a listview as...
1
by: Tom | last post by:
In the Developers Handbook, Getz provides a way to create a survey report that displays either a line, Yes/No or multiple choice for each question. It's done by placing three controls (one for each...
30
by: Michael B Allen | last post by:
I have a general purpose library that has a lot of checks for bad input parameters like: void * linkedlist_get(struct linkedlist *l, unsigned int idx) { if (l == NULL) { errno = EINVAL;...
1
by: Ramakrishnan Nagarajan | last post by:
Hi, I have two checkboxes in each row of a grid. One for Modify and another one for View. If I click Modify the View should get automatically checked and should be disabled. Earlier I did this in...
2
by: | last post by:
I want to know how to make a clickable button or Command field on a GridView, and have the user's action a) fire a function and b) pass a data value from one of the GridView's columns to that...
66
by: Johan Tibell | last post by:
I've written a piece of code that uses sockets a lot (I know that sockets aren't portable C, this is not a question about sockets per se). Much of my code ended up looking like this: if...
1
by: BillG | last post by:
I am developing a business app using asp.net that will have 2 different types of forms, a list view of data and then a detail view. The list views are placed on a content panel in a master page. ...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
1
by: ramaswamynanda | last post by:
Hello, I have a simple vb.net 2005 application using an SQLserver database There is a form , employees that has a grid view and a detail view control The grid displays data and has a "Select"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
0
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
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...
0
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
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.