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 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
..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
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
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
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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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;...
|
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...
|
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...
|
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...
|
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. ...
|
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'
|
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"...
|
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...
|
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: 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...
|
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: 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...
|
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...
| |