473,472 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Displaying field value in datarow

I'm trying to display a field from a datarow like this:

DataRow[] myRow = DS_Urb.Tables["Urb"].Select("Code = 'MyCode'"); // it
returns at least one row
MessageBox.Show (myRow[0].ToString(), urb);
But I get "System.Data.DataRow". How can I display field "Name" ?
Nov 16 '05 #1
2 11099
hi Amos!
you are just refering to the row here ,
MessageBox.Show (myRow[0].ToString(), urb);
you need to refere to the name field
MessageBox.Show (myRow[0]["name"].ToString(), urb);

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2
It worked great.

Thanks.

"Mohamoss" <mo************@egdsc.microsoft.com> wrote in message
news:uI**************@cpmsftngxa06.phx.gbl...
hi Amos!
you are just refering to the row here ,
MessageBox.Show (myRow[0].ToString(), urb);
you need to refere to the name field
MessageBox.Show (myRow[0]["name"].ToString(), urb);

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #3

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

Similar topics

8
by: euang | last post by:
Hi, I have been using access 2000 for two years on WINDOWS NT to display dynamic aweb page using ASP My ISP has now changed to Windows 2003, and I am having major problems displaying...
2
by: Amos | last post by:
I'm trying to display a field from a datarow like this: DataRow myRow = DS_Urb.Tables.Select("Code = 'MyCode'"); // it returns at least one row MessageBox.Show (myRow.ToString(), urb); But...
4
by: John Suru | last post by:
I am loading up a combobox with data from an access database. The field I am loading is a date/time datatype. The data in the field is a short date(ex. 01/22/2004). When I load the combobox with the...
4
by: Luqman | last post by:
Hi, Is it possible to use Field Names with Data Row. for example: Dim dr As DataRow = CType(Me.ProductsBindingSource.Current, DataRow) dr.ProductID=123 dr.ProductName="ABC"...
0
by: Michael | last post by:
Hi Everyone, I had posted a message about the dropdownlist not displaying newly added items. Just alittle background. I'm working with a masterpage and a usercontrol(Search control) (VS2005) that...
8
by: =?Utf-8?B?cGVsZWdrMQ==?= | last post by:
i have a GridView and a hidden field : <asp:TemplateField Visible=false > <ItemTemplate > <asp:HiddenField Value="<%#Eval("isActive")%>" id="hidIsActive" runat=server /> </ItemTemplate>...
6
by: cj | last post by:
If I'm sitting on a datarow for a customer and want to change his phone number only if it's blank what would I write? if myDr("phone")= "" then myDr("phone") = "mphone" endif...
0
by: cmrhema | last post by:
Hi, I have two controls one html select control and one asp.net dropdownlist control. In html select control i have three maps loaded. It is loaded in the following manner. <SELECT...
10
by: Andy B | last post by:
If I have the following text in a dataset table column: "This agreement establishes that {BandName} will play on {EventDate} between {StartTime} and {EndTime}..." How would I then take the field...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.