Capturing Return_Value From SP And Displaying Message On The Page Based On The Value

Apr 14, 2008

Hello

I'm using FromView to Insert record into a DB. My SP checks for the existence and returns -1 if record already exists. I know that my SP returns -1 but how do I capture that into FormView and display error message to the user? All I get is the "Agreement was created" regardless of what SP returns.
Your help is appreciated.

Mark
Here is the code I'm using:
Protected Sub OnInserted(sender As Object, e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)
        Dim retValParam As New SqlParameter("@RETURN_VALUE", SqlDbType.Int)
        retValParam.Direction = ParameterDirection.ReturnValue
        
 
        Dim valParam As Integer = Convert.ToInt32(retValParam.Value)
        If valParam = -1 Then
          lblMessage.Text = "The Account ID is not valid"
        Else
        if valParam = -2 then
          lblMessage.Text = "Agreement ID already exists"
          else
          lblMessage.Text = "Agreement was created"
        End If
      end if
  End Sub

and parts of ASPX page with FromView:

 InsertCommand="spNew_Agreement" OnInserted="OnInserted">
 
  <FilterParameters>
  <asp:ControlParameter Name="Acct_Name" ControlID="txtAcct_Name" />
  </FilterParameters>
  <InsertParameters>
  <asp:Parameter Name="acct_id" Type="string" />
  <asp:Parameter Name="agreement_id" Type="string" />
  <asp:Parameter Name="return_value" Type="int32" Direction="ReturnValue" />
  </InsertParameters>

View 10 Replies


ADVERTISEMENT

Reporting Services :: All Record Are Displaying On One Page - How To Display Page By Page

Nov 11, 2015

I have created one reports but all the records are displaying on one page.find a solution to display the records page by page. I created the same report without group so the records are displaying in page by page.

View 3 Replies View Related

Error Message Is Not Displaying In This Query? Why?

Apr 14, 2006

Hello all

please see this query

select * from Table1 where Table1ID in
(select Table1ID from Table3)

Step1 )select Table1ID from Table3

output->Giving error as Table1ID is not valid column in Table3 .

Step2)select * from Table1 where Table1ID in
(select Table1ID from Table3)

Output-> Giving all records of Table1 as i am expecting error from this query .

Please check with your demo database and reply.

Thanking you.

Ramana.

View 7 Replies View Related

Displaying No Record Found Message

May 25, 2007

hi all,

i want to show a message when no rows is being returned from the data set,

i.e when there is no data to display the report should display

"No Record Found"

View 3 Replies View Related

Displaying Error Message - No Rows Returned

Dec 4, 2006

Hello,

I have a seach on UserID enetred in a textbox by user.

When the user types a userID which has no data in the database can I display an error msg instead of the chart and table that is displayed on entering a valid userID.



Thanks,

Kiran.

View 3 Replies View Related

Displaying Select Results On The Page

Aug 28, 2006

I have the following select statement on my page: <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:prbc_hrConnectionString %>"
SelectCommand="SELECT emp_lname + ', ' + emp_fname + ' ' + emp_minitial + '.' AS emp_fullname FROM employee WHERE (emp_username = @emp_username)">
<SelectParameters>
<asp:SessionParameter Name="emp_username" SessionField="Username" Type="String" />
</SelectParameters>I want to say "Welcome, emp_fullname" at the top of the page, but can't figure out how to write the results to the page.  I am moving to ASP.NET 2.0 from PHP and am banging my head against the wall trying to figure out how to do these little things. I appreciate any help you can give.

View 1 Replies View Related

Reports Page Not Displaying Properly.

Mar 15, 2007

I've installed Report Server 2005 Express on my XP Pro workstation. When I try to pring up the reports page (http://localhost/Reports) all I get is the following:

"<%@ Page language="c#" Codebehind="Home.aspx.cs" AutoEventWireup="false" Inherits="Microsoft.ReportingServices.UI.HomePage" %>
<%@ Register TagPrefix="MSRS" Namespace="Microsoft.ReportingServices.UI" Assembly="ReportingServicesWebUserInterface" %>"

I've been trying to go through the Video training from MSDN, and followed the install as they did it, but my page won't come up. Very new to this so any and all help would be greatly apprecicated. My IIS knowledge is beginner.

