DataSet ds = new DataSet ();
SqlConnection conn = new SqlConnection (Properties. Settings. Default. MyDataBaseConnectionString );
Conn. Open ();
SqlCommand cmd = new SqlCommand ("GetTablePro", conn );
Cmd. CommandType = CommandType. StoredProcedure;
SqlDataAdapter adapter = new SqlDataAdapter (cmd );
Adapter. Fill (ds );
If (ds. Tables. Count> 1)
DataGridView1.DataSource = ds. Tables [1];
Set ANSI_NULLS ON
Set QUOTED_IDENTIFIER ON
Go
-- ===================================================== ======
-- Author: <Author, Name>
-- Create date: <Create Date,>
-- Description: <Description,>
-- ===================================================== ======
Alter procedure [dbo]. [GetTablePro]
-- Add the parameters for the stored procedure here
AS
BEGIN
-- Set nocount on added to prevent extra result sets from
-- Interfering with SELECT statements.
Set nocount on;
-- Insert statements for procedure here
Select * from employee;
SELECT * from class;
END
From the column of AI yingguang