473,473 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Dataset finding and value assign

Hi,

How can I find the field value in the dataset and then assign one of the
field value to a variable ?

Thanks
Wilson
Nov 16 '05 #1
3 9162
Wilson,

Well, if you have a dataset, there are a few pieces of information you
need to know:

- The name of the table
- Which row the data is in
- Which column the data is in

If you know that, you can get/set the information like this:

// Assume pobjDataSet is the data set.
pobjDataSet.Tables[<table name or index>].Rows[<row index>][<column name or
index>] = <value>;

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Wilson Wu" <wi******@myrealbox.com> wrote in message
news:en**************@TK2MSFTNGP11.phx.gbl...
Hi,

How can I find the field value in the dataset and then assign one of the
field value to a variable ?

Thanks
Wilson

Nov 16 '05 #2
Wilson,

Well, if you have a dataset, there are a few pieces of information you
need to know:

- The name of the table
- Which row the data is in
- Which column the data is in

If you know that, you can get/set the information like this:

// Assume pobjDataSet is the data set.
pobjDataSet.Tables[<table name or index>].Rows[<row index>][<column name or
index>] = <value>;

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Wilson Wu" <wi******@myrealbox.com> wrote in message
news:en**************@TK2MSFTNGP11.phx.gbl...
Hi,

How can I find the field value in the dataset and then assign one of the
field value to a variable ?

Thanks
Wilson

Nov 16 '05 #3
Hi,

I cannot read the value from the cell. Pls help.
The program should read data from an XML file(without schema) and find value
from one cell.

Here is my code :

DataSet dsLogon = new DataSet();
dsLogon.ReadXML(Server.MapPath("XMLFile.XML");

DataView dvServer = new DataView(dsLogon.Tables["Server"];
dvServer.Sort = "Name";
dvServer.RowFilter = "Name = '" + this.Server.Text + "'";

this.AppHost = dvServer.Table.Rows["ServerIP"].ToString();
Thanks
Wilson


"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uT**************@TK2MSFTNGP11.phx.gbl...
Wilson,

Well, if you have a dataset, there are a few pieces of information you
need to know:

- The name of the table
- Which row the data is in
- Which column the data is in

If you know that, you can get/set the information like this:

// Assume pobjDataSet is the data set.
pobjDataSet.Tables[<table name or index>].Rows[<row index>][<column name or index>] = <value>;

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Wilson Wu" <wi******@myrealbox.com> wrote in message
news:en**************@TK2MSFTNGP11.phx.gbl...
Hi,

How can I find the field value in the dataset and then assign one of the
field value to a variable ?

Thanks
Wilson


Nov 16 '05 #4

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

Similar topics

3
by: Varun | last post by:
How to assign a value to password field from dataset Thank yo Varun
1
by: moonriver | last post by:
It seems that a C# program can not update the original database by mapping all the changes to the dataset, but have to explicitly assign the InsertCommand or UpdateCommand properties of a...
0
by: TK | last post by:
Hi, I need help on datagrid. I have a dataset exposed as a webservice. I do have a web application that is supposed to consume the service on a datagrid.
5
by: Johnny | last post by:
How do I assign a value in a dataset to a variable. I have the following code that's giving me an error message: char IsTaxable; IsTaxable = dsTaxData.Tables.Rows; The is_taxable datatype is...
3
by: Chris | last post by:
I have a dataset that I want to modify the values in a particular column. I.e if I have a function to convert the enterbyID (Integer) to a name, in the dataset the field (Concern_EnteredbyID) shows...
3
by: DavidB | last post by:
New to .net....sorry if this seems repetitive I have a dataset ordered by date (SQLDataAdapter SelectCommand uses Order By) and want to find a record by a UniqueID(Identity Column). Then I want...
3
by: Khurram | last post by:
Hi, Firstly, I will apologise now if I have posted in the wrong discussion group. Please let me know if I have for future reference. Below is the code to a WebMethod that is querying an Access...
275
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'
0
by: mfranz | last post by:
Hi to everybody, I think I'm really confused with dataset and datagridview. If I modify cell values with a mouseclick, it works fine, but if I assign a value to a datagridview like this: ...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
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
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,...
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?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.