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 –