String iArray[] = new String[7]
for(Element BASE_PART:listbase){
........
iArray[] = {name,sex,idnum,bdate,vtype,hnum,vid}
}
int[] array1 = new int[10]Console.WriteLine("向数组输入十个学生的成绩:")
for (int i = 0i <array1.Lengthi++)
{
array1[i] = int.Parse(Console.ReadLine())
}
for (int j = 0j <10j++)
{
Console.WriteLine("第{0}个学生的成绩为:{1}", j, array1[j])
}
Console.ReadLine()
这样写才可以
for (int i = 0i <10i++){
SqlDataReader reader = null
SqlCommand cmd = conn.CreateCommand()
cmd.CommandText = "Select Answer from Question where QuestionId=@QUESTIONID"
cmd.Parameters.Add(new SqlParameter("@QUESTIONID", question[i]))
reader = cmd.ExecuteReader()
while (reader.Read())
{
ans[i] = reader.GetValue(0).ToString()
}
reader.Close()
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)