ndodi 0 Newbie Poster

Hi everyone this is Eric here, can someine pls show me how to load data from SQL Database to the cristal Report i m using , I have this storedprocedure that retriever data from database

USE [Isando]
GO
/****** Object:  StoredProcedure [dbo].[getMod]    Script Date: 09/15/2008 23:11:05 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[getMod]
@grade_code            varchar(10)='', 
@module_name       varchar(15)='',
 @module_code    varchar(15)=''

As
 begin
 SELECT     MODULE_NAME,MODULE_CODE FROM ALIMODULE
WHERE GRADE_CODE = @grade_code

;
end

and a this method to get data from stored procedure

public DataTable getData()
        {

            connect.Connection();
            SqlCommand retr;

            retr = new SqlCommand("getMod", connect.con);
            retr.CommandType = CommandType.StoredProcedure;

           

            adapter = new SqlDataAdapter();
            myTable.Clear();
            adapter.SelectCommand = retr;
            adapter.Fill(myTable);


            connect.SearchCommand(retr);

            return myTable;

        }

to anyone who can help i'll like to say THANKS IN ADVANCE.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.