Thanks,

C.J.

View 5 Replies View Related

Displaying A Report In A IE Window Before Changing To An ASP.NET Page

Feb 6, 2008

Hi

I have a strange problem that basically consists of showing a report in Internet Explorer and then using the same Internet Explorer window to show an asp.net page that contains some form where the user can enter some data. In this scenario, the form won't be processed on the server. I really need to know why and how I can work around this problem.





Precisely the problem can be reproduced like this:


Environment: Server: Windows 2003 Standard Server SP1 (German), IIS 6, Client: Windows XP SP2, Internet Explorer 6

First I open a new Internet Explorer Window and let it show me a Reporting Services Report (by entering its url into the address bar). Everything works. Then I change the address to a simple web application's address that is built with asp.net (.net 1.1). The application contains only a form with a submit-button, a text box and a label, that shows the textbox' text after submit was clicked. But when I click the submit button, although the form seems to have been sent to the server (the green progress bar in the status bar is flickering), it's reset. So the label does not show the value I have entered into the the textbox and the textbox itself is cleared. This only happens when the browser was first showing a Report from Reporting Services, so when I open a new Browser Window and go directly to the web app, everything works fine.

It does not happen when I open the Browser directly on the server.

Thank you
Christian

View 3 Replies View Related

Displaying Tablenames Based On The Column Name

Jun 5, 2008

hi,

i have the following scenario,

100 tables in the database,i have to display the table names if the column name given by the user is repeated in the different tables...

e.g.: Let us say,the column name ID IS REPEATED in the 70 tables out of 1000 tables.Then i have to display all the 70 table names..

how to write sql query for it?

i am greateful if any one help me in solving this scenario..

View 9 Replies View Related

Displaying Different Reports Based On A Parameter

Sep 27, 2007

Hi,

I have bunch of reports that take same set of parameters. I am trying parametrize the report type so that depending on the report type selected, body should display that report when user hits "View report" button. How can I do this? Pardon me if there is an obvious solution as I am pretty new to the joys of MS Reporting Services.

Thanks a bunch.

View 1 Replies View Related

Displaying Text From SQL Server Onto Page Keeping Paragraphs, Etc?

Apr 24, 2008

 Hi, I am trying to work ouyt how to dislplay text from an SQL database onto the page whilst keeping the correct formatting, mainly the paragraph breaks. When I try using a label the text comes out as one long line instead of being seperated accordingly as it was done when written in a multiline textbox. I am currently achieving this by writing the text to a txt file and then displaying it dynamically by inserting each line into a new table row and then adding these to a table, but I would much rather store them in the databse along with the other information that is collected with it instead. Someone told me to use a textbox to achieve this but the problem is that this is not crawlable for the search engine. 

View 10 Replies View Related

Reporting Services ReportViewer Page Is Not Displaying The Report

Aug 14, 2007

Hi

I had a problem accessing our report manager via the web front...
We deleted the virtual directories in IIS and then recreated them... this required us to make a change in the rsWebApplication.config file to include the URL in the ReportServerUrl tag before we could access the site again.
Now we have access to the site but when we attempt to view a report that we deployed to it - the report fails to render and returns a rsReportNotReady error, even though the report doesnt use a snapshot.

Furthermore, the strange thing is that the filters for the report don't display in their own collapsable bar as they used to before... they just display on the white part of the page. Neither does the reportviewer toolbar display properly. It appears as labels and textboxes going down the page and not in a toolbar as you might expect...

any help is appreciated... we suspect that it is some kind of configuration issue, but we have no clue where to begin...

View 1 Replies View Related

Reporting Services :: Report Viewer Next Page Is Not Displaying

Sep 10, 2015

I have created .RDLC file/report in MVC, but in Report Viewer when i try to display next page, i am unable to see the next page. it is just displaying the first page data and charts only.

View 3 Replies View Related

Displaying Multiple Categories (from Seperate Tables) To Be Viewed On One Page

Mar 24, 2007

Hello.
 I just created separate tables for each of my categories and  wanted to know how to return them all to be viewed on one page using the SQL Datasource (or whatever) This is for user accounts. I just need to know that part.
 Sincerely,
