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 1]
Guide |
|
|
| #TopicOwner |
Download Address : CYQ.Data Tiny Data Components Download Center Learn how to use :
I:Add CYQ.Data reference to project II:Configuration database link web.config or app.config Tip: winform need right under the app.config attributes, for Yi options will change the content. 1:MSSQL Database Link Example <connectionStrings> <add name="Conn" connectionString="server=.;database=cyqdata.com;uid=sa;pwd=123456" providerName="System.Data.SqlClient"/> < SPAN>connectionStrings> 2:Access 2003 Database link example, V4.3 before, winform / web unified with [AccessDbNameForWeb] <appSettings> <add key="AccessDbNameForWeb" value="App_Data/myspace.mdb" /></appSettings> <connectionStrings> <add name="Conn" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0}" providerName="System.Data.OleDb"/> < SPAN>connectionStrings> 3:Oracle Database Link Example <connectionStrings> <add name="Conn" connectionString="Provider=MSDAORA;Data Source=cyqdata.com;User ID=sa;Password=123456;" providerName="System.Data.OracleClient"/> < SPAN>connectionStrings> 4:SQLite Database link example, V4.3 before, winform / web unified with [SQLiteDbNameForWeb] <appSettings> <add key="SQLiteDbNameForWeb" value="App_Data/myspace.mdb" /></appSettings> <connectionStrings> <add name="Conn" connectionString="Data Source={0}" providerName="System.Data.SQLite"/> < SPAN>connectionStrings> 5:MySQL Database Link Example <connectionStrings> <add name="Conn" connectionString="Server=127.0.0.1;Port=1234;Database=mysql;uid=sa;pwd=12346" providerName="MySql.Data.MySqlClient"/> < SPAN>connectionStrings> III:Generate a page stored procedure to the database[This step only applies to MSSQL, Oracle, other database, omit this step, have built-in paging] 1:Way 1, the code created to generate stored procedures, applies only to prior version V4.3 [not included V4.3] Please out CYQ.Data.SQL.OutPutData, generation, just find the background code execution aspx page: OutPutData data = new OutPutData(); data.ExeCreateProc(FiledDescriptionType.Sql2005); 2:The second way, using enumeration tool to generate 1:Download the enumeration tool 2:Run: configure link link, click the button to automatically generate stored procedures to complete. 3:Check: go to the appropriate database to see if the stored procedure to generate SelectBase page. IV:Try coding 1:The original way to write code Try 1: Data Binding original :
MAction action = new MAction("TableName");
GridView1.DataSource = action.Select(); GridView1.DataBind(); action.Close(); Shorthand:
using(MAction action=new MAction("TableName"))
{
action.Select().Bind(GridView1);
}
Try 2: Data fill MAction action = new MAction("TableName");
if (action.Fill(888))//Get id=888 's value { //For UI:SetTo与GetFrom
action.SetTo(labUserName);//labUserName is Lable Control。 //Control ID may agree to a "three-letter prefix" + field name, such as labUserName, UserName for the table field names.
//For No UI:Set 与 Get int userName=action.Get
action.Close(); } 2:Add Enum To Write Code Doubt: the above example a "TableName", "UserName", so knock dead code, or if you modify the table name field is not difficult to find problems? Answer: One way: to please the CYQ.Data.SQL.OutPutData, generated enumeration, just find a code-behind aspx page OutPutData data = new OutPutData();
Response.Write(data.OutPutAllTableEnum(TableType.U, FiledDescriptionType.Sql2005,false)); Operation: a new class called the name of TableNames.cs, to automatically delete all the information generated, leaving a blank, while the output of the enumeration copy and paste the above into it. Second way: V4.3 version has been removed OutPutData class, auxiliary tools to easily generate enumerate the files. Then try 1: Data Binding using(MAction action = new MAction(TableNames.Users))//Use Enum
{ action.Select().Bind(GridView1); } Then try 2: Data fill MAction action = new MAction(TableNames.Users);
if (action.Fill("id=888")) {
action.SetTo(labUserName); int userName=action.Get<int>
action.Close(); } Chinese version of the link:http://cyqdata.com/cyqdata/article-detail-411 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/29 1:40:59 | #2 | |
Du2Zdd It was hard It was hard to get a grip on everything, since it was impossible to take in the entire surroundings of scenes. |
suba suba[89.28.10.*]2018/12/21 17:33:17 | #1 | |
BWyT5C Very good article post.Much thanks again. Fantastic. |
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.