0
我有一個storedProcedure加入四個表。我想在gridview控件中綁定來自不同表格的結果。SqlDataAdapter加入語句
,這裏是我的數據訪問層的代碼
aCommand = new SqlCommand("spViewPatientHistory", aConnection);
aCommand.CommandType = CommandType.StoredProcedure;
aCommand.Parameters.Add("@PatientId", SqlDbType.Int).Value = patientId;
aCommand.Parameters.Add("@FirstName", SqlDbType.VarChar).Value = firstName;
aCommand.Parameters.Add("@LastName", SqlDbType.VarChar).Value = lastName;
aDataAdapter = new SqlDataAdapter(aCommand);
aDataAdapter.Fill(aDataSet);
aConnection.Close();
,這是我的業務邏輯代碼
aHistoryPatientDataTable = aDataAccess.GetSearchPatientHistory(patientId,firstName,lastName);
在業務邏輯之出現錯誤
無法轉換數據集數據表。如何解決它?
看https://stackoverflow.com/questions/8983277/how-to-convert-dataset-to-datatable –