Monday, March 26, 2012
Remove <select a value> option
his defualt value is Null.
In the report page, The first value is "<select a value>".
even if I give the parameter another defualt value Then it open with
this value selected but still the first value is "<select a value>".
Can I remove this?
Thanks.On Feb 25, 12:23 am, "nicknack" <roezo...@.gmail.com> wrote:
> I have a parameter that get his values from a query.
> his defualt value is Null.
> In the report page, The first value is "<select a value>".
> even if I give the parameter another defualt value Then it open with
> this value selected but still the first value is "<select a value>".
> Can I remove this?
> Thanks.
Please refer to the response I posted on the other Reporting Services
group.
Regards,
Enrique Martinez
Sr. SQL Server Developer|||Where is the other reporting services group..I can't find it.
Cheers
D
"EMartinez" wrote:
> On Feb 25, 12:23 am, "nicknack" <roezo...@.gmail.com> wrote:
> > I have a parameter that get his values from a query.
> > his defualt value is Null.
> >
> > In the report page, The first value is "<select a value>".
> > even if I give the parameter another defualt value Then it open with
> > this value selected but still the first value is "<select a value>".
> >
> > Can I remove this?
> >
> > Thanks.
> Please refer to the response I posted on the other Reporting Services
> group.
> Regards,
> Enrique Martinez
> Sr. SQL Server Developer
>
Friday, March 23, 2012
Remotely Executing a Stored Proc
TIAPlease take a look at the linked server functionality. This allows you to execute a distributed query or call a remote stored procedure.
Remote User Login Error
Hello guys and girls! I need help for this error. Could anyone be so kind to enlighten me on this? Thanks!
When i attempted to login to my local page, this occurred:
I'm wondering if you have authetication set to forms?
<authenticationmode="Forms">
|||hi pkellnerYa.. I did set already..|||sorry it didn't help. usually when you see an error with the name int he format aspnet/... that means the app is using windows authentication and not forms. oh well. I can't think of anything else.
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
Friday, March 9, 2012
Remote MSSQL2000 server connection with .net
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 Tryds=new Dataset()
da.Fill(ds, "City")With DataGrid1
.DataSource = ds.Tables("city").DefaultView
.DataBind()
End WithMyConnection.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 ConnectionStringSET 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 Tryds=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