Web Forms :: Accessing Stored Procedure Of SQL Server From Popup Window?
Sep 26, 2010
I have a parent window parent.aspx and a popup window
popup.aspx. parent.aspx
has a confirm button which on click open popup.aspx. This popup.aspx holds a filled application form like leave application form of employees and a email sending button. That button on click send emails to the specified email addresses with attachment. The popup.aspx has a javascript function sendResponse() which call another javascript function display() of parent.aspx after sending the email. The display() function display a message by Label control regarding the email sending i.e., whether or not this email sending operation is successful. The sendResponse() function after calling display() close the popup.aspx window. I have successfully did all the aforesaid jobs.
Now the scenario is that I have a database which is holding various leave information like casual leave, medical leave etc of employees. After sending email successfully I have to update this database.It will be better to tell in this context that the email sending portion of my cs script is :
[Code]....
this info string is passed to the sendResponse() javascript function as :
[Code]....
And the sendResponse() function is :
[Code]....
Now the problem is, in which portion or when I do update the database. Should I update the database in try-catch block of email sending or from sendResponse() function?I have tried to call C# function UpdateDatabase() from sendRespose() as shown here. But this static method is creating too many problems like the popup.aspx is not closing automatically, if I try to call another C# non-static method from the static UpdateDatabase() method to close the window I have to call it by creating a new instance of that page, which is eventually not closing the popup window. Can I call stored procedure from javascript function sendResponse() and pass parameters to it? If so how can I call it?
View 3 Replies
Similar Messages:
Feb 15, 2011
I am using a master page in my project. I opened a popup window from content page. What I want to do is, when I close the popup window, the data in the textbox available in popup should be assigned to a text box in parent form. But I dont want to refresh the parent window when I close the popup window. Can any one tell me how can I access textbox in a parent window from a popup window without refreshing the screens.
View 3 Replies
Jul 23, 2010
I'm still trying to deploy this site, but with every problem I solve, another arises. Anyways - I've set up the database at my hosting to allow remote connections, and it is running Sql Server 2005. On my development machine, I am working with Sql Server 2008.
I've installed the asp.net schema on my hosted database, and have created several users from the ASP.NET web administration interface, as well as tested that the login works. Running the application locally with the remote connection string nets the same results. However - I'm able to run my scripts and generate my tables and stored procedures without errors - but when the site is run I get the following error on all of my .aspx pages that try to access a stored procedure:
Server Error in '/' Application. Incorrect syntax near 'LoadProfileData'. Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'LoadProfileData'.
Source Error:
Line 62: adapter.SelectCommand.Parameters.Add("@ProfessionalName", SqlDbType.VarChar).Value = professionalName;
Line 63: DataSet profile = new DataSet();
Line 64: adapter.Fill(profile, "Profile");
Line 65: return profile;
Line 66: }
Is this a possible Sql 2005 vs 2008 issue? I'm hoping someone else has seen this issue in a similar scenario and can point me in the right direction. The server is running asp.net 2.0, 3.0 and 3.5 and IIS 7.0.
View 1 Replies
Jan 28, 2011
I could probably figure this out if I tried to, but I have been working so long on code, I'm a little fried
I have a stored procedure, and I want to execute another stored procedure during a time period of lets say 1/1/2011 to 12/31/2011
How Would I accomplish this?
View 4 Replies
Jun 2, 2010
how to execute a sub procedure when returning a value from a popup window?
Ex.
in my parent form, this is the sub procedure i made SearchRecord(), after selecting a record from a child form (popup window), the SearchRecord() from parent form will execute..
View 5 Replies
Oct 1, 2010
I have created stored procedure and student database and also asp.net application for asp.net page but it could not found stored procedure what is the mistake actually I don't no
View 7 Replies
Nov 23, 2010
how can I create stored procedure and write my select statement in it, I know how to create dataset then put type stored procedure and assign it to the sp ... what I want is writing my sp... how can I make it ?
check the following code, this is what I want to write put I don't know where or how !
CREATE STORED PROCEDURE SP_CATEGORY
@CATEGORY VARCHAR(30)
AS
BEGIN
SELECT LATIN_NAME, ENGLISH_NAME, ARABIC_NAME, CATEGORY
FROM FLORA, CATEGORY_LIST
WHERE FLORA.CATEGORY=CATEGORY_LIST.CATEGORY_NAME AND CATEGORY_LIST.CATEGORY_NAME IN (SELECT * FROM SPLITLIST(@CATEGORY, ','))
END
where can I write this code ?!
View 5 Replies
Jul 21, 2010
I'm programming a webpage in ASP.NET which displays a list of students not listed as participants in something, and upon clicking a student name shows you a brief summary of their details, so the user can ensure they're selecting the right person.
My code currently correctly obtains their ID, adds it as a parameter to my stored procedure and executes the procedure;
[code]....
However, when I try to access the results I get the following error:
System.NullReferenceException: Object reference not set to an instance of an object.
Upon debugging, there don't seem to be any results returned... but when running just the stored procedure in SQL Server with the same data, it does return a single row, as expected.
How do I access this result so I can bind it to my fields?
(I am working in ASP.NET 3.5 in Visual Studio 2008, with SQL Server 2008.)
View 2 Replies
Jul 27, 2010
I'm programming a webpage in ASP.NET which displays a list of students not listed as participants in something, and upon clicking a student name shows you a brief summary of their details, so the user can ensure they're selecting the right person. Each student is identified by a unique ID.
My code currently correctly obtains their ID, adds it as a parameter to my stored procedure and executes the procedure;
[Code]....
However, when I try to access the results, with say dv.Table.Rows[0], I get the following error:
[Code]....
Upon debugging, there don't seem to be any results returned... when running just the stored procedure in SQL Server with the same data, it does return a single row, as expected.
View 2 Replies
Apr 2, 2010
I wrote a stored procedure call with the format:
bool isValid=true;
using (OracleConnection myConn = new OracleConnection(connectionString))
{
OracleCommand myCmd = new OracleCommand("sproc", myConn);
myCmd.CommandType = CommandType.StoredProcedure;
myCmd.Parameters.AddWithValue("p1", a1);[code].....
Second format just doesn't feel right but I am not that experienced. I am curious if there is any downfall to that other than exception not being type specific.
View 4 Replies
Jul 23, 2010
I'm still trying to deploy this site, but with every problem I solve, another arises. Anyways - I've set up the database at my hosting to allow remote connections, and it is running Sql Server 2005. On my development machine, I am working with Sql Server 2008.
I've installed the asp.net schema on my hosted database, and have created several users from the ASP.NET web administration interface, as well as tested that the login works. Running the application locally with the remote connection string nets the same results. However - I'm able to run my scripts and generate my tables and stored procedures without errors - but when the site is run I get the following error on all of my .aspx pages that try to access a stored procedure:
Server Error in '/' Application. Incorrect syntax near 'LoadProfileData'. Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'LoadProfileData'.
Source Error:
Line 62: adapter.SelectCommand.Parameters.Add("@ProfessionalName", SqlDbType.VarChar).Value = professionalName;
Line 63: DataSet profile = new DataSet();
Line 64: adapter.Fill(profile, "Profile");
Line 65: return profile;
Line 66: }
Is this a possible Sql 2005 vs 2008 issue? I'm hoping someone else has seen this issue in a similar scenario and can point me in the right direction. The server is running asp.net 2.0, 3.0 and 3.5 and IIS 7.0.
Stored Procedure:
Drop procedure CreateDefaultProfile
GO
Create procedure CreateDefaultProfile(@UserName varchar(256))
as
declare @ProfessionalID uniqueidentifier
[Code].....
View 3 Replies
Sep 1, 2010
I am trying to create the following stored procedure in sql server Lat and Lng are the parameters being passed from c# code behind .But I am not able to create this stored procedureit indicates with error saying undefined column name Lat,Lng
CREATE FUNCTION spherical_distance(@a float, @b float, @c float)
RETURNS float
AS
BEGIN
RETURN ( 6371 * ACOS( COS( (@a/@b) ) * COS( (Lat/@b) ) * COS( ( Lng/@b ) - (@c/@b) ) + SIN( @a/@b ) * SIN( Lat/@b ) ) )
END
sqlda.SelectCommand.CommandText = "select *, spherical_distance( Lat, 57.2958, Lng) as distance
from business
[code]...
View 1 Replies
Apr 2, 2010
This is surareddy. i nead some small clarification in the "Stored Procedure"
how to convert the oracle Stored Procedure to sqlserver2005/2008 Stored Procedure.
right now i am enhancing the project that project already developed the oracle Stored Procedure. now our company is using sqlserver 2005/2008.
how to convert the Oracle Stored Procedure to sqlserver 2005 Stored Procedure
View 4 Replies
Dec 9, 2010
Initially, I have tried to use stored procedure. But I changed my mind and preferred to call sql query in codebase with command text. However, it stills tries to find initially-called stored procedure (which is neither called or exists).I think that it is related caching. But I tried it with different browsers it did not work.What might be the reason?
View 4 Replies
May 17, 2012
ClientScript.RegisterStartupScript(this.Page.GetType(), "", "window.open('Print.aspx','Print','scrollbars=yes,height=400,width=900');", true);
i have the above line executed on a button click but the page does not seem to appear
View 1 Replies
Jan 5, 2011
I open a popup window by client code. Now I want to do some calculation on this popup window & if it success then I want to save the calculation result in a session variable and close the window. I mean I want to click a button on popup window, it will do some calculation on server side and if it success the it will store the calculation result in a session variable and close the popup window.
View 6 Replies
Jan 18, 2010
Does anybody if it is possible that a stored procedure returns rows which is the result of the execution of another sp? Something like..
[Code]....
View 11 Replies
May 13, 2010
i want to return output parameter from 1 storeprocedure. into another stored procedure.
View 7 Replies
Sep 25, 2010
I am trying to return true or false from popup window to the parent window. Actually the parent window has a button control, which on click popup another window. The popup window holds some emailing data and a button "send". This "send" button onclick send email. Now I want to return true if the email is successfully sent otherwise false, to the parent window. Depending on returning value a label present on parent window displays a text message. But I am not able to implement it. Because it might happen that the popup window is blocked by web-browsers popup blocker or popup window is accidentally closed by user. So how can I confirm to parent window whether or not the email is successfully sent?
View 5 Replies
Nov 17, 2010
i have a page Parent.aspx,, and this is responsible to open the window as a model dialog(model.apsx). model.apsx has OK button when we click on this button then server side method called to save the data. while saving the data it return the id of saved data. i need this id on my Parent.aspx.Cs file, so how can i get this id on my Parent.aspx.cs file?
View 5 Replies
Mar 10, 2011
I have a login page that is loaded in popup window (colorbox) and after user logs in it should be closed and parent window should be loaded with new page.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Do While reader.Read()
If Trim(reader("ZAP").ToString()) = Trim(textBoxZap.Text) Then
Session("A") = "1"
Response.Redirect("~/default.aspx")
Else
lblErr.Text = "incorect"
End If
Loop
So once the buton is clicked and user name and password is corect popup window should be closed and user redirected to default aspx.
View 1 Replies
Apr 28, 2010
I am trying to open a popup window from main window using window.open() method. How to get back the value from the called popup window to the calling window in vb.net, basically i need to get back the value and populate in the text box available in the main window.
View 3 Replies
Apr 29, 2010
I have a page wich opens a popup window. I want to pass some variables, like some textbox.text and 2 dataTables from parent window to the popup window. And then I'll have to return some vars from popup window to parent window. So what is the best way to do this,
1) using Sessions("")
or
2)passing the variables as parameteres:
LinkButton1.Attributes.Add("onclick", "window.open('popup.aspx?field1=" & value1 & "&field2=" & value2 & ......
I don't know if it's appropiated passing 8 or 10 variables as the option2 because the user will see a very long url with all the variables, but maybe is more efficient than using Sessions.... Anyway, could somebody clear me up?
View 12 Replies
Nov 27, 2010
Server Error in '/staff' Application. Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'. 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: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'. Source Error:
[Code]....
Stack Trace:
[Code]....
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
View 31 Replies
Oct 29, 2010
I am trying to create a stored procedure that filters data from sql server by date but i get this error:
Conversion failed when converting datetime from character string.
my stored procedure is like:
[Code]....
the parameters are passed to the stored procedures as dateTime variables from c# code...
View 10 Replies