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

can not read the value of a tablecell in grideview

ma
Hello,

I have a gridview that is bound to a dataset. One col of this grid is
bound to the primary key of the dataset which its data format is integer.

I want to read the value of this key and I am using code similar to the
following:

GridView_Enterprise_name.Rows[i].Cells[0].text

The above code is working if the data format of the field in the dataset is
string but it doesn't work if it is an integer. What should I do to get the
value of this field?

Regards
Sep 19 '07 #1
1 1172
On 20 , 00:22, "ma" <m...@nowhere.comwrote:
>
GridView_Enterprise_name.Rows[i].Cells[0].text

The above code is working if the data format of the field in the dataset is
string but it doesn't work if it is an integer. What should I do to get the
value of this field?
Perhaps, you forgot to cast string value to integer.
int key = int.Parse(GridView_Enterprise_name.Rows[i].Cells[0].Text)

Regards,
Mykola
http://marss.co.ua

Sep 20 '07 #2

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

Similar topics

0
by: Randy | last post by:
Hello All, Is there any way to make this happen... Say I want to make a table with 3 rows. The first row has two TableCells each with a width of 300. The second row has one TableCell with the...
2
by: George Durzi | last post by:
Consider this pseudo HTML from a web form <asp:Table> <asp:TableRow> <asp:TableCell> <asp:Table> <asp:TableRow> <asp:TableCell></asp:TableCell> <asp:TableCell></asp:TableCell>...
0
by: Mr. x | last post by:
Hello, I don't know if I am doing right (and if there is a better common way to put asterisk before required , please tell me), but the I want that I see the asterisk at the place of...
2
by: hb | last post by:
Hi, I have a page that uses dynamic generated web user control. On the eupdate.aspx, I get: === <asp:table id="tblE" runat="server"> <asp:tablerow id="rE" runat="server"> <asp:tablecell...
0
by: Zark3 | last post by:
Hi all, In a web form I use a for loop to dynamically add TextBox'es to a page (one for each item in an input file). I can get the input values and I can display them in Label's and TextBox'es....
1
by: ganesh22 | last post by:
Hi, Here the below code is for dynamically creating textboxs, its creating fine but after user enters some values in textboxs how can i retrive that values? using System; using System.Data;...
2
by: Adela Arpitha | last post by:
Hi, i'm using asp.net 1.1 for my project. I have a written a c# code where the user can upload his files through the file upload component which gets uploaded to the specified path in a local...
12
by: ive1122 | last post by:
Hi guys, I am looking into create a dynamic survey as posted in Get User Input From Dynamic Controls but with some different environment Below is what i am trying to do: First when the user...
1
by: yogarajan | last post by:
Hi Friend this is my code protected void Page_Load(object sender, EventArgs e) { for (int i = 0; i < 10; i++) { TableRow tr = new TableRow();
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.