Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
my code is
C#
protected void Page_Load(object sender, EventArgs e)
      {
          objMember.orderpkstring = Convert.ToString( Session["orderpkstring"]);

          repeater.ItemTemplate = LoadTemplate("~/View/frmOrderJournal.ascx");
          DataSet ds;
          ds = objMember.GetJournalforSub(objMember);
          repeater.DataSource = null;
          if (ds.Tables[0].Rows.Count > 0)
          {
              repeater.DataSource = ds;
              repeater.DataBind();
          }
          else
          {

              ClientScript.RegisterStartupScript(this.GetType(), "Javascript", "javascript:window.close()", true);
              Response.Redirect("frmManageRemitance.aspx");
          }
      }

and
C#
public DataSet GetJournalforSub(AbstractLayer.baseMember objMember)
       {
           DataSet dsState;
           SqlParameter[] param = new SqlParameter[1];
           // param[0] = new SqlParameter("@JrnlFk", objMember.jrnlpkstring);
           param[0] = new SqlParameter("@journalstring", objMember.orderpkstring);
           dsState = SqlHelper.ExecuteDataset(m_Connection_String, CommandType.StoredProcedure, "proGetJournalForSub", param);
           return dsState;
       }


and my procedure is

SQL
ALTER procedure [dbo].[proGetJournalForSub]
@journalstring xml
--@Buyr_Id int,
--@PublisherFK int
as
DECLARE @hDoc int
begin
EXEC sp_xml_preparedocument @hDoc OUTPUT,
@journalstring int


SELECT  distinct    dbo.Tbl_ILSM_JournalReg.PK, dbo.Tbl_ILSM_JournalReg.JournalName, dbo.Invoice_Table.JrnlYear, dbo.Invoice_Table.JrnlCur, 
                      dbo.Invoice_Table.price, dbo.Invoice_Table.postage, dbo.Invoice_Table.DisOnClient, dbo.Invoice_Table.DisOnTitle, dbo.Invoice_Table.FinalPrice, 
                      dbo.Invoice_Table.Buyr_Id, dbo.Invoice_Table.pk AS invpk, dbo.Invoice_Table.JournalType, dbo.Tbl_ILSM_JournalReg.PublisherFK, 
                      dbo.Tbl_ILSM_Publisher.Discount, dbo.Tbl_ILSM_Publisher.FixDiscount,Tbl_ILSM_Publisher.PublisherName,
                      Invoice_Table.Invoice_No, C.CustomerName,q.InvoiceJrnlFK,q.SubOrderId,q.Currency,q.PCurrency,
q.ConversonType,
convert(varchar(10), q.ConversonDate,103) as ConversonDate ,Invoice_Table.YearSubscr,q.CurrencyID,q.RemettanceNO,
case 
when Invoice_Table.JournalType='PR' then
JY.PrIntPrice
when Invoice_Table.JournalType='PO' then
JY.IntPrice
when Invoice_Table.JournalType='ON' then
JY.OnIntPrice
end
as JrnlPrice,
case 
when Invoice_Table.JournalType='PR' then
JY.PrIntPostage
when Invoice_Table.JournalType='PO' then
JY.IntPostage
when Invoice_Table.JournalType='ON' then
''
end
as JrnlPostage

					FROM         dbo.Invoice_Table INNER JOIN
                      dbo.Tbl_ILSM_JournalReg ON dbo.Invoice_Table.JournalFK = dbo.Tbl_ILSM_JournalReg.PK INNER JOIN
                      dbo.Tbl_ILSM_Publisher ON dbo.Tbl_ILSM_JournalReg.PublisherFK = dbo.Tbl_ILSM_Publisher.PK
                      inner join tbl_ilsm_customer C on C.pk=Invoice_Table.Buyr_Id
                      inner join tbl_ilsm_jrnl_yrrt JY on JY.journalfk=Tbl_ILSM_JournalReg.pk 
                      and JY.[year]=Invoice_Table.JrnlYear 
                      inner join 
                      (SELECT InvoiceJrnlFK,JournalFK,CustomerPK,SubOrderId,PCurrency,Currency,ConversonType,ConversonDate,CurrencyID,
                      RemettanceNO
                       

FROM OPENXML(@hdoc, 'DocumentElement/dtJournal',3)
WITH (InvoiceJrnlFK int,
JournalFK int,
CustomerPK int,
SubOrderId varchar(100),
PCurrency varchar(10),
Currency varchar(10),
ConversonType varchar(10),
ConversonDate varchar(30),
CurrencyID int,
RemettanceNO varchar(50)

)) q

on q.CustomerPK=Invoice_Table.Buyr_Id and q.JournalFK=Invoice_Table.JournalFK and 
q.InvoiceJrnlFK=Invoice_Table.pk
                      --inner join tbl_ilsm_recipt_amount RA on RA.FK_Inv_id=Invoice_Table.PK
WHERE     (dbo.Invoice_Table.statusofjournal = 'suborder')
--and dbo.Invoice_Table.Buyr_Id=@Buyr_Id and dbo.Tbl_ILSM_JournalReg.PublisherFK=@PublisherFK





end
Posted
Updated 2-Mar-14 21:32pm
v4
Comments
Maciej Los 3-Mar-14 3:02am    
And the question is...
[no name] 3-Mar-14 3:02am    
Where you are getting this error improve question
sanjaysgh 3-Mar-14 3:04am    
sir i am getting error at this location

public static DataSet ExecuteDataset(SqlConnection connection, CommandType commandType, string commandText, params SqlParameter[] commandParameters)
{
//create a command and prepare it for execution
SqlCommand cmd = new SqlCommand();
PrepareCommand(cmd, connection, (SqlTransaction)null, commandType, commandText, commandParameters);

//create the DataAdapter & DataSet
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();

//fill the DataSet using default values for DataTable names, etc.
da.Fill(ds);

// detach the SqlParameters from the command object, so they can be used again.
cmd.Parameters.Clear();

//return the dataset
return ds;
}
sanjaysgh 3-Mar-14 3:04am    
in da.fill(ds);
Charlemagne Gustilo 3-Mar-14 3:04am    
Hi sanjaysgh,
This error occurs when you pass a non-numeric value to a parameter that is numeric. Have you tried checking values that are passed as your parameter?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900