Computergirl
 

View 1 Replies View Related

About Receiving An Image From SQL Server 2000 And Displaying It In Aspx Page..................

Jul 14, 2007

hi friends,            i need a code for storing and receiving an image to/fro SQL SERVER 2000 (in C#). i had searched some sites, all are in VB for windows forms not for website. finally i got a code from some site. it is working for storing purpose. not working for receiving purpose. the code for receiving and displaying purpose is (in a fresh page) private void Page_Load(object sender, System.EventArgs e){ // Put user code to initialize the page here MemoryStream stream = new MemoryStream (); SqlConnection connection = new SqlConnection (@"server=INDIAINDIA;database=iSense;uid=sa;pwd=india"); try { connection.Open (); SqlCommand command = new SqlCommand ("select Picture from Image", connection); byte[] image = (byte[]) command.ExecuteScalar (); stream.Write (image, 0, image.Length); Bitmap bitmap = new Bitmap (stream); Response.ContentType = "image/gif"; bitmap.Save (Response.OutputStream, ImageFormat.Gif); } finally { connection.Close (); stream.Close (); }}what s the problem is.........i'm getting an exception at Bitmap instantiation.(i.e Bitmap bitmap = new Bitmap (stream);)exception is "Parameter is not valid" what is the problem with that coding? was it correct? do u have any code for this in C#? if so, pls provide that......help me........pls.............

View 2 Replies View Related

Displaying An Database Image In SSRS Report Page Header

Jan 23, 2007

How to display an database image in the Report page header of sql server reporting service?

View 3 Replies View Related

Displaying Total Number Of Rows In A Report In Page Header.

Jun 20, 2007

Hi,



I have requirement to display Total number of Rows in a Report in Page Header.



I have written the following code in Page header it shows RowCount for the Page only.

=Count(ReportItems!textboxInTableCell.Value)



Can anyone please help on this?



Regards

Raghav





View 3 Replies View Related

Reporting Services :: Displaying A Chart Based On Parameters Selected

Oct 2, 2015

I am producing a report in Report Builder 2 containing a chart and table.  The user is able to select single or multiple choices on a parameter called Specialty.  My present chart is only suitable when one Specialty is selected.  Therefore I only want this to be visible when the user has selected one Specialty.  I am planning to create a second chart which is suitable for than more than one selection. So if the user selects more than one Specialty the existing chart will not be visible and instead will be replaced by the second.I think this should be done using Chart Properties>Visibility but cannot develop the logic of the expression.

View 5 Replies View Related

Printing Page ? Of ? Message

Dec 26, 2006

I am using vb.net. and sql server 2005 reporting services. But the report in question uses the local report functionality.

I am writing a credit card processor that prints a slip at the end of the transaction. There is an annoying message form that pops up on the screen stating that it is "Printing Page 1 of Document" . It seems to be beyond my reach. Its position is the typical windows auto positioning (ala cascade). I dont want the user to see it.

How do i surpress this printing message? Is it embedded in the printer driver or spooler services? Is it surpressable from the reporting services local report configuration?



Thanx



View 1 Replies View Related

Return_Value = 11

Jul 1, 2004

I have a stored proc that retrives a segment of data, via a select statement and also returns @@RowCount to tell me the total number of records. It goes something like this:


SELECT ProductID FROM tbl_Products
@Counter = @@RowCount

SELECT ProductID FROM tbl_Products WHERE ProductID>1 AND ProductID<=25
RETURN @Counter

The Idea is that I can populate a "Showing items 1 to 25 of 75" label on my web form. Don't worry overly about syntax issues in the above snippet, I am only trying to get across what I am doing.

When I run my SP from query analyser it works properly. I get a list of my products, and the Return_Value is set correctly.

When I run my SP from a command as follows, the return value *ALWAYS* is set to 11.

Function MyFunction() as Integer
Dim dtr As SqlDataReader
Dim oConn As SqlConnection = New SqlConnection(sConn)
Dim cmd As New SqlCommand("sproc_ProductListByCategory", oConn)

With cmd
.CommandType = CommandType.StoredProcedure
.Parameters.Add("@Return_Value", DbType.Int32)
.Parameters("@Return_Value").Direction = ParameterDirection.ReturnValue
End With

oConn.Open()
dtr = cmd.ExecuteReader(CommandBehavior.CloseConnection)

'get the total number of products
Dim iReturn As Integer = cmd.Parameters("@Return_Value").Value

While dtr.Read
'code to process my product info
End While

oConn.Close()
dtr.Close()
cmd.Dispose()

Return iReturn

End Function
If I call the cmd object twice (eg once as ExecuteNonQuery and then as ExecuteDataReader) then it works just fine. But this seems stoopid as it involves processing the SP twice!!

So, has anyone else experienced this?
Anyone know what causes this problem?
Bearing in mind I already know an inefficient one, anyone know an *efficient* workaround? ;-)

