Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Friday, March 30, 2012

Remove Grand Total in Pivot Table issue using asp.net

Hi,

I am trying to remove the grad total amount from the pivot table list with asp.net,programing. The data I called from cube, I have rows,columns and data axis values, when I place my measure in to data axis it autometically created sub total and grand totals, I want remove those. I could not found any property or method to remove that.

Please help me on this.

Hi Please help, I still not got any answer.

Friday, March 23, 2012

Remotely Executing a Stored Proc

I have an ASP page that executes a stored procedure on the local SQL Server instance, but I need that stored proc to execute another stored proc on a remote server. Basically, proc A on server 1 executes and passes a parameter to proc B on server 2. Is there a way to do this without linking server 2?
TIAPlease take a look at the linked server functionality. This allows you to execute a distributed query or call a remote stored procedure.

Tuesday, March 20, 2012

Remote SQL admin across the internet

Hi,

What is a secure way or accepted method to make database changes,IE: edit tables, add sprocs. ect. on a server being ran by an ASP.NET hosting service across the internet?

Thank you
-heywadeYou should check out theData Access Security section of "Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication" in Microsoft's Patterns & Practices series.

Terri|||Thanks Terri,

That is a great artical. Alot of that is out of My control though. An ASP.NET hosting service said that I would use Enterprize manager to admin My "would be" database across the internet. They didn't mention using SSL, also the use of IPSec wouldn't work on My end with NAT. So I guess I'll have to follow up with them. I didn't know the SSL would work with an SQL server...cool.

Thanks again
-heywade

Monday, March 12, 2012

Remote Report Server 2005 using the reportviewer control - parameter problem

