protected void Button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
CheckBox a = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("checkbox1");
if (a.Checked)
{
int c1 = int.Parse(GridView1.Rows[i].Cells[0].Text);
int s = Convert.ToInt32(Session["Message"]);
String cn = GridView1.Rows[i].Cells[1].Text;
String ct = GridView1.Rows[i].Cells[2].Text;
String cs = GridView1.Rows[i].Cells[3].Text;
String cc = GridView1.Rows[i].Cells[4].Text;
String cty = GridView1.Rows[i].Cells[8].Text;
String cte = GridView1.Rows[i].Cells[9].Text;
string sql = string.Format("INSERT INTO Course_selected (cno,sno,cname,ccredit,ctype,ctime,csite,cteacher) values('{0}','{1}','{2}',{3},'{4}','{5}','{6}','{7}')",
c1, s, cn, cc, cty, ct, cs, cte);
string sql1 = string.Format("UPDATE Course SET ctotal = ctotal - 1 WHERE cno = '{0}'", c1);
string sql2 = string.Format("UPDATE Course SET cselected = cselected - 1 WHERE cno = '{0}'", c1);
try
ÎÒÓÃasp.net¿ª·¢wapÕ¾µã£¬Íê³ÉºóÈ¥http://validator.w3.org/ÕâÀïÑéÖ¤ÎÒµÄWapÒ³ÃæÊÇ·ñ±ê×¼£¬ÆäËüÎÊÌⶼ¸ÄºÃÁË£¬
¾ÍÊ£ÕâÒ»¸ö´íÎóÁË£¬°´×ÖÃæÒâ˼Àí½âÊÇ˵nameÊôÐÔÒÑ´æÔÚ£¬ÀàËÆÕâÑùµÄ´íÎó»¹Óв»ÄÜÓÃborder ,align,sizeµ ......