In programs, DataRow is often used to save some data and complete the value transfer operation. In this case, some DataRow objects are formed, but they are organized using List or Datable. So how to initialize this DataRow? We know that DataRow is
This article mainly describes how to obtain the value of datarow[], need friends can refer to the followingFirst, datarow[] dr = dt. Select ("T1= ' A '"); The result is an array, so you just loop through the array. The code is as follows: string x=
First, datarow[] dr = dt. Select ("T1= ' A '"); The result is an array, so you just loop through the array.
Copy Code code as follows:
String x= "";
if (Dr. Length > 0)
{
foreach (DataRow DrN in DR)
{
x+=drn["T2"]; The value of the T2
The problem is that in. NET, objects of type DataRow do not support serialization, so what if you have DataRow type fields in an object that needs to be serialized? Oh, luckily the DataTable supports serialization. Therefore, we can customize the
PS: Actually this place is just as a record of what I do not understand. If there are any mistakes or improper places, please correct me.
With regard to DataRow and DataColumn, the row and column of the DataTable are actually rows and columns, as
In foreword, this method uses reflection to turn the DataRow into a solid, because the reflection SetValue is said to be not good, everyone just look at
A DataTable represents a memory-related datasheet that can be created and used using control drag-and-drop in a toolbar, and can be created and used independently of the programming process as needed, most commonly as a member of a dataset. In this
DataSet objectA DataSet object can be used to store data that is queried from a database, because it disconnects from the database as soon as it gets or updates data, so programmers can use this to efficiently access and manipulate the database. And
Ado| Notes | objects
First, the characteristics of the introduction
1. Working with offline data is useful in multi-tier applications.
2. You can view the contents of any row in the dataset at any time, allowing you to modify the method of query
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.