Hi, I have two fields in search grid where i want to display the varchar values of 2 combos in search grid. But their int values are stored in table.
The two combos are Grade combo and designation combo. Grade combo values comes grade table, and designation's from designation table.how to call for both at the same time
create PROCEDURE [dbo].[usp_GetGradeAndDesignationByGradeTextAndDesignationTextValue]
@ID varchar(20),
@IDtwo varchar (20)
AS BEGIN
SET NOCOUNT ON;
SELECT tblGradeMaster.*,tblDesignationMaster.*,tblAllowanceMaster.*
from tblGradeMaster,tblDesignationMaster,tblAllowanceMaster
WHERE
tblGradeMaster.grID=tblAllowanceMaster.alGradeID and tblDesignationMaster.desID=tblAllowanceMaster.alDesignID
and grGrade LIKE @ID+'%' and desDesignation LIKE @IDtwo+'%'
END
This is my stored procedure to get the combo's varchar values in search grid . grade master and allowance master are the ones where i get the combo values. Im storing the combo values id in allowance master. but my question is how to call both of them together in search grid and i want to display their varchar values in search grid
public DataTable GetGradeByGradeTextValue(string p,string q)
{
DataTable dt = new DataTable();
SqlConnection con = new SqlConnection(varConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "usp_GetGradeByGradeTextValue";
cmd.Parameters.Add(new SqlParameter("@ID", p));
cmd.Parameters.Add(new SqlParameter("@ID", q);
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
try
{
adapter.Fill(dt);
}
catch
{
dt = null;
}
return dt;
}
used the above code in Data Layer class and called it in business layer.
how can i call them both below in the same time
protected DataTable GetDataFromDatabaseTemp()
{
string ID = txtSearch.Text;
DynamicMasterBLL dynamicMasterBLL = new DynamicMasterBLL();
DataTable dataTable = new DataTable();
dataTable = dynamicMasterBLL.GetGradeByGradeTextValue(ID);
return dataTable;
}
this is the code i gave in main page. I don know what to declare for 2nd ID(ie IDtwo) in main page. if there are 2 combos varchar field to be added in search grid how can i add.
Note: please let me know how i can add screen shot so that it will be easier to understand