循环连接字符串的问题!————————————————急!
cs代码先贴上:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class News_News_Sections_Edit : System.Web.UI.Page
{
ConnectionDb db = new ConnectionDb();
DataSet ds1 = new DataSet();
DataSet ds2 = new DataSet();
//public static string max_id;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
additmes();
//max_id = getMaxId();
//Response.Write(max_id);
}
}
//綁定dropdownlsit
public void additmes()
{
string items_id = " ";
string name = " ";
//獲取所有link字段
string allitems = "select LINK from NEWS_SECTIONS order by LINK ";
//獲取數據集
ds1 = db.getDataSet(allitems, "NEWS_SECTIONS ");
//字段斷行數
int num = ds1.Tables[ "NEWS_SECTIONS "].Rows.Count;
//從1取值
for (int i = 0; i < num; i++)
{
string addstr = " ";
//循環賦值
items_id = ds1.Tables[ "NEWS_SECTIONS "].Rows[i][0].ToString();
//Response.Write(items_id + " <br /> ");