CYQ.Data Components Getting Started Guide [Part 5]-[MProc Execute Stored Procedures or SQL]
In this section:
continue on a content, this section describes MProc class-related operations.
1: MProc execute stored procedure
2: MProc execute SQL operations
Method Prototype :
public MProc(object procNamesEnum)
public MProc(object procName, string conn)
Constructor and MAction usage of the relevant operating parameters can be MAction.
Example 1：Pass stored procedure name
//Stored procedure name passed in the default configuration items to take Conn database link
MProc proc = new MProc(ProcNames.GetUserList);//Passing through the enumeration
Example 2：Pass stored procedure name and custom database link
//Into the database a new database link configuration items Conn
MProc proc = new MProc("GetUserList","ChatConn");
//Into the database directly link the new database link string
MProc proc = new MProc("GetUserList","Server=.;database=Chat;uid=sa;pwd=xxxxx");
//Multi-use agreement under the name of the database configuration items from ChatConn links
MProc proc = new MProc(P_ChatEnum.GetUserList);
Example 3：Pass SQL statement
Note: Only supported in V1.5 version of the above.
/ / Execute custom SQL statement, the default configuration items database link from Conn
MProc proc = new MProc("select * from Users");
/ / Execute custom SQL statements from the configuration items database link ChatConn
MProc proc = new MProc("select * from Users","ChatConn");
Method Prototype :
public void Set(object paraName, object value)
public void Set(object paraName, object value,SqlDbType sqlDbType)
public void Clear()
//As stored procedures or parameterized SQL statement to set parameters
proc.Set(GetUserList.ID, 888);//Enumeration method to pass
proc.Set(Users.ID, 888,SqlDbType.Int);//More than in the last example of a parameter.
proc.Clear();//Clear all Set parameters.
III：Execute Method Operation
Method Prototype :
public MDataTable ExeMDataTable() / / List of query
public int ExeNonQuery() / / Add / Update / Delete
public T ExeScalar<T>() / / Return a single value of the first row first column
MDataTable table = proc.ExeMDataTable();// return MDataTable
int result = proc.ExeNonQuery();//Insert, update, delete, return the number of rows affected.
string result = proc.ExeScalar<string>();//Statement is executed, returns the first row first column value.
IV：ReturnValue and DataBase Close
Method Prototype :
public int ReturnValue
public void Close()
MDataTable table= proc.ExeMDataTable();
int value = proc.ReturnValue;//If the stored procedure is executed, the return value obtained by the total number of records.
Example 2：Close manually
MProc proc = new MProc(ProcNames.GetList);
MDataTable table= proc.ExeMDataTable();
int value = proc.ReturnValue;
proc.Close();//Close the database links after the implementation of
V：A complete example
Examples of use:
Instantiation: using(MProc proc = new MProc(ProcNames.GetList))
Add parameters: proc.Set(GetList.ID, 10);
Access list: MDataTable table = proc.ExeMDataTable();
Take the return value: int count=proc.ReturnValue;
Bound control: table.Bind(GridView1);
Chinese version of the link：http://www.cyqdata.com/cyqdata/article-detail-415
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.
|Greece villas for sa[89.28.10.*]2020/11/25 3:43:32||#120|
This is my first time pay a quick visit at here and i am in fact happy to read everthing at alone place.
|real estate Greece f[89.28.10.*]2020/11/25 3:33:44||#119|
I truly appreciate this blog article.Really thank you! Cool.
|Favourite Online Gam[89.28.10.*]2020/11/25 2:44:34||#118|
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 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?
|cosmética barat[89.28.10.*]2020/11/24 20:07:43||#114|
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?
|Uzbekistan tours[89.28.10.*]2020/11/24 19:57:16||#113|
This website was how do I say it? Relevant!! Finally I ave found something that helped me. Cheers!
|Silicone chew toys[89.28.10.*]2020/11/24 18:43:16||#112|
I was reading through some of your content on this internet site and I believe this web site is very informative ! Continue posting.
|Uzbekistan day tours[89.28.10.*]2020/11/24 9:59:10||#111|
It as difficult to find educated people on this topic, but you sound like you know what you are talking about! Thanks
|Uzbekistan tours[89.28.10.*]2020/11/24 9:47:45||#110|
This is one awesome blog.Really thank you! Really Great.
|get this deal[89.28.10.*]2020/11/24 6:11:31||#107|
Thank you ever so for you article.Really thank you! Really Cool.
|����� 24[89.28.10.*]2020/11/24 4:45:11||#106|
whoah this blog is fantastic i love reading your articles. Keep up the good work! You know, many people are looking around for this information, you could help them greatly.
|caretas con gafas[89.28.10.*]2020/11/24 3:19:26||#105|
Just what I was searching for, appreciate it for putting up.
|brujos en linea[89.28.10.*]2020/11/24 1:55:22||#104|
Looks like these guys have plenty of outsourcing opportunities available.
|this website[89.28.10.*]2020/11/24 0:29:56||#103|
You produced some decent factors there. I looked on the internet for the dilemma and located most individuals will go along with together with your site.
|Jersey Face Masks Su[89.28.10.*]2020/11/23 23:06:18||#102|
My brother suggested I might like this blog. He was totally right. This post actually made my day. You cann at imagine just how much time I had spent for this information! Thanks!
|New York giants[89.28.10.*]2020/11/23 20:15:54||#100|
page dailly and get fastidious information from here daily.
|stockhouse picks 202[89.28.10.*]2020/11/20 13:51:21||#99|
You got a very great website, Gladiola I found it through yahoo.
Lovely just what I was searching for.Thanks to the author for taking his clock time on this one.
|get deal[89.28.10.*]2020/11/20 11:04:40||#97|
You made some really good points there. I looked on the web to learn more about the issue and found most people will go along with your views on this website.
You made some really good points there. I checked on the web to learn more about the issue and found most people will go along with your views on this site.
|click here[89.28.10.*]2020/11/20 7:43:21||#95|
Keep up the excellent piece of work, I read few blog posts on this website and I conceive that your web site is really interesting and has got circles of great information.
|go to[89.28.10.*]2020/11/20 7:28:08||#94|
Spot on with this write-up, I actually suppose this web site needs much more consideration. I all in all probability be once more to learn rather more, thanks for that info.
|take a look at[89.28.10.*]2020/11/20 7:05:11||#93|
Lovely blog! I am loving it!! Will be back later to read some more. I am bookmarking your feeds also.
|Outdoor projector en[89.28.10.*]2020/11/20 3:14:55||#92|
Wow, incredible blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is magnificent, let alone the content!
This blog was how do I say it? Relevant!! Finally I have found something that helped me. Many thanks!
|2020 best lithium st[89.28.10.*]2020/11/19 4:32:59||#90|
I truly enjoy examining on this internet site, it has got wonderful blog posts. Never fight an inanimate object. by P. J. O aRourke.
|adyen bv etsy[89.28.10.*]2020/11/19 2:43:12||#89|
It as not that I want to duplicate your web site, but I really like the pattern. Could you tell me which theme are you using? Or was it tailor made?
|cheap panel[89.28.10.*]2020/11/18 2:06:47||#87|
You know so much its almost tough to argue with you (not that I personally
|cheap panel[89.28.10.*]2020/11/18 2:05:50||#86|
It as nearly impossible to find well-informed people in this particular subject, however, you sound like you know what you are talking about! Thanks|
|copy-trading crypto[89.28.10.*]2020/11/17 12:21:57||#85|
Really appreciate you sharing this article post.Really looking forward to read more.
|decentralized exchan[89.28.10.*]2020/11/17 11:00:41||#84|
I truly appreciate this blog post.Really looking forward to read more. Cool.
|crypto lending[89.28.10.*]2020/11/17 9:38:47||#83|
I went over this site and I conceive you have a lot of great information, saved to my bookmarks (:.
|hive crypto[89.28.10.*]2020/11/17 8:17:12||#82|
Spot on with this write-up, I absolutely feel this site needs a lot more attention. I all probably be back again to read more, thanks for the information!
|cotizar seguro quali[89.28.10.*]2020/11/17 6:22:51||#81|
It as onerous to find knowledgeable folks on this subject, but you sound like you realize what you are talking about! Thanks
|pastillas abortivas[89.28.10.*]2020/11/17 5:22:27||#79|
Thanks-a-mundo for the blog post.Really looking forward to read more. Really Great.
|agen judi bola[89.28.10.*]2020/11/17 0:12:06||#78|
Say, you got a nice article post.Really looking forward to read more. Want more.
|alquiler de carros e[89.28.10.*]2020/11/13 10:11:27||#77|
Thanks again for the blog article.Thanks Again. Great.
|Maryland office move[89.28.10.*]2020/11/13 7:17:57||#75|
You have mentioned very interesting details ! ps decent internet site. virtual private server | virtual private server |
|TV installation[89.28.10.*]2020/11/13 5:51:17||#74|
serenity malibu I am struggling with this problem, unknowingly i started importing other person blog posts..which i want to disable. Please help me out.
|Commercial cleaning[89.28.10.*]2020/11/13 4:24:38||#73|
You have observed very interesting points! ps decent site.
- 请教博主。我mysql的提示 V22.214.171.124 MySql.xxxx:check the tablename "tbl_site_info" is exist? error:ExeDataReader():Expression #1 of ORDER BY clause is not in SELECT list, references column 'information_schema.s1.ORDINAL_POSITION' which is not in SELECT list; this is incompatible with DISTINCT 配置如下： <?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name="Conn" connectionString="host=192.168.3.101;Port=3306;Database=xxxxx;uid=root;pwd=2017" providerName="MySql.Data.MySqlClient"/> </connectionStrings> </configuration>
- 我语句中用到了union all而且两个查询都有查询条件，action.select总是不成功，不知道有没有什么好的解决办法，谢谢
- 請問大神V5源碼要多少錢 我是和交流過的