代碼如下:
SqlConnection conConnection = new SqlConnection(strConnect);
conConnection.Open();
string cmd = "select User_Name,User_Pass,from UserData";
SqlCommand com = new SqlCommand(cmd, conConnection);
SqlDataReader reader = com.ExecuteReader();
while (reader.Read())//從數據庫讀取用戶信息
{
User = reader["User_Name"].ToString();
Password = reader["User_Pass"].ToString();
然後一直報錯
請問是執行的SQL命令出錯了嗎?
sql錯了,from前面去掉逗號