CYQ.Data componentsCYQ.Data support multi-database application [Txt,Xml,Access, MSSQL, Oracle,SQLite,MySql], help easily and quickly to develop your project |
CYQ.Data Components Getting Started Guide [Part 3]-[MAction Get And Set Value]
Guide |
|
|
| #TopicOwner |
In this section: continue on a content, this section describes all the values associated with the assignment operator.
1: UI operation: GetFrom and SetTo 2: non-UI operations: Get and Set
3: DrowDownList operation of the UI controls such as list
Common part of the code described earlier, we assume that the query through the following methods to complete row of data using(MAction action = new MAction(TableNames.Users))
{
if (action.Fill(888)) { //This is to say in this section and the assignment of values } } I: UI Operation Description: Controls ID to comply with naming convention: any three-letter prefix + field name For example, a TextBox control with ID: txtUserName Compared txt (any prefix) + UserName (the database field name) 1:GetFrom - Get value from control and set value to MDataRow Method Prototype:
public void GetFrom(Control ct) public void GetFrom(Control ct, object value) Example 1: action.GetFrom(txtUserName);//Get value from control and set value to MDataRow
//Equivalent to
action.Data["UserName"].Value=txtUserName.Text; Example 2: action.GetFrom(txtUserName, "cyqdata");//Value assigned to the custom data line, ignoring the value of the control.
//Equivalent to
action.Data["UserName"].Value="cyqdata"; 2:SetTo 将数据行中的数据设置到控件 Method Prototype:
public void SetTo(Control ct)
public void SetTo(Control ct, object value) public void SetTo(Control ct, object value, bool isControlEnabled) Example 1: action.SetTo(txtUserName);//Get value from MDataRow and set value to txtUserName control。
//Equivalent to txtUserName.Text=action.Data["UserName"].Value.ToString(); Example 2: action.SetTo(txtUserName,"cyqdata");//Assigned to the control, data from the custom values
//Equivalent to txtUserName.Text="cyqdata"; Example 3: action.SetTo(txtUserName,null,false);//Assigned to the control, and set the Enable property of the control
//Equivalent to txtUserName.Text=action.Data["UserName"].Value.ToString();
txtUserName.Enabled=false; 二:Non-UI Operation 1:Get - get value from MDataRow Method Prototype : public T Get<T>(object key) Example 1: string userName = action.Get<string>(Users.UserName);//get value from MDataRow
//Equivalent to string userName = action.Data["UserName"].Value.ToString(); 2:Set - set value to MDataRow Method Prototype : public void Set(object key,object value) Example 1: action.Set(Users.UserName, "cyqdata");//set value 'cyqdata' to MdataRow's column 'UserName'
//Equivalent to action.Data["UserName"].Value = "cyqdata"; III:UI Operation:dropdown list of controls and other UI operations Method Prototype :
public MAction Bind((object control) public MAction Bind(string control, string where)
public MAction Bind((object control, string where, object text, object value) Example 1: using(MAction action = new MAction(TableNames.Users))
{
action.Bind(ddlUserName);//Query the data and bind the drop-down list, text field for the UserName [remove three arbitrary prefix], range of ID } Example 2: using(MAction action = new MAction(TableNames.Users))
{
action.Bind(ddlUserName,"id>10");//Query data and bound by conditions of the drop-down list, text field for the UserName, range of ID } Example 3: using(MAction action = new MAction(TableNames.Users))
{
action.Bind(ddlUserName,"id>10",Users.NickName,Users.ID);//Query data and bound by conditions of the drop-down list, text field is NickName, range of ID } Chinese version of the link:http://cyqdata.com/cyqdata/article-detail-413 More tutorials: 1:CYQ.Data Components Getting Started Guide [Part 1] 2:CYQ.Data Components Getting Started Guide [Part 2]-[MAction Data Query- Fill And Select] 3:CYQ.Data Components Getting Started Guide [Part 3]-[MAction Get And Set Value] 4:CYQ.Data Components Getting Started Guide [Part 4]-[MAction Insert Delete Update] 5:CYQ.Data Components Getting Started Guide [Part 5]-[MProc Execute Stored Procedures or SQL]
|
https://royalcbd.com[89.28.10.*]2020/9/28 23:52:44 | #4 | |
8i3qOB I truly appreciate this post.Thanks Again. Will read on |
is cbd legal in wash[89.28.10.*]2020/9/25 20:24:08 | #3 | |
OXGmBZ Very good info. Lucky me I found your website by chance (stumbleupon). I ave saved as a favorite for later! |
Silvia[62.210.78.*]2014/8/25 3:40:56 | #2 | |
Hot damn, looikng pretty useful buddy. |
Idana[183.177.122.*]2011/10/7 21:17:11 | #1 | |
It's about time soomene wrote about this. |
Post Comment
Bulletin
Article Search
Categories
- Platform for dynamic (20)
- Feedback (9)
- Guide (33)
- Principles (19)
- Project-Case (8)
- Business & Buy (2)
- Technology exchange (45)
New Article
- CYQ.Data Components Getting Started Guide [Part 5]-[MProc Execute Stored Procedures or SQL]
- CYQ.Data Components Getting Started Guide [Part 4]-[MAction Insert Delete Update]
- CYQ.Data Components Getting Started Guide [Part 3]-[MAction Get And Set Value]
- CYQ.Data Components Getting Started Guide [Part 2]-[MAction Data Query- Fill And Select]
- CYQ.Data Components Getting Started Guide [Part 1]
New Comment
- When some one searches for his necessary thing, therefore he/she wishes to be available that in detail, so that thing is maintained over here.
- This is my first time pay a quick visit at here and i am in fact happy to read everthing at alone place.
- I truly appreciate this blog article.Really thank you! Cool.
- please pay a visit to the web sites we follow, like this one particular, as it represents our picks in the web
- Really enjoyed this post.Really thank you!
- Really enjoyed this article.Really looking forward to read more. Great.
- poker bonuses What are the norms of copyright of web content? How as it different from Patent?
- Wow! Thank you! I permanently needed to write on my blog something like that. Can I implement a fragment of your post to my site?
- This website was how do I say it? Relevant!! Finally I ave found something that helped me. Cheers!
- I was reading through some of your content on this internet site and I believe this web site is very informative ! Continue posting.