I am using an asp.net web page (C#) to access a remote Report Server via the reportviewer contol. After solving the credentials issues, all of my test reports seem to run very nicely if there is no parameter input. When a parameter report is executed, the text box for parameter input is displayed. When the parameter is entered and the View Report button is pressed, the report is NOT Returned. If I go directly to the remote Report Manager and run the report (IE no code behind), it runs as it is supposed to. I've also run the report (web page) on my local report server and it displays the report after the parameter has been input. Why is the remote report server not returning the report after the parameter is input?

Thanks,

John

This problem has been resolved. The page will not work if the "ReportViewer1.ServerReport.ReportServerCredentials = new MyReportServerCredentials();" statement is placed in the Page_Load event.

Here are the steps taken to eliminate the problem:

1. Remove the credentials statement from the Page_Load event.

2. Place this code in the Page_Load event

if (!Page.IsPostBack)
{
ReportViewer1.Visible = false;
}

3. Place a button on the page to display the report.

4. Move all report statements to the push button event. Make sure to include "ReportViewer1.Visible = true"

It now works like a champ and I am happy!

Thanks,

John

Remote Procedure Call Failed

Hi,
We are running IIS 4 under NT Server 4.0 Server, Serice pack 3; SQL
Server 6.5, Service Pack 3 and ASP 2.0, for our development databases.
We recently upgraded to IIS 4 and since then we keep getting thid
Remote Procedure error.
The exact error reads:
The server has reached the maximum recovery limit for the application
during the processing of your request. Please contact the server
administrator for assistance.
The next message that comes up is:
Server Application Error
The server has reached the maximum recovery limit for the application
during the processing of your request. Please contact the server
administrator for assistance.HTTP/1.1 500 Server Error Server:
Microsoft-IIS/4.0 Date: Mon, 29 Mar 1999 22:09:57 GMT Connection:
close Content-Type: text/html Content-Length: 93 The remote procedure
call failed.
We keep rebooting the server but this error persists. I can't find
anything that points to what can be causing this.
Has anyone else come across this problem?
Thanx in advance,
-=lata=-Lata,
1. Does this error happen only on the IIS? At the time of error, are you
able to use Query analyser and enterpirse manager and other client
connections to connect to sql server?
2. When you say you rebooted the server, is it the IIS server or the sQL
Server or the Windows server?
If other sql server applications and client connections are running fine,
then it could be an IIS issue.
Thanks,
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.

Remote Procedure Call Failed

Hi,
We are running IIS 4 under NT Server 4.0 Server, Serice pack 3; SQL
Server 6.5, Service Pack 3 and ASP 2.0, for our development databases.
We recently upgraded to IIS 4 and since then we keep getting thid
Remote Procedure error.
The exact error reads:
The server has reached the maximum recovery limit for the application
during the processing of your request. Please contact the server
administrator for assistance.
The next message that comes up is:
Server Application Error
The server has reached the maximum recovery limit for the application
during the processing of your request. Please contact the server
administrator for assistance.HTTP/1.1 500 Server Error Server:
Microsoft-IIS/4.0 Date: Mon, 29 Mar 1999 22:09:57 GMT Connection:
close Content-Type: text/html Content-Length: 93 The remote procedure
call failed.
We keep rebooting the server but this error persists. I can't find
anything that points to what can be causing this.
Has anyone else come across this problem?
Thanx in advance,
-=lata=-
Lata,
1. Does this error happen only on the IIS? At the time of error, are you
able to use Query analyser and enterpirse manager and other client
connections to connect to sql server?
2. When you say you rebooted the server, is it the IIS server or the sQL
Server or the Windows server?
If other sql server applications and client connections are running fine,
then it could be an IIS issue.
Thanks,
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.

Friday, March 9, 2012

Remote MSSQL2000 server connection with .net

I have a problem in connecting to my hosting database using .net file.
I am able connect to database with my ASP page.

Any sugession is greately appretiated!

Here is my code:

".net" page:


<%@. page language='vb' debug='true' %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<html>
<script runat="server"
Sub Page_Load(Src As Object, E As EventArgs)
Dim MyConnection As SqlConnection
Dim da AS sqlDataAdaptor
Dim ds As DataSet
MyConnection = New SqlConnection("DSN=***;UID=***;PWD=***")
da = new sqlDataAdaptor("select * from city", MyConnection)
Try
MyConnection.open()
Response.write "Connection Success " & MyConnection.Database & "<br>"
catch sx AS sqlException
Response.write "Connection successful: <br>"
End Try

ds=new Dataset()
da.Fill(ds, "City")

With DataGrid1
.DataSource = ds.Tables("city").DefaultView
.DataBind()
End With

MyConnection.Close()

End Sub

</script
<body
<p>
<ASP:dataGrid id='DataGrid1' runat='server'/>
<p>
</body>
</html>
--------------


"ASP" page:

Set DB = Server.CreateObject("ADODB.Connection")
DB.Open ConnectionString

SET RSCheckeMail = DB.Execute ("select * from city")

While not RSCheckeMail.eof
Response.write "City: " & RSCheckeMail("Name") & "<br>"
RSCheckeMail.Movenext
Wend


Thanks for your help in advance.Please any help on this?|||As far as I understand it, in order to use a DSN in the connection string you have to use the ODBC provider, which is not recommended. You really need to try to use SQLClient.

Please check out the connection string suggestions athttp://www.connectionstrings.com. I would think that you would need to connect using an IP address.

Terri|||tmorton,
Thank you for your suggestion. I am trying with SQLClient only or I am missing some thing here.
I tried with all the connection strings explained in the URL: http://www.connectionstrings.com. No luck.

Any more suggestions? please.

KP|||can you post the updated code ?|||Yes, you are using SQLClient, which is good. What I was trying to say but wasn't clear is that if you want to use a DSN you would need to use ODBC instead.

Did you try a connection string in this format?
"Data Source=190.190.200.100;Network Library=DBMSSOCN;Initial Catalog=yourDatabase;User ID=yourSQLUserID;Password=youSQLUserPassword;"

If you could post your attempted connection string and any errors your are receiving this would help to troubleshoot the problem.

Terri|||tmorton,
Thank you for your advice.

I got the solution for my problem.

I think all new .net learners like me has this problem initially. I mistake I did was, not using VS .net to start my development.
All beginners you need to remember to do this when you start for the first time when you start running some sample .net pages: Create an application (vb or c#) depends as per your preference. Then add all the pages to that Application. This will make your test pages will run properly (you won't waste time like me for 3 days to scratch your head to run a simple page!!).

Here is my final code to connect remote server from your IIS:


<%@. page language='vb' %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %
<script runat="server"
Sub Page_Load(Src As Object, E As EventArgs)
Dim MyConnection As SqlConnection
Dim da AS sqlDataAdapter
Dim ds As DataSet
MyConnection = new SqlConnection("server=65.49.254.24;database=aspdotnet;uid=aspdotnetuser;pwd=aspdotnetpassword")

da = new sqlDataAdapter("select * from city", MyConnection)
Try
MyConnection.open()
Response.write ("Connection Success <br>")
catch sx AS sqlException
Response.write ("Connection failed: <br>")
End Try

ds=new Dataset()
da.fill(ds, "cities")

With DataGrid1
.DataSource = ds.Tables("cities").DefaultView
.DataBind()
End With
MyConnection.Close()
End Sub

</script>
<html>
<body
<p>
<ASP:dataGrid id='DataGrid1' runat='server'/>
<p>
</body>
</html>

Please correct me if you can improve the connection.

Thanks for your support.

KP|||this is good...works..but if you just want to display a set of results...you can use executereader (for returning multiple columns) which is faster than datasets...am sure you will learn along the journey...

in your case you could have just created an sqlcommand...xample..( off the top of my head)


dim mysqlcommand as sqlcommand
Dim conn As SqlConnection
dim strsql as string
conn="..."
strsql ="Select * from table"
mysqlcommand=new sqlcommand(strsql,conn)
conn.open()
datagrid.datasource=mysqlcommand.executereader()
conn.close()

also remember to open the connection late and close early...

hth|||Dinakar,
Thanks for your suggestions. I will remember them.
You are right! Just now I started long journey...

KP

Wednesday, March 7, 2012

remote database connection

Hello,

My database stays in a remote site and I have access it through VPN. I would like connect my current Windows based Asp.Net application with this database. What are my options? Can I connect remote database with SqlDataAdaper, will that be slow? Should I sue Web Services to connect database?

If you can Ping the database server from the server running the ASP.NET code, you should be able to connect the exact same way as you can connect to a machine right next to your machine. The speed or slowness depends upon exactly what you are doing. It is likely that using the standard SqlClient classes will be faster and easier than trying to do it using a Web Service.

Remote database access

Hi can anybody know how to connect remote database with asp.net application? Actually my database is in different machine (in different server, different location) so i want to connect that server. Every time I'm getting the fallowing message

An error has occured while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

Thank you,

Nagu

Hi,

Please check the article athttp://www.kodyaz.com/content/SQLServerdoesnotallowremoteconnections.aspx about this default security configuration and altering this setting

You can use the Surface Area Configuration tool in order to let remote connections.

Eralper

|||

Hi nagsline ,

First of all enable mixed mode authentication for accessing the database. If you are using an sql username and password make sure that user have access to your database.

|||Also make sure your connection string is correct ie. you have mentioned the correct system name or Ip address etc.|||I don't know if this helps but I thought I would point out that you receive this exact error also when your SQL server is stopped and you try connecting to it.

Monday, February 20, 2012

remote connection problem

Hi

I'm having a problem connecting to a remote sql server 2000, A, database using asp.net 2.
Im able to connect to another remote database, B, fine but when i connect A i get the following error:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

I figure it might be a server problem. I tried using all sorts of connection strings.

Thanks

Hi,

Did you manage to solve this problem? I have the same problem and I am also finding it hard to find anyone to help me.

Thanks

|||

I'm also having this issue, Server is 2003 IIS 6.0. .NET 2.0 I am writing an application hosted on this server that connects to another 2003 server running sqlserver 2005 standard. There is no Firewall enabled on the db server. Remote connections are enabled on the dbserver and allowed through 1433. I've added local service to the security permissions too as well as the username and password that i'm using in the connection string.

I've gone through various posts regarding this error but to no avail. here's the full error as seen in my browser and the connection string i'm using in web.config

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

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: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

web.config

<connectionStrings>
<add name="ConnectionString" connectionString="data source=dbserver;Network=DBMSSOCN;initial catalog=ius_hr;Trusted_Connection=yes;user id=username;password=password;packet size=4096"/>
</connectionStrings>