How Can I Post Back A Statement From A Store Procedure To The .aspx Page
Oct 17, 2005
Hi all,Anyone can show me how can I catch the 'Print' statement that I have defined in my store procedure using SQL server 2000 DB on the .aspx page? ( I am using ASP.NET 1.0)My store procedure as follow:CREATE PROC NewAcctType(@acctType VARCHAR(20))ASBEGIN --checks if the new account type is already exist IF EXISTS (SELECT * FROM AcctTypeCatalog WHERE acctType = @acctType) BEGIN PRINT 'The account type is already exist' RETURN END
BEGIN TRANSACTION INSERT INTO AcctTypeCatalog (acctType) VALUES (@acctType)
--if there is an error on the insertion, rolls back the transaction; otherwise, commits the transaction IF @@error <> 0 OR @@rowcount <> 1 BEGIN ROLLBACK TRANSACTION PRINT 'Insertion failure on AcctTypeCatalog table.' RETURN END ELSE BEGIN COMMIT TRANSACTION ENDENDThanks for all your replies
View 10 Replies
ADVERTISEMENT
Sep 21, 2006
Hi, I wanted to know that can we access a webpagefrom a store procedure in sql server 2000 like we run a exe file from sql server. Bye.
View 1 Replies
View Related
Jun 7, 2004
hi , I would appreicate your help, I have created a store procedure in MS sql server 2000 to be called from aspx page.
The store procedure will have multiple functions:
checking if a file exist in c:data
if file exist, it will use zip file command line to unzip the file and then run DTS package to upload the database.
The issue I am having is when I run the store procedure from MS query analyzer,I get a confirmation that the whole procedure ran successfully, but when I call the same procedure from aspx, althought the store procedure ran successfully, but I did not get any confirmation to the user in the aspx page to notify the user that the process successed.... here is my code in where I think is not working,
CREATE PROCEDURE p_on_demand_dts_sales_option_price_report_3_ftest
@id int , @msg_output varchar(28) output
as
declare @varcmd varchar(255),@FileExist int
select @varcmd = null
select @varcmd ='dir :Data_on_demandsales_option_price_report.csv' -- check if file exist
EXEC @FileExist = master..xp_cmdshell @varcmd
set @msg_output = 'The file exists'
Return 44
+++ The above store procedure use command line to check if the csv file exist, its suppose will return a output parameter and a return # BUT it did not. To my surprise, when I modify the above store procedure like this, it work
-----
CREATE PROCEDURE p_on_demand_dts_sales_option_price_report_3_ftest
@id int , @msg_output varchar(28) output
as
set @msg_output = 'The file exists'
Return 44
The second procedure does not do anything, except take input parameter and return a message output and return, this work.
since the second procedure works, it means that the code in aspx is correct, but I have no clue why it does not return output parameter and return # in the first procedure.
I would really appreciate anyone who could help.
thanks
ehx5
View 4 Replies
View Related
May 21, 2004
Hi, I have been searching for an answer to allow me to execute xp_cmdshell from withing store prcedure by calling the store procedure from an aspx via click on a button. This is what I found from my reserch but was not able to know where to set the rights and what each of them means:
"To run xp_cmdshell for a non-system administrator user, you must grant the following rights.
MSSQLServer and SQLServerAgent Services
Act as part of the Operating System.
Increase Quotas.
Replace a process level token.
Log on as a batch job."
The above quote was from the following link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;264155
The bottom line is to be able to call a store procedure from an aspx page to execute the code which contain xp_cmdshell command, an example of such command is like:
------------------------------------------------------------
EXEC master..xp_cmdshell 'dir d:BT_importDatasales_option_price_report.csv'
Thanks for your help
ehx5
View 1 Replies
View Related
Sep 19, 2007
My stored proceddure "My Programs" includes a parameter @meid.How do I code an aspx file to run the procedure with a user ID, e.g. EmpID?I tried the following codes, but the error message indicated it can not findthe Stored Procedure. How do I pass the EmpID as a Stored Procedure parameter?
<%meid = EmpIdcmd.CommandText = "MyPrograms meid"cmd.CommandType = CommandType.StoredProcedurecmd.Connection = sqlConnection2sqlConnection2.Open()reader3 = cmd.ExecuteReader(meid)While reader3.Read()sb.Append(reader3(i).ToString() + "......<BR> <BR /> ")End While%>
TIA,Jeffrey
View 3 Replies
View Related
Nov 7, 2007
Hello, I have the following stored procedure and the following aspx page. I am trying to connect this aspx page to the stored procedure using the SqlDataSource. When the user enters a branch number in textbox1, the autonumber generated by the database is returned in textbox2. I am not quite sure what to do to get this to execute. Can someone provide me assistance? Will I need to use some vb.net code behind?
Stored ProcedureCREATE PROCEDURE InsertNearMiss @Branch Int, @Identity int OUT ASINSERT INTO NearMiss (Branch)VALUES (@Branch)
SET @Identity = SCOPE_IDENTITY()
GO
ASPX Page
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NearMissConnectionString %>" InsertCommand="InsertRecord" InsertCommandType="StoredProcedure" SelectCommand="InsertRecord" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:ControlParameter ControlID="TextBox1" Name="Branch" PropertyName="Text" Type="Int32" /> <asp:ControlParameter ControlID="TextBox2" Direction="InputOutput" Name="Identity" PropertyName="Text" Type="Int32" /> </SelectParameters> <InsertParameters> <asp:Parameter Name="Branch" Type="Int32" /> <asp:Parameter Direction="InputOutput" Name="Identity" Type="Int32" /> </InsertParameters> </asp:SqlDataSource> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
View 2 Replies
View Related
Mar 2, 2004
I have a stored procedure when query a big table about 500,000 records. When I run the stored procedure in the query analyzer, it is very fast and it only takes 2~3 seconds. However, when my aspx page try to call this stored-procedure with a Command's ExecuteReader method like bellow:
SqlDataReader myReader = myCommand.ExecuteReader();
I always get timeout expired exception. I try to set the connection timeout and command timeout to 100 seconds. The exception is gone but the average execution time is about 25 seconds! While the stored-procedure only takes about 2~3 seconds in query analyzer with the same parameter.
What could be the problem?? I tried to figure this out for a couple days but still no clue.
Thanks.
View 8 Replies
View Related
May 5, 2004
Hello,
I have a table which gets updated roughly every 6 seconds with data. I have setup an aspx page with a datagrid to meta tag refresh every 3 seconds.
Because the data sometimes stops for a couple of minutes or even hours, I was thinking of a way to update/refresh the aspx page only when the table data gets entered ( to stop page flickering every 3 seconds).
I was thinking about a stored procedure and using an on update procedure.
Does anyone have any preffered methods or suggestions on the best way to accomplish this task.
I use VB.Net
Thanks
Goong
View 2 Replies
View Related
Mar 14, 2008
Hi,I have a form page with an insert like this:<asp:SqlDataSource ID="addProductDataSource" runat="server" InsertCommand="INSERT INTO test( title1, firstName1, lastName1, dateOfBirth ) VALUES ( @title1, @firstName1, @lastName1 @dateOfBirth )" ConnectionString="<%$ ConnectionStrings:yourQuoteCentreConnectionString %>"> <InsertParameters> <asp:ControlParameter ControlID="dateOfBirth" Name="dateOfBirth" Type="DateTime" /> <asp:ControlParameter ControlID="title1" Name="title1" PropertyName="Text" /> <asp:ControlParameter ControlID="firstName1" Name="firstName1" PropertyName="Text" /> <asp:ControlParameter ControlID="lastName1" Name="lastName1" PropertyName="Text" /> </InsertParameters></asp:SqlDataSource> In default.aspx.vb I have:Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick 'CREATE DATETIME FROM USERS BIRTH DATE Dim dateOfBirth As New System.DateTime(applicantYear.SelectedValue, applicantMonth.SelectedValue, applicantMonth.SelectedValue, 0, 0, 0) 'INSERT TO DATABASE addProductDataSource.Insert()End SubI would like to reference the variable dateOfBirth created in default.aspx.vb in the insert query on the page, or ideally move the insert query into the aspx.vb page. Would this make more sense to do?Thanks,Paul
View 6 Replies
View Related
Apr 12, 2005
Does anyone know how to call a SQL store procedure that return a value to the page?
I've a simple data entry aspx page with several textboxes and a save button. When user fill out the form and click save/submit, it calls a store procedure to insert a row into a SQL table and automatically generate an ID that need to return the the page to display for the user.
Are there a similar article somewhere?
Thank you all!
View 6 Replies
View Related
Jun 9, 2015
I need to run two reports each of A5 Size to run back to page and print on single A4 paper means in 1st half Sale bill will be printed and in second half Gate Pass Will Be Printed both report will be on same page and size and shape should be maintained. How to do it.
View 4 Replies
View Related
Nov 25, 2007
I have developed a report in which I have two date parameters. when I deploy the report and view the report
I can see that for each date selection it is going for a postback. could you please advice me how can I solve this issue.
View 4 Replies
View Related
Dec 6, 2007
Is it possible to do something like this?
SELECT * from (
exec Store_Procedure
)
--StartDate is a column from "Store_Procedure"
where StartDate >= @Param
View 3 Replies
View Related
Sep 28, 2007
I'm trying to do this:
CREATE PROCEDURE [dbo].[spStoryDisplay]
-- Add the parameters for the stored procedure here
@clsYear int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT *, "Class Year" =
CASE
WHEN year1 >= 1940 AND year1 < 1950 THEN '1940s'
WHEN year1 >= 1950 AND year1 < 1960 THEN '1950s'
WHEN year1 >= 1960 AND year1 < 1970 THEN '1960s'
WHEN year1 >= 1970 AND year1 < 1980 THEN '1970s'
WHEN year1 >= 1980 AND year1 < 1990 THEN '1980s'
WHEN year1 >= 1990 AND year1 < 2000 THEN '1990s'
WHEN year1 >= 2000 AND year1 < 2010 THEN '2000s'
END
FROM dvlStory
WHERE "Class Year" = @clsYear
ORDER BY lstName ASC
END
I kept getting this error:
Msg 207, Level 16, State 1, Procedure spStoryDisplay, Line 27
Invalid column name 'Class Year'.
So, my question is, how do I compare to the additional column "Class Year" to the parameter?
View 13 Replies
View Related
Nov 22, 2006
Hi can someone help me?
I'm using Access database and Microsoft VS2005 (VB)
I need to take data from 2 different tables in 1 database. But i can't seems to get it right!
I have: - dbWarehouse.mdb- tblReadDetails and tblStock
I need to use "Barcode" from tblReadDetails, compare it with "Barcode" in tblStock then retrieve all the column in tblStock and put it in a webpage.aspx list box.
I tried the following code...cn.ConnectionString = strConncn.Open()cmd = New OleDbCommand("SELECT tblStock.Barcode, tblStock.Item, tblStock.Dept, tblReadDetails.Barcode FROM tblStock JOIN tblReadDetils WHERE tblReadDetails.Barcode = tblStock.Barcode", cn)dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)While dr.Read()lstBarcode.Items.Add(dr2.Item("tblStock.Barcode"))lstItem.Items.Add(dr2.Item("tblStock.Item"))lstDept.Items.Add(dr2.Item("tblStock.Dept"))End While
but it prompt me the following error...
OleDbException was unhandled by user codeSyntax error in FROM clause
What's wrong with this code?
Regards and thanks!
View 2 Replies
View Related
Mar 12, 2004
Hi,
like subject, is it possible?
bye
View 3 Replies
View Related
Mar 4, 2005
Hi guys,
Being new to ASP.NET, I may be asking something that is dead simple, but please bear with me!
How would I go about listing all the tables, stored procedures and views from a SQL database within an aspx page? I understand how to connect and return a dataset etc, but that's about as far as I can get. I want to be able to list all of these objects from a given db - any ideas?
Additionally (this may not be possible) - is there a way I can list all of the objects within a visual studio.net solution, again within an aspx page?
Thanks for any help,
Jon
View 2 Replies
View Related
Sep 3, 2007
Hi all,
I am trying to use session in my asp.net in moss but i got the error below, eventhough i have set web.config file to enableSessionState="true" and include €œSystem.Web.SessionState.SessionStateModule". Have i miss anything? thanks
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \ section in the application configuration.
=================
this is what i have set.
<pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">
<namespaces>
<remove namespace="System.Web.UI.WebControls.WebParts" />
</namespaces>
<tagMapping>
<add tagType="System.Web.UI.WebControls.SqlDataSource, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mappedTagType="Microsoft.SharePoint.WebControls.SPSqlDataSource, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
</tagMapping>
</pages>
<httpModules>
<clear />
<add name="Session" type="System.Web.SessionState.SessionStateModule" />
View 3 Replies
View Related
May 8, 2008
I want to create store procedure which will print out something like this:
Insert into [dbname].dbo.[gameBooks] value (@gameBookID, gameBookTitle, ganeVolumn)
But first one print out good, as I expected. I either got nothing or the error message on second piece.
Msg 245, Level 16, State 1, Line xxx
Conversion failed when converting the varchar value 'Insert into [dbname].dbo.[cookBooks] value (' to data type int.
Any Help will be greatly appreciated.
on SQL 2005 SP1.
Here is my example code (not the real one):
Create Procedure [dbo].[makeNewString]
@myBookID
As
Declare bookID int
Declare newRowID int
Declare insertBookInfoString nvarchar(150)
select 'Declare @newBookID int'
Set insertBookInforString =
(Select 'Insert into [dbname].dbo.[gameBooks] value (' + @gameBookID + ',' + gameBookTitle +',' + ganeVolumn +')'
from [dbname].dbo.[gameBooks])
where @gameBookID=@myBookID
Print insertBookInforString
select 'SET @newRowID = Scope_Identity()'
print @newRowID
select 'Declare @newBookID int'
Set insertBookInforString =
(Select 'Insert into [dbname].dbo.[cookBooks] value (' + @cookBookID +',' + cookBookTitle +','+cookVolumn+')'
from [dbname].dbo.[cookBooks]
where @cookBookID=@myBookID)
Print insertBookInforString
first insertBookInfoString prints out fine.
But I kept this error on second part:
------------------------------
DECLARE Declare @newBookID int
(1 row(s) affected)
Insert into [dbname].dbo.[gameBooks] value (@gameBookID, gameBookTitle, ganeVolumn) (this is what I want)
-----------------------------------------
SET @newBookID = Scope_Identity()
(1 row(s) affected)
Msg 245, Level 16, State 1, Line xxx
Conversion failed when converting the varchar value 'Insert into [dbname].dbo.[cookBooks] value (' to data type int.
View 1 Replies
View Related
Jan 11, 2008
Hi,
It seems to be a logical problem. When I want to do an update of new data inserted in my aspx-page I can type in and start the updating.After the processing it jumps back on the resultpage but I notice that there was not update be done. What can be the problem.
Here the code of my aspx-page:
<%@ Page Language="VB" MasterPageFile="~/AdminMaster.master" AutoEventWireup="false" CodeFile="news.aspx.vb" Inherits="admin_news" title="Untitled Page" %><asp:Content ID="Content1" ContentPlaceHolderID="mainCopy" Runat="Server"> <br /> <h1> News bearbeiten</h1> <p> <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False" CellPadding="4" DataKeyNames="ID" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" Height="50px" Width="600px"> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" /> <EditRowStyle BackColor="#2461BF" /> <RowStyle BackColor="#EFF3FB" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <Fields> <asp:CommandField /> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" /> <asp:TemplateField HeaderText="Datum" SortExpression="Datum"> <EditItemTemplate> <asp:TextBox ID="ArtikelID" runat="server" Text='<%# Bind("Testfeld1") %>'></asp:TextBox> </EditItemTemplate> <EditItemTemplate> <asp:TextBox ID="datumTextbox" runat="server" Text='<%# Bind("Datum") %>'></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="datumTextbox" runat="server" Text='<%# Bind("Datum") %>'></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("Datum") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Header" HeaderText="Header" SortExpression="Header" /> <asp:TemplateField HeaderText="Überschrift D"> <EditItemTemplate> <asp:TextBox ID="ArtikelID" runat="server" Text='<%# Bind("ArtikelID") %>'></asp:TextBox> </EditItemTemplate> <EditItemTemplate> <asp:TextBox ID="EditHeaderD" runat="server" Height="35px" Width="150px"></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="InsertHeaderD" runat="server" Height="35px" Width="150px"></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="headerD" runat="server" Height="35px" Text="Label" Width="150px"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Überschrift E"> <EditItemTemplate> <asp:TextBox ID="EditHeaderE" runat="server" Height="35px" Width="150px"></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="InsertHeaderE" runat="server" Height="35px" Width="150px"></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="headerE" runat="server" Height="35px" Text="Label" Width="150px"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Text D"> <EditItemTemplate> <asp:TextBox ID="EditTextD" runat="server" Height="35px" Width="400px"></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="InsertTextD" runat="server" Height="35px" Width="400px"></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="TextD" runat="server" Height="35px" Text="Label" Width="400px"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Text E"> <EditItemTemplate> <asp:TextBox ID="EditTextE" runat="server" Height="35px" Width="400px"></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="InsertTextE" runat="server" Height="35px" Width="400px"></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="TextE" runat="server" Height="35px" Text="Label" Width="400px"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" /> </Fields> <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="White" /> </asp:DetailsView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connpferde %>" DeleteCommand="DELETE FROM [News_Kultur] WHERE [ID] = @ID" InsertCommand="INSERT INTO [News_Kultur] ([ArtikelID], [NewsID], [Header], [Ueberschrift_D], [Ueberschrift_E], [Text_D], [Text_E], [Datum]) VALUES (@ArtikelID, @NewsID, @Header, @Ueberschrift_D, @Ueberschrift_E, @Text_D, @Text_E, @Datum)" SelectCommand="SELECT * FROM News_Kultur LEFT JOIN News ON News_Kultur.NewsID = News.ID;" UpdateCommand="UPDATE News SET Datum = @Datum WHERE ID=@NewsID"> <DeleteParameters> <asp:Parameter Name="ID" Type="Int16" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="ArtikelID" Type="Int16" /> <asp:Parameter Name="NewsID" Type="Int32" /> <asp:Parameter Name="Header" Type="String" /> <asp:Parameter Name="Ueberschrift_D" Type="String" /> <asp:Parameter Name="Ueberschrift_E" Type="String" /> <asp:Parameter Name="Text_D" Type="String" /> <asp:Parameter Name="Text_E" Type="String" /> <asp:Parameter Name="Datum" Type="DateTime" /> <asp:Parameter Name="ID" Type="Int32" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="Header" Type="String" /> <asp:Parameter Name="Ueberschrift_D" Type="String" /> <asp:Parameter Name="Ueberschrift_E" Type="String" /> <asp:Parameter Name="Text_D" Type="String" /> <asp:Parameter Name="Text_E" Type="String" /> <asp:Parameter Name="Datum" Type="DateTime" /> </InsertParameters> </asp:SqlDataSource> </p></asp:Content>and here for completion the code of my codebehindpage:
Imports Microsoft.VisualBasicImports SystemImports System.DataImports system.Data.SqlClientImports System.WebImports System.XmlPartial Class admin_news Inherits System.Web.UI.Page Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles DetailsView1.DataBound If DetailsView1.CurrentMode = DetailsViewMode.Insert Then DirectCast(DetailsView1.FindControl("datumTextbox"), TextBox).Text = Now End If If DetailsView1.CurrentMode = DetailsViewMode.Edit Then DirectCast(DetailsView1.FindControl("datumTextbox"), TextBox).Text = Now End If End Sub 'Prozedur wird bei Update ausgeführt Public Sub DetailView1_ItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdatedEventArgs) Handles DetailsView1.ItemUpdated If Not IsDate(e.NewValues("Datum")) Then Exit Sub End If Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("connpferde").ConnectionString) conn.Open() Dim cmd As New SqlCommand cmd.Connection = conn cmd.CommandText = "UPDATE News_Kultur SET Header = @Header,Ueberschrift_D=@Ueberschrift_D,Ueberschrift_E=@Ueberschrift_E,Text_D=@Text_D,Text_E=@Text_E JOIN News_Kultur.NewsID=News.ID WHERE News_Kultur.ID=@ArtikelID " cmd.Parameters.Add(New SqlParameter("@ArtikelID", e.NewValues("ArtikelID"))) cmd.Parameters.Add(New SqlParameter("@Header", e.NewValues("Header"))) cmd.Parameters.Add(New SqlParameter("@Ueberschrift_D", e.NewValues("Ueberschrift_D"))) cmd.Parameters.Add(New SqlParameter("@Ueberschrift_E", e.NewValues("Ueberschrift_E"))) cmd.Parameters.Add(New SqlParameter("@Text_D", e.NewValues("Text_D"))) cmd.Parameters.Add(New SqlParameter("@Text_E", e.NewValues("Text_E"))) End SubEnd Class
RegardsRuprecht Helms
www.rheyn.de
View 5 Replies
View Related
Dec 16, 2003
Dear i am using visual studio.net.......... when i connect database (in sqlserver) using sqldataAdapter with datagrid in visual basic.net every thing work properly........... but when i use the same in asp.net then i get an error message on the resultant explorer page give below.
Server Error in '/studentData' Application.
--------------------------------------------------------------------------------
Login failed for user 'RAMIZSARDARASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'RAMIZSARDARASPNET'.
Source Error:
Line 85: 'Put user code to initialize the page here
Line 86: Dim ds As New DataSet()
Line 87: SqlDataAdapter1.Fill(ds)
Line 88: DataGrid1.DataSource = ds.Tables(0)
Line 89: DataGrid1.DataBind()
Source File: c:inetpubwwwrootstudentDataWebForm1.aspx.vb Line: 87
Stack Trace:
[SqlException: Login failed for user 'RAMIZSARDARASPNET'.]
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
studentData.WebForm1.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootstudentDataWebForm1.aspx.vb:87
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0
Plz solve my problem and Reply me on ramiz_ch@hotmail.com
Plz solve my problem and Reply me on ramiz_ch@hotmail.com
Plz solve my problem and Reply me on ramiz_ch@hotmail.com
Ramiz
View 1 Replies
View Related
Jun 23, 2008
hi to all,
I am using Sql server reporting services.When i have create a report .rdl file and deploy it on Report server and than display that report on my application's .aspx page in pdf format using web services , every thing is perfactly working in my senario at the starting time but now i faced a problem with that. When record goes more than 2000 (in my senario a single record disply in a one report pdf page means for 2000 record in table that means its display in 2000 pdf page as with next forward option of pdf view),So in that cas it doesn't work, did now show any report and give the error as
ex.Message"Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
The request failed with the error message:
--
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Server Unavailable
</title>
</head>
<body>
<h1><span style="font-family:Verdana;color: #ff3300">Server Application Unavailable
</span></h1>
<p>
<span style="font-family:Verdana;">
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.
</span></p>
<p>
<b>Administrator Note:
</b> An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
</p>
</body>
</html>
--."string
Any body have any idea please help me as soon as possible.
urgently--- any help will be appriciate.
thanks in advance.
arvind
View 1 Replies
View Related
Nov 5, 2007
Hi
How to bring Report builder in the Ui of .net aspx pages?
I tryed withe the .exe but it is comming with a new process and come up with new IDE of Report builder, i donot required this,
I want it should come up within the Aspx page itself.
any input will be helpfull for me.
regrads
Bibek
View 1 Replies
View Related
Jul 13, 2007
I created a report with a parameter. The parameter was created using a dataset in the report designer. This works fine. I deployed the report (webhost4life) and the report runs fine in the report manager. I am able to select my casenumber click on the default view report button and it works.
Problem: I embedd the report into an aspx page frmReports1.aspx. I call this page from another page (form). the frmReports.aspx page comes up and displays the default drop down list box with the casenumbers (fine). I select the casenumber and click on the view report button and NOTHING. I here the postbacks taking place but all that happens is the default value appears in the drop down list box and the toolbar shows. I checked permissions and everything is fine. I searched the forum and thought i found the solution with the inLine HTML and Async (still nothing) I can only think that something is not going right with the parameter. Here is my html, and code behind code. any help would be greatly apprcieated.
Zachary
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="frmReports1.aspx.vb" Inherits="frmReports1" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style>html,body,form {height:100%}</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<rsweb:ReportViewer ID="rvTest" runat="server" Width="600px" ProcessingMode="Remote" AsyncRendering="false" Height="75%" >
<ServerReport
DisplayName="Billable Hours"
ReportPath="/sddmtech/SnowandIce/rptHoursWorked"
ReportServerUrl="http://sqlreport01.mysite4now.com/Reportserver" />
</rsweb:ReportViewer>
</div>
</form>
</body>
</html>
aspx code behind
Imports System.Net
Imports System.Security.Principal
Imports Microsoft.Reporting.WebForms
Partial Class frmReports1
Inherits System.Web.UI.Page
Protected Sub rvTest_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles rvTest.Init
End Sub
<Serializable()> _
Public NotInheritable Class MyReportServerCredentials
Implements IReportServerCredentials
Public ReadOnly Property ImpersonationUser() As WindowsIdentity _
Implements IReportServerCredentials.ImpersonationUser
Get
Return Nothing
End Get
End Property
Public ReadOnly Property NetworkCredentials() As ICredentials _
Implements IReportServerCredentials.NetworkCredentials
Get
' Put your login and password here this works fine
Dim userName As String = ""
Dim password As String = ""
Dim domain As String = ""
Return New NetworkCredential(userName, password, domain)
'********************************************************************************
End Get
End Property
Public Function GetFormsCredentials(ByRef authCookie As System.Net.Cookie, ByRef userName As String, ByRef password As String, ByRef authority As String) As Boolean Implements Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials
End Function
End Class
Public Function GetFormsCredentials(ByRef authCookie As Cookie, _
ByRef userName As String, _
ByRef password As String, _
ByRef authority As String) _
As Boolean
authCookie = Nothing
userName = Nothing
password = Nothing
authority = Nothing
'Not using form credentials
Return False
End Function
Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load
'ReportViewer1.ServerReport.ReportServerCredentials = New MyReportServerCredentials()
'rvTest.ServerReport.Refresh()
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
rvTest.ServerReport.ReportServerCredentials = New MyReportServerCredentials()
End Sub
End Class
View 6 Replies
View Related
Mar 25, 2008
I am needing to export some files in landscape when I select the PDF option in the dropdown on the ReportViewer.aspx page. How do I do this?
View 1 Replies
View Related
Oct 19, 2007
Hi All...
Can anyone please help with embedding a chart into an aspx page ?? I have been busy with that for some time now, and still cant figure it out...
Thanks...
View 1 Replies
View Related
May 28, 2014
There are about 10 select statements in a store procedure.
All select statements are need.
Is it possible to output only the result of last select statement?
View 2 Replies
View Related
Dec 13, 2007
How do you use data from a select statement as inputs for a store procedure?
e.g.
Code Block
Select FirstName, LastName from Student where Grade = 'A'
And I want to use all the FirstName and LastName as inputs for this store procedure
Code Block
Exec StudentOfTheMonth @FirstName = FirstName, @LastName = LastName
Thanks
View 21 Replies
View Related
Apr 27, 2007
I am developing an application using Visual Web Designer (language VB) with a SQL Server 2000 back end.
Within my logic I have a point where I want to say "Run SQL procedure GEDFinish". GEDFinish can take several minutes, and I don't need to wait for it's results - it would be fine if it ran overnight. I can easily check whether GEDFinish has run from the database, in situation where my application logic needs to know if it has already run.
Currently I only know how to run a procedure under the direct control of my web program, but with GEDFinish this fails due to timeouts. (This will be worse in the production site). What I really want to do is to have my web program submit "Exec GEDFinish" to the SQL agent, and then forget about it. It would be even better if I could build a script for the SQL agent, for example "EXEC GEDFinish Parameter=7"
Help! How do I do this?
Thanks, Robert Barnes
View 6 Replies
View Related
Mar 2, 2006
hello all
pls tell me
how can i insert, retrieve date from ASPX(vs2003) page in table in sql server 2000??
i m in trouble
pls help me
View 1 Replies
View Related
Jul 20, 2005
Hello,I stuck in a delimma.Where to put the business logic that involves only one updatebut N number of selects from N tables........with N where conditions
View 5 Replies
View Related
Nov 20, 2007
Hello,
I am trying to embed a Reporting Services Report in a aspx page. I have the report embedded in the page but I am having difficulty passing a parameter to the report and getting the report to run within the page. Any information is appreciated.
Thanks!
View 4 Replies
View Related