473,568 Members | 2,986 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_Enterp rise_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 1174
On 20 , 00:22, "ma" <m...@nowhere.c omwrote:
>
GridView_Enterp rise_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(GridV iew_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
3406
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 width of 600. The final row again has two TableCells each with a width of 300. When I try and implement this, the table comes out with the first cells...
2
1990
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> </asp:TableRow>
0
948
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 requiredFieldValidator, before requiredFieldValidator take in place. (I want just at the first time to show the asterisks before required fields).
2
388
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 id="cE" runat="server" /> </asp:tablerow> </asp:table>
0
4250
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. That part works. However, my problem is that the form lets the user choose from input files; the labels are updated, the textboxes are not. This seems...
1
1630
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; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls;
2
1096
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 disk and these files are viewed on the user screen application using the concept of fetching files from the local drive. I have taken a table to...
12
24782
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 click the button, it will populate a dynamic table with radio button for the survey questionnaire However, i was unable to get its value (for score...
1
2095
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
7917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7665
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.