DataSet dsData = new DataSet();
SqlConnection objSQLConnection=null;
string ConnectionString = "Data Source=INGNRGPILPSQL01;
Initial Catalog=AHD20_A103_Group2_DB;";
objSQLConnection = new SqlConnection(ConnectionString);
objSQLConnection.Open();
SqlCommand objSQLCommand = new SqlCommand("usp_ViewPatientDiagnosisFOM", objSQLConnection);
objSQLCommand.CommandType = System.Data.CommandType.StoredProcedure;
SqlDataAdapter objSQLDataAdapter = new SqlDataAdapter(objSQLCommand);
objSQLDataAdapter.Fill(dsData);
GrdViewPatientDiagnosisDetails.DataSource = dsData.Tables[0];
GrdViewPatientDiagnosisDetails.DataBind();
objSQLConnection.Close();
我试图在点击按钮(View)时查看GRID。它不起作用。请建议我应该做对吗?