0
我有一個表中的5個名字,我需要把這些放在一個數組列表中....將表中的名稱放入arraylist中?
任何建議???
int rowsinmachgrp = getnumofrows();//gets no of rows in table
SqlConnection dataConnection = new SqlConnection();
dataConnection.ConnectionString = ConfigurationManager.ConnectionStrings["SumooHAgentDBConnectionString"].ConnectionString;
SqlCommand dataCommand =
new SqlCommand("select MachineGroupName from MachineGroups", dataConnection);
{ArrayList names = new ArrayList();
dataConnection.Open();
ArrayList names = dataCommand.ExecuteScalar();
感謝
您正在將名稱添加到列表的行中缺少右括號。 – 2009-10-15 15:13:13
THX!修復。我不知道該說些什麼才能得到15個字符的評論 – Arthur 2009-10-15 15:17:11
SQLdataread找不到......錯誤.. dataread的使用命令是什麼.. ?? – user175084 2009-10-15 15:24:46