TIA,
Mark

View 3 Replies View Related

How Can I Get Hte Return_Value??

Mar 23, 2006

Hi all~~~
I had used sqlDataSource + SQLserver procedure
The procedure like this:
.........................
BEGIN
   SELECT * FROM xxx
   RETURN 1
END
 
er~~~How can I get the return_value with sqlDataSource ??

View 4 Replies View Related

Page File Warning Message

Jun 27, 2001

We are seeing the following error message in our SQL logs and was hoping for some advice.

"Warning: the available page file space has dropped below 4 MB"

To fix the problem we thought we should increase our paging file size for our virtual memory on the server. The recommended allocation was 3083 MB and previously we were using less than the recommended amount so we allocated 7167 MB (the max we were allowed). Do you see any problems with this or have any recommendations?

View 4 Replies View Related

Page Allocation Error Message

May 19, 2008

Hi all,
I am running SQL 2000 Enterprise SP4 on Windows Server 2003 Standard SP2

I am getting the follow error message:
Table error: Page (1:53888) allocated to object ID 546100986, index ID 0 was not seen. Page may be invalid or have incorrect object ID information in its header.

I check the hardware and didn't see any issues.
I run the following command to check the actual page:
dbcc traceon (3604)
dbcc PAGE ([Statistics], 1, 53888, 1)

Here is the output:

PAGE: (1:53888)
---------------

BUFFER:
-------

BUF @0x015D7A00
---------------
bpage = 0x73F40000 bhash = 0x00000000 bpageno = (1:53888)
bdbid = 19 breferences = 1 bstat = 0x9
bspin = 0 bnext = 0x00000000

PAGE HEADER:
------------

Page @0x73F40000
----------------
m_pageId = (1:53888) m_headerVersion = 1 m_type = 1
m_typeFlagBits = 0x0 m_level = 0 m_flagBits = 0x0
m_objId = 402100473 m_indexId = 0 m_prevPage = (1:50311)
m_nextPage = (1:53890) pminlen = 579 m_slotCnt = 0
m_freeCnt = 8096 m_freeData = 7688 m_reservedCnt = 0
m_lsn = (3643:60824:142) m_xactReserved = 0 m_xdesId = (0:26032361)
m_ghostRecCnt = 0 m_tornBits = 67108866

Allocation Status
-----------------
GAM (1:2) = ALLOCATED SGAM (1:3) = NOT ALLOCATED
PFS (1:48528) = 0x40 ALLOCATED 0_PCT_FULL DIFF (1:6) = NOT CHANGED
ML (1:7) = NOT MIN_LOGGED

DATA:
-----

OFFSET TABLE:
-------------
DBCC execution completed. If DBCC printed error messages, contact your system administrator.


Please let me know what else I can do or check in order to eliminate this error.

Thank you,
T.

View 2 Replies View Related

Scope_Identity With @Return_Value

Apr 27, 2006

