CFanatic

Go Back   CFanatic > Programming > C# Programming

Join CFanatic Forum Now

data grid with mssql using stored procedure topic posted under C# Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-06-2010, 06:01 AM
Junior Member
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
kianmiranda is on a distinguished road
| More
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

Code:
 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
    endand 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;
        }

Last edited by shabbir; 09-06-2010 at 07:49 AM. Reason: Code Blocks
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Having a hard time with this Data Grid View Hogan29 C# Programming 0 08-28-2010 03:11 AM
Execute stored procedure using a string variable sama123 C# Programming 0 06-23-2010 11:39 AM
Where does the string gets stored? Iqbal_h_a C Programming 7 07-31-2008 04:24 PM
data store en0ne C# Programming 5 07-27-2008 02:58 PM
how to pass the arguments to procedure to close the window vidhya Win32 Programming 0 05-30-2007 05:24 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 04:16 AM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board