Please Help me

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HimanshuRanjan
    New Member
    • Apr 2008
    • 1

    Please Help me

    Hi Please help me

    I have an stored procedure and i have to return the record in the asp page selected in the stored procedure. and i have to print the records on the page.
    see the code


    create Procedure Hello
    (@Compid varchar(50),@Fe edback varchar(50),@Cu stomerName varchar(50))
    As
    Begin
    Insert Into feedback(Compid ,Feedback,Custo merName)Values( @Compid,@Feedba ck,@CustomerNam e)
    declare @Org varchar(50)
    declare @Customerid varchar(50)
    set @Org=(select OrgId from csm_complaint_m st where ComplaintID=@Co mpid and CustomerName=@C ustomerName)
    set @Customerid=(se lect CustomerId from csm_complaint_m st where ComplaintID=@Co mpid and CustomerName=@C ustomerName)
    Select Distinct Top 1 a.MailId from com_user_mst a,csm_cumapping _trans b
    where a.Compid=b.Comp ID and a.OrgID=b.OrgID and a.roleid in ('SDE','SDM')an d a.userid=b.user id
    and len(a.mailid)>1 and a.OrgID= @Org and b.customerid=@C ustomerid

    End

    GO


    and asp page code


    <%
    Const adCmdStoredProc =&H0004
    Const adParamInput=&H 0001
    Const adParamOutput=& H0002
    Const adVarchar=200


    dim feedback
    Dim CompRefn,use,cu stomernam,compa nysumma,userad, usermaili,orgna m
    CompRefn=reques t.querystring(" CompRefno")
    customernam=req uest.querystrin g("customerna ")
    feedback=reques t.querystring(" options")

    Dim con
    Dim Obj
    Dim him
    Dim sql
    Dim rs

    Set con= Server.CreateOb ject("ADODB.Con nection")
    Set rs = Server.CreateOb ject("ADODB.Rec ordset")

    Set Obj = Server.CreateOb ject("ADODB.Com mand")

    con.Open "Provider=SQLOL EDB; Data Source = (local); Initial Catalog = pipl; User Id = sa; Password=sa;"

    Obj.ActiveConne ction = con
    Obj.CommandText = "Hello"
    Obj.CommandType = adCmdStoredProc


    Obj.Parameters. Append Obj.CreateParam eter ("@Compid", adVarChar, adParamInput, 50,CompRefn)
    Obj.Parameters. Append Obj.CreateParam eter ("@Feedback" , adVarChar, adParamInput, 50,feedback)
    Obj.Parameters. Append Obj.CreateParam eter ("@CustomerName ", adVarChar, adParamInput, 50,customernam)
    set rs=Obj.Execute

    for each x in rs.fields
    him=x.field
    response.write him
    response.write" data"
    next





    set Obj=Nothing
    con.Close
    set con=Nothing



    %>
    <html>
    <body></body></html?



    Please help me my page is not giving errors but inserting the value in table through the stored procedure but not returning the values.
  • Stang02GT
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Originally posted by HimanshuRanjan
    Hi Please help me

    I have an stored procedure and i have to return the record in the asp page selected in the stored procedure. and i have to print the records on the page.
    see the code


    create Procedure Hello
    (@Compid varchar(50),@Fe edback varchar(50),@Cu stomerName varchar(50))
    As
    Begin
    Insert Into feedback(Compid ,Feedback,Custo merName)Values( @Compid,@Feedba ck,@CustomerNam e)
    declare @Org varchar(50)
    declare @Customerid varchar(50)
    set @Org=(select OrgId from csm_complaint_m st where ComplaintID=@Co mpid and CustomerName=@C ustomerName)
    set @Customerid=(se lect CustomerId from csm_complaint_m st where ComplaintID=@Co mpid and CustomerName=@C ustomerName)
    Select Distinct Top 1 a.MailId from com_user_mst a,csm_cumapping _trans b
    where a.Compid=b.Comp ID and a.OrgID=b.OrgID and a.roleid in ('SDE','SDM')an d a.userid=b.user id
    and len(a.mailid)>1 and a.OrgID= @Org and b.customerid=@C ustomerid

    End

    GO


    and asp page code


    <%
    Const adCmdStoredProc =&H0004
    Const adParamInput=&H 0001
    Const adParamOutput=& H0002
    Const adVarchar=200


    dim feedback
    Dim CompRefn,use,cu stomernam,compa nysumma,userad, usermaili,orgna m
    CompRefn=reques t.querystring(" CompRefno")
    customernam=req uest.querystrin g("customerna ")
    feedback=reques t.querystring(" options")

    Dim con
    Dim Obj
    Dim him
    Dim sql
    Dim rs

    Set con= Server.CreateOb ject("ADODB.Con nection")
    Set rs = Server.CreateOb ject("ADODB.Rec ordset")

    Set Obj = Server.CreateOb ject("ADODB.Com mand")

    con.Open "Provider=SQLOL EDB; Data Source = (local); Initial Catalog = pipl; User Id = sa; Password=sa;"

    Obj.ActiveConne ction = con
    Obj.CommandText = "Hello"
    Obj.CommandType = adCmdStoredProc


    Obj.Parameters. Append Obj.CreateParam eter ("@Compid", adVarChar, adParamInput, 50,CompRefn)
    Obj.Parameters. Append Obj.CreateParam eter ("@Feedback" , adVarChar, adParamInput, 50,feedback)
    Obj.Parameters. Append Obj.CreateParam eter ("@CustomerName ", adVarChar, adParamInput, 50,customernam)
    set rs=Obj.Execute

    for each x in rs.fields
    him=x.field
    response.write him
    response.write" data"
    next





    set Obj=Nothing
    con.Close
    set con=Nothing



    %>
    <html>
    <body></body></html?



    Please help me my page is not giving errors but inserting the value in table through the stored procedure but not returning the values.

    Please read the posting guidelines and use [CODE] tags when posting code.

    Comment

    Working...