错误:应输入; mycon.Open();
string strcom="select biaoti,zhaizi,img,neirong,time,counter from news where newsID="+newsid+"";
DataSet ds = new DataSet();
SqlDataAdapter mycommand = new SqlDataAdapter(strcom,mycon);
mycommand.Fill(ds, "news");
dr = ds.Tables["news"].Rows[0];
strCon="select counter from news where newsID="+newsid+"";
SqlCommand mycommand2 = new SqlCommand(strCon, mycon);
SqlDataReader reader = mycommand2.ExecuteReader();
reader.Read();
int i = reader.GetInt32(0);
i;
reader.Close(); strCon="update news set counter="i.ToString()"where(newsID="newsid")";
mycommand2.CommandText=strCon;
mycommand2.ExecuteNonQuery();
mycon.Close();
------解决方案-------------------- =》
strCon="update news set counter="+i.ToString()+" where(newsID="+newsid+")";