单击按钮上的GridView

时间:2013-03-11 07:39:19

标签: asp.net gridview

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。它不起作用。请建议我应该做对吗?

0 个答案:

没有答案