473,385 Members | 1,445 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,385 software developers and data experts.

can't check the value of a field

Hi,

The aspx file contains a datasource and a gridview.
The (only) field is a boolean type (true/false).
Now, when the value of the field is 'true' something must happen (e.g.
Response.Write("this is true") ).
So i used the server-event 'GridView1_RowCreated' but how can i check the
value of the field on each row?
I tried this code below, but it doesn't work ...
Thanks
Phil

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=c:\mydb.mdb"
ProviderName="System.Data.OleDb" SelectCommand="SELECT field1 from
mytable"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1"
<Columns><asp:BoundField DataField="myfield" /> </Columns>
</asp:GridView>

The code-behind:
Protected Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
Dim a As DataControlField
a = GridView1.Columns(0)
' This contains the name of the field but there is nothing i can put after
'Columns(0).' , like "value" or something ...
End Sub
Jun 11 '06 #1
0 869

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

Similar topics

8
by: Jack | last post by:
Hi, Here is my problem: I am logging in to a page, where the page retrieves a record from a database. The text boxes are used in the display formto let the users update the fields, if they...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
0
by: Karl Roes | last post by:
I'm still having trouble posting follow-ups. :-( "Unable to retrieve message 7cc66112.0501041919.3a6628b4@posting.google.com" Now Turtle wrote "You'll need an extra field in the table...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
3
by: Sheau Wei | last post by:
This is the search engine code that i create, but it was error and didnt come out the result. Cn u help me to check what wrong with my code? Thanks <Table cellspacing=1 cellPadding=1...
0
by: srinivasarao yarru | last post by:
hi sir, in access 2003 how we can use the setfocuse property(we have to lostfocuse from one field with in that we have to setfocuse in same field) i am using this code but not setfocuse...
3
by: pollygw | last post by:
I have a page that dynamically adds rows to a table and the user can also delete any of the rows in no specific order. When the form is submitted I need to do some validation. I can't loop through...
19
by: creative1 | last post by:
hi I am in strange problem. I have javascript for for validation. If I have any entry invalid it prompts me to corrrect it. All checks I have works fine. However, form does not response when there...
13
by: PhpCool | last post by:
Hi, since sometime I'm stuck in a problem where I want to check or uncheck all the checkboxes. If I'm choosing name for the checkbox array as 'chkbx_ary' then I'm able to check/uncheck all the...
1
by: Anuj | last post by:
Hi, since sometime I'm stuck in a problem where I want to check or uncheck all the checkboxes. If I'm choosing name for the checkbox array as 'chkbx_ary' then I'm able to check/uncheck all the...
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: 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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.