The display information of literal1 can be arranged in a matrix like that of the gridview.

Source: Internet
Author: User

 

Protected   String Jigou ()
{
String Sqlcomm =   "" ;
Sqlconnection myconn = DB. mychinaedp ();
String Strcontent =   "" ;
Myconn. open ();
Int I =   0 ;
// Number of news records per line
Int Zong =   20 ;
// Define the total number of words
Int Number =   0 ;
// Number of spaces to add
String Kongge =   "" ;
// Space Accumulation
Sqlcommand mycomm =   New Sqlcommand (sqlcomm, myconn );
Sqldatareader SDR = Mycomm. executereader ();
While (SDR. Read ())
{
I ++ ;
Number = Zong - SDR [ " Newstitle " ]. Tostring (). length;
For ( Int Y =   0 ; Y < Number; y ++ )
{
Kongge + =   " " ;
}
Strcontent + =   ""   + SDR [ " Newstitle " ]. Tostring () +   ""   + Kongge;
If (I %   3   =   0 ) // Determine how many lines of information are displayed per line
{
Strcontent + =   " <Br> " ;
}
Kongge =   "" ;
Number =   0 ;
}
SDR. Close ();
Return strcontent;
}< br>

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.