hi here is my sp
ALTER PROCEDURE [dbo].[usp_InsertBidTree1]
@DID varchar(20) output,
@DocType varchar(4) output,
@NodeID int,
@ParentNodeID int,
@Name varchar(50),
@Details varchar(max),
@Type varchar(50)
AS BEGIN
Insert into tblBidTree(btDID,btDocType,btName,btNodeID,btDetails,btParentNodeID,btType)
values(@DID,@DocType,@NodeID,@ParentNodeID,@Name,@Details,@Type)
END
and in BLL
public void InsertBidTree(TenderPreparationPL tprPL,SqlTransaction trans,SqlConnection cnn)
{
TenderPreparationDAL tprDAL = new TenderPreparationDAL();
tprDAL.InsertBidTree(tprPL);
}
DAL
SqlCommand cmd = new SqlCommand();
SqlConnection con = new SqlConnection("Data Source=accerlap2;Initial Catalog=Tendering2;User ID=sa;Password=p@ssword;");
con.Open();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "usp_InsertBidTree1";
cmd.Connection = con;
SqlParameter paraDID = new SqlParameter("@DID", SqlDbType.VarChar, 20);
SqlParameter paraDocType = new SqlParameter("@DocType", SqlDbType.VarChar, 4);
SqlParameter paraNodeID = new SqlParameter("@NodeID", SqlDbType.Int);
SqlParameter paraName = new SqlParameter("@Name", SqlDbType.VarChar, 50);
SqlParameter paraParentNodeID = new SqlParameter("@ParentNodeID", SqlDbType.Int);
SqlParameter paraType = new SqlParameter("@Type", SqlDbType.VarChar, 50);
SqlParameter paraDetals = new SqlParameter("@Details", SqlDbType.VarChar, 1000);
paraDID.Direction = ParameterDirection.Output;
paraDocType.Direction = ParameterDirection.Output;
paraNodeID.Value = objTPRPro.btNodeID;
paraName.Value = objTPRPro.btName;
paraParentNodeID.Value = objTPRPro.btParentNodeID;
paraType.Value = objTPRPro.btType;
paraDetals.Value = objTPRPro.btDetails;
cmd.Parameters.Add(paraDID);
cmd.Parameters.Add(paraDocType);
cmd.Parameters.Add(paraNodeID);
cmd.Parameters.Add(paraName);
cmd.Parameters.Add(paraParentNodeID);
cmd.Parameters.Add(paraType);
cmd.Parameters.Add(paraDetals);
cmd.ExecuteNonQuery();
objTPRPro.btDocType = paraDocType.Value.ToString();
objTPRPro.btDID = paraDID.Value.ToString();
con.Close();
in Save button click
public bool Save(bool IsEmail)
{
BidTreePL objBIDPL = new BidTreePL();
TenderPreparationPL objTPRPL1 = new TenderPreparationPL();
SqlConnection cnn = new SqlConnection();
objBIDPL.btDID = SessionManager.TPR1DID;
objBIDPL.btDocType = SessionManager.CurrentDocType;
objBIDPL.btName = objBIDPL.btName;
objBIDPL.btNodeID = objBIDPL.btNodeID;
objBIDPL.btParentNodeID = objBIDPL.btParentNodeID;
objBIDPL.btType = objBIDPL.btType;
objBIDPL.btDetails = objBIDPL.btDetails;
TenderPreparationDAL objTPRBL = new TenderPreparationDAL();
objTPRBL.InsertBidTree(objTPRPL1);
}
in my web application am using controls as dynamic and code as static
now am getting error like usp_InsertBidTree1 @ParentNodeID which was not supply..
can any one suggest me how to solve this..
thanks