I am currently writing an application that inserts data into a MS SQL Server 2000 DB.  I am developing the application in Microsoft Visual Web Developer 2005 EE.  So far everything has come together nicely.  However, I have run into a situation that I can't seem to figure out.I wrote a stored procedure to insert data into the DB from a Web Form.  The insert works nicely; however, one of the requirements I have is that I would like the DB to return the last row inserted into to my table.  I am using the Scope_Identity() function at the end of my stored procedure to accomplish this task:...Last few lines of Stored Procedure...@ANNEXCITYCOUNCILACTION,@CRA)RETURN SCOPE_IDENTITY()GOI have conducted several tests on the SP, and received the following output from the DB when it is run:(1 row(s) affected)(0 row(s) returned)@GID = <NULL>@RETURN_VALUE = 116Finished running [dbo].[usp_InsertProject].I would like to take the result of the @RETURN_VALUE (116), and create a variable that I can use to embed into an e-mail.  The code for the e-mail generation is working however, the value that comes through for the @RETURN_VALUE is always 0.  I have tried several different things to get this to work, but so far no luck.Here is the application code I am using to create the e-mail: Sub SendEmail()        Dim mySqlDataSource1 = SqlDataSource1.ConnectionString.ToString        Dim myConnection As New Data.SqlClient.SqlConnection(mySqlDataSource1)        Dim myCommand As New Data.SqlClient.SqlCommand("usp_InsertProject", myConnection)        myCommand.CommandType = Data.CommandType.StoredProcedure        Dim parameterGID As New Data.SqlClient.SqlParameter("@RETURN_VALUE", Data.SqlDbType.Int)        parameterGID.Direction = Data.ParameterDirection.ReturnValue        myCommand.Parameters.Add(parameterGID)        Dim reader As Data.SqlClient.SqlDataReader = myCommand.ExecuteReader()        Dim GID As Integer = CInt(parameterGID.Value)        GID.ToString()             ...E-mail code is below this, but is working, so not included ...         End SubI would like to insert the GID variable into the e-mail, but for some reason it won't work. The following error occurs when the InsertCommand is invoked:ExecuteReader requires an open and available Connection. The connection's current state is closed.

View 4 Replies View Related

SQL 2012 :: Adding Required Message Popup To SSRS Home Page

Sep 26, 2014

Our Information Assurance (IA) office wants us to add a warning message popup box to our SQL 2012 SSRS server.The purpose is to force users to acknowledge the warning box popup before they get into to the SSRS main page.The message box would contain text stating Privacy Act information and or DoD monitoring consent...

View 1 Replies View Related

Fail To Get Return_Value In Stored Procedure NullValueReference

Dec 30, 2005

I have a stored procedure that insert into a table and return a value indicating if the insert really occured.If the a insert occurs then it returns the identity of that insert.
I have slimmed down my code here, so you can see.My problem is that a NullValueReference exceptions occurs when trying to reference the returnvalue.Is it not possible to get a return value along with a recordset ?
public int RegisterCustomer(Customer customer)
{
SqlCommand myCommand = new SqlCommand("ins_RegistrerKunde", myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
SqlParameter Epost = new SqlParameter("@Epost", SqlDbType.VarChar, 25);
SqlParameter Passord = new SqlParameter("@Passord", SqlDbType.VarChar, 25);
SqlParameter ReturnValue = new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4);
ReturnValue.Direction = ParameterDirection.ReturnValue;
Epost.Value = customer.Email;
Passord.Value = customer.Password;
myCommand.Parameters.Add(ReturnValue);
myCommand.Parameters.Add(Epost);
myCommand.Parameters.Add(Passord);
myConnection.Open();
SqlDataReader result = myCommand.ExecuteReader(CommandBehavior.SingleRow);
int isRegistered = (int)myCommand.Parameters["@RETURN_VALUE"].Value;
myConnection.Close();
if (isRegistered == 1)
{
result.Read();
return Convert.ToInt32(result["Kunde_ID"]);
result.Close();
}
return Convert.ToInt32(isRegistered);
}
 
//Stored Procedure ins_RegistrerKundecreate procedure %PROC% (@Epost varchar(25), @Passord varchar(25))asbeginIF EXISTS(  SELECT Epost FROM tbl_Kunde WHERE Epost = @Epost)    RETURN 0ELSE    INSERT INTO tbl_Kunde( Epost, Passord)    VALUES (@Epost, @Passord)    SELECT @@IDENTITY AS Kunde_ID    RETURN 1endgo

View 2 Replies View Related

Reporting Services :: Displaying Report Parameter Based On Another Parameter

Aug 10, 2015

I am using report builder 3.0.

I have a report parameter called para1 which is a drop-down list and what I want to do is display another report parameter based on the para1 selection.

So for example, para1 contains a, b, c choices.  if a user selects b, I would like para2 to display but if the user selects a or c, I don't want the para2 to display.

