We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,803 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

data grid with mssql using stored procedure

hi
please i need help with the query using the values from the combo box and the result will show on the data grid

sp

ALTER procedure [dbo].[sp_GetReservistInfo_ByDesignation]
@Platoon varchar (50),
@Company varchar (50),
@Batallion varchar (50),
@Brigade varchar (50),
@Division varchar (50),
@FirstName varchar(50), 
@MiddleName varchar(50), 
@LastName varchar(50),
@AFPSN varchar(50)

as

    begin
		SELECT   
			ReservistInfoDesignation.Squad, 
			ReservistInfoDesignation.Element, 
			ReservistInfoDesignation.Rank, 
			ReservistInfo.AFPSN, 
			ReservistInfo.LastName, 
			ReservistInfo.MiddleName, 
			ReservistInfo.FirstName
		FROM         
			ReservistInfo,
                        ReservistInfoDesignation 
        
		WHERE
			Division = @Division
			or Brigade = @Brigade 
			or Batallion = @Batallion
			or Company = @Company
			or Platoon = @Platoon
    end

and on the class

public DataTable GetReservistsDesignation()
        {
            try
            {
                sqlHelper.CreateConnection();
                sqlHelper.CreateCommand("sp_GetReservistInfo_ByDesignation");
                
                sqlHelper.ExecuteDataTable();
                sqlDT = sqlHelper.DataTable;
            }
            catch (Exception ex)
            {

            }
            finally
            {
                sqlHelper.CloseConnection();
            }
            return sqlDT;
        }
1
Contributor
0
Replies
1
View
kianmiranda
Newbie Poster
1 post since Sep 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0518 seconds using 2.66MB