Socut. Data. dll and aspnetpager. dll usage instructions and experiences

Source: Internet
Author: User
Socut. Data. dll and aspnetpager. dll usage instructions and experiences

Socut. Data. dll and aspnetpager. dll
Usage instructions and experiences

In the past, I used to work on a Java project. Recently, I took over a project. The customer requested to use. Net for only one month. To reduce the study time, I chose socut. Data. dll as the database access control and aspnetpager. dll as the page control. In this way, my major technical obstacles are basically solved. Below are some of my experiences on using these two controls in this project.
1, controls: 1, socut. Data. dll: http://data.socut.com/
2, aspnetpager. dll: http://www.webdiyer.com/AspNetPager/default.aspx
Ii. Instructions for use
1. socut. Data. dll connection Configuration
Add the following configuration items to the Web. config Configuration:
<Deleetask>
<! -- ****************** Database settings *****************
! -Socutdatalink: Database Link parameter (automatic judgment type)
! -Access type:/directory/database name. MDB
! -SQL Server Type: uid = Account; Pwd = password; database = database; server = Server
**************************************** * ********* -->
<Add key = "socutdatalink" value = "Server = 192.168.1.100 \ oasis_zt25j; uid = dev; Pwd = mypassword; database = xxxoa"/>
I am using the sqlserver2005o database.
<! -- ***************** Component authorization code *****************
! -Socutdatakey: System Authorization code (automatically determining domain names)
**************************************** * ********* -->
<Add key = "socutdatakey" value = "nzoxnwhil2e/4pdu6/4jng ="/>
<! --*************************************** * ****** -->
</Appsettings>
I am using version 3.0 and need a component authorization code, go to 2. Control Loading
Socut. Data. dll and aspnetpager. dll are loaded to the project in the same way. In the toolbar of Microsoft Visual Studio 2005, right-click the menu and choose "select item ...", In the pop-up window, browse and find control.

Iii. process experience
The biggest advantage of using socut. Data. dll is that it is very convenient to access and operate the database. In combination with aspnetpager. dll, I use the Repeater control as the data list display. The interface design is simple.
Http://data.socut.com/default.aspx here? Go = video has these two video tutorials, which are simple and clear. I am very grateful to the author for his good intentions.
Next, let's take a look at my data display. Code :
Protected void showgrid ()
{// Query condition variable assignment
Sqlwhere = "where isnull (cname,'') like '% "+ cname. text + "% 'and isnull (cvalue1,'') like' % "+ cvalue1.text +" % 'and isnull (cvalue2 ,'') like '% "+ cvalue2.text +" % '";
Aspnetpager1.recordcount = (INT) socut. Data. executescalar ("select count (*) from dconst" + sqlwhere );
Dataset DS = socut. Data. executedataset ("select * From dconst" + sqlwhere + "order by cname, cserial ",
Aspnetpager1.pagesize * (aspnetpager1.currentpageindex-1), aspnetpager1.pagesize );
// Use Repeater
Repeater1.datasource = Ds;
Repeater1.databind ();
}
Of course, in the query conditions, I have made restrictions on text special character input on the client, otherwise there will be problems. It is best to use the parameter passing method, which needs to be improved. According to the input parameters of socut. Data. executedataset, she should only return records of the specified number of rows to the cache, rather than retrieving all records. This improves efficiency and reduces the burden on Web servers.
Iv. Suggestions for improvement
I found that in socut. Data. dll, cache technology is definitely used to speed up database access. However, I have updated the database for some applications and cannot retrieve the updated value immediately. We also hope to have a better solution. It is best to set a certain access operation without caching.

Reprinted from: http://www.cnblogs.com/lojxg/archive/2007/10/26/938322.html

 

A few days ago, I was still using the page that comes with the gridview. Later, my friend told me this, hey! Super easy to use! Although there are other places, I still want to share it with you,

: Http://www.webdiyer.com/Products/AspNetPager/Downloads

Aspnetpager paging example: http://www.webdiyer.com/AspNetPagerDemo/ApplyStyles/default.aspx

After the download, you can pull the control into vs. Note that vs2003 cannot be used! The following code is used:

protected void pager1_pagechanged (Object sender, eventargs e)
{< br> oracleconnection objcon = This. getcon ();
string querystr = "select * from Stu";
oracledataadapter da = new oracledataadapter (querystr, objcon );
dataset DS = new dataset ();
da. fill (DS, "Stu");
This. gridview1.datasource = This. getpage (DS);/*** the main steps here are to call the following method ***/
This. gridview1.databind ();
}

Public pageddatasource getpage (Dataset DS)
{
This. pager1.recordcount = Ds. Tables [0]. Rows. count;
Pageddatasource PPS = new pageddatasource ();
PDS. datasource = Ds. Tables [0]. defaultview;
PPS. allowpaging = true;
PDS. currentpageindex = pager1.currentpageindex-1;
PPS. pagesize = pager1.pagesize;
Return PPS;
}

You just need to replace the interaction between the Code and the database with your own, that's OK! Try it!

Reprinted: http://www.cnblogs.com/elgt/archive/2009/12/26/1632872.html

Http://www.webdiyer.com/AspNetPagerDemo/ApplyStyles/default.aspx

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.