View 5 Replies View Related

Show Data In A Txtbox Based On A Key Passed From The 1st Page

May 16, 2008

On my Home page I have a gridview that has Four columns: CustomerID, Product, Quantity, then a link (which appears on each row..called View). When a user clicks View on a particular row it will then send that particular CustomerID to the next page (CustomerProfile.aspx).
On the CustomerProfile.aspx page I have a textbox where the Customer Name should appear. How do I go about displaying the customer name in the textbox based on the CustomerID passed to the customerprofile.aspx page? Do I need to call a stored procedure? Do i need to call the Customer Table in my code?
(i'm using C#) Thanks!! Ur help is very much appreciated!
Side Note: i am passing the CustomerID by a SESSION variable called customerID ~~~>this is in my pageLoad method labelCustomerID.Text = Session["customerID"].ToString();
but i'm wanting to have the Customer Name in a textbox based on the above ^^^ session variable. My textbox is called txtCustomerName.Text
*** Customer Table***CustomerIDCustomerNameCustomerAddress
^^^wanting to call the customer name and put it in the customer name text box based on the particular customerID

View 22 Replies View Related

Setting Page Break In Matrix Report Based On RowNumer

Mar 17, 2008

Hi,

Do some one has idea how we can create pagebreak in matrix based on RowNumber.Say I have 40 rows in matrix(I don't have group on which I can create a group by setting PAGE BREAK AT THE END)

=ROWNUMBER(NOTHING) MOD 10 = 0 ,TRUE,FALSE

I don't have any distinct value on which I can create Group like

= IIF(Parameters!PageBreak.Value,Fields!CategoryID.Value,1) and setting Page Break At The End


-Thanks,
Digs

View 1 Replies View Related

Reporting Services :: SSRS Reports To Be Displayed In New UI Based Web Page

Aug 5, 2015

I have one requirement. We have one application in banking and they have developer that application using c# and .Net code so For Business Users--when they enter their details and when they want to check Reports--it should take to a another UI or web page where Users will see all the reports--- and clicking the report he/she should be get able to export it into different formats..

i know that we can give report manager URL--but due to various issues-- we have choosen to built a web[age where they can see the reports work-flow:

so--user opens bank site--enters his details-goes into reports--it should open new webpage or UI, he should see all reports--he should export these reports..

After that based upon security levels each user can see their individual reports.

View 2 Replies View Related

Toggle Page Footer Visibility Based On Subreport Being Rendered

Nov 19, 2007

I want to toggle the visibility of a report item in my page footer based on whether or not a particular subreport has been rendered.

The report has 3 subreports. The subreport above the subreport in question can span several pages, so the subreport I want information on can render on page 1 (for a short report) or page 12 (for example) on a longer report.

Is there a way to determine within the main report when a particular subreport has been rendered and is currently visible?

Thanks in advance for all replies.

John

View 4 Replies View Related

SQL 2012 :: SSRS Page Break Based On Start And End Date Parameters

Jul 7, 2015

I have a detailed report in ssrs in which data can come from start date and end date parameters.

but the problem is. for example i gave startdate as 01/01/2015 and end date as 09/31/2015 then the data must be in displayed in such a way that jan month in one tab and feb month data in one tab and sooo on to sep month data in new tab when i export to Excel.

Is this possible in ssrs ?

View 1 Replies View Related

Reporting Services :: Don't Include Last Page Of SSRS Report Based On Parameter

Mar 9, 2015

I created the report, which has 4 pages. Each page contains bunch of tables and charts, which display data in scope of dataset, created for each page and reflecting certain subject. Each page also has Header and Footer.

My users requested, the report has possibility to include or not include data on Page #4.

Other words, report should display 3 or 4 pages based on the entered parameter.

1. I created parameter named  “Include #### metrics”, which contains options: Y, N
2. For each object on the page 4 I added dependency on the selected parameter in  the visibility option.

Now if user select parameter Not include Page #4, report displays 3 pages as expected and page #4 is empty, but with Header and Footer.

The problem: Their preference is to not to show page 4 at all if someone chooses to not to include #### metrics.

My question is how to force the report to display just 3 selected pages.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved