MANEESH AN

MANEESH AN

  • NA
  • 110
  • 47.3k

display on grid from combox selected values(add collection)

Jul 17 2013 6:01 AM
 private void button1_Click(object sender, EventArgs e)
        {
            decimal start;
            decimal last;

            if (comboBox1.SelectedText == "0")
            {
                start = 0;
                last = 5000;

            }
          

            else if (comboBox1.SelectedText == "1")
             {
                 start = 5000;
                 last = 10000;

             }

            else if (comboBox1.SelectedText == "2")
            {
                start = 10000;
                last = 25000;

            }
sp*

Alter PROCEDURE sp_loans            
 (           
 @dcLoan_Amt decimal(18,2)           
            
 )           
AS           
 begin           
            
-- declare @sqlQuery nvarchar(4000);           
-- set @sqlQuery='              
             
     
     
 select  vLoan_No as LoanNumber ,vParty_Id as CustomerName,dIssue_Date as DissueDate,dcLoan_Amt as LoanAmount from tbl_LoanMaster           
where dcLoan_Amt=@dcLoan_Amt      
     
     
--     
-- select  vLoan_No as LoanNumber ,vParty_Id as CustomerName,dIssue_Date as DissueDate,dcLoan_Amt as LoanAmount from tbl_LoanMaster           
--where dcLoan_Amt  between 5000 and  10000  
     
     
--  '           
--   +@vScheme           
--              
-- exec sp_executesql @sqlQuery             
--            
--           
-- RETURN              
end 




BL
***

    public DataTable fnLoanAmountDisplay(decimal dcLoan_Amt)
      {
            DataTable dt = new DataTable();
            dt = objLoanEntryDL.fnLoanAmountDisplay(dcLoan_Amt);
            return dt;
        }


DL
*****

 public DataTable fnLoanAmountDisplay(decimal dcLoan_Amt)
        {
            Connection con = new Connection();
            con.OpenConnection();
            SqlDataAdapter da = new SqlDataAdapter();
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con.conSql;
            cmd.CommandText = "sp_loans ";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@dcLoan_Amt", dcLoan_Amt);
            DataTable dt = new DataTable();
            da.SelectCommand = cmd;
            da.Fill(dt);
            con.CloseConnection();
            return dt;


        }

Answers (1)