Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Thursday, March 29, 2012

Can't stop page breaks on my grouped list

All,
I've created a list and defined a group for monthly period. In the
list, I include several controls that show each month's summary values.
Unfortunately, each month's set of controls is appearing on separate
pages. The sections are small enough to fit two or three per page.
I've verified that the two page break properties are both set to False.
I've set the Keep Together property to False. What else am I missing?
Are their layout issues concerning margins or anything like that? This
is the first time I've tried to use grouped lists so I don't know what
to think.
I created the report with the report wizards and then modified it from
there. Maybe that will help.
Thanks,
DavidIt's me...the originator of this message.
I apparently have not found the list control's property that made it
serve as the Page field container that I chose in the New Report Wizard
(Matrix report). I would have thought the New Page After property.
Nevertheless, I created a new list control and copied my controls into
it. After defining my group, all worked as expected.
So if you're reading this and have a guess why the list control
mysteriously ejected pages, please respond. I'm interested.
David|||What was the property ? I am having a similar problem with the
occasional page in my report (200 pages) breaking about half way down
the page.
davidb@.mercurydata.com wrote:
> It's me...the originator of this message.
> I apparently have not found the list control's property that made it
> serve as the Page field container that I chose in the New Report Wizard
> (Matrix report). I would have thought the New Page After property.
> Nevertheless, I created a new list control and copied my controls into
> it. After defining my group, all worked as expected.
> So if you're reading this and have a guess why the list control
> mysteriously ejected pages, please respond. I'm interested.
> David

Thursday, March 22, 2012

cant seem to connect to a store procedure on SQL server

Hi,

I am trying to get a page to call on a store procedure in SQL server and can seem to get it right. Any advice would be appreiated

<%@. Page Language="vb" %>
<%@. import Namespace="System.Data" %>
<%@. import Namespace="System.Data.OleDb" %>
<script runat="server"
Dim Conn as new OleDbConnection("Provider=SQLOLEDB;Server=*;Database=WEST1;User ID=*;Password=*;Trusted_Connection=False")
Sub Submit(Sender as Object, e as EventArgs)
Dim objCmd as OleDbCommand = new OleDbCommand ("vendorPending 10031,85140109", Conn)

Dim objReader as OleDbDataReader

objCmd.CommandType = CommandType.StoredProcedure

Try
objCmd.Connection.Open()
response.write ("opening data")
objReader = objCmd.ExecuteReader

catch ex as OleDbException
Response.write ("Error retrieving data.")

end try

DataGrid1.DataSource = objReader
DataGrid1.DataBind()

objCmd.Connection.Close()

End Sub

</script>
<html>
<head>
<title></title>
</head>
<body>
<form method="post" runat="server">
<tbody>
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td>
Login :
</td>
<td>
<asp:textbox id="user" runat="server"></asp:textbox>
</td>
</tr>
<tr>
<td>
Password :
</td>
<td>
<asp:textbox id="Pass" runat="server" textmode="Password" MaxLength="10"></asp:textbox>
<br />
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:button id="Button1" onclick="submit" runat="server" text="submit"></asp:button>
</td>
</tr>
<br />
<tr>
<td>
</td>
</tr>
</tbody>
<br />
<asp:DataGrid id="DataGrid1" runat="server" HorizontalAlign="Left" Font-Names="Arial" ItemStyle-BackColor="#FFFFFF" AlternatingItemStyle-BackColor="#CCCCCC" Font-Size="10pt" Font-Name="Arial" width="755px" cellpadding="2" gridlins="vertical" BorderColor="Black" AutoGenerateColumns="False">
<HeaderStyle font-size="Small" font-names="Arial" font-bold="True"></HeaderStyle>
<EditItemStyle horizontalalign="Left"></EditItemStyle>
<AlternatingItemStyle backcolor="#CCCCCC"></AlternatingItemStyle>
<ItemStyle horizontalalign="Right" backcolor="White"></ItemStyle>
<Columns>
<asp:BoundColumn DataField="invnum" HeaderText="<b>Invoice Number</b>"></asp:BoundColumn>
<asp:BoundColumn DataField="invdate" HeaderText="Invoice Date" DataFormatString="{0:MM-dd-yyyy}"></asp:BoundColumn>
<asp:BoundColumn DataField="duedate" HeaderText="Due Date" DataFormatString="{0:MM-dd-yyyy}"></asp:BoundColumn>
<asp:BoundColumn DataField="invamt" HeaderText="Invoice Amount" DataFormatString="${0:N2}"></asp:BoundColumn>
<asp:BoundColumn DataField="payamt" HeaderText="Pay Amount" DataFormatString="${0:N2}"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
</form>
</body>
</html>

The store proceudure takes 2 int parameters. I have coded it inline in order to test it. I also will implement validation once I get this working

Thanksuse sqlclient instead oledb. there is built in support for sql server.
heres some sample code :


Dim myCommand As SqlCommand
Dim myParam As SqlParameter
dim objcon as new sqlconnection("...") ' check www.connectionstrings.com for the right connection string
myCommand = New SqlCommand()
myCommand.Connection = objcon
myCommand.CommandText = "usp_Test"
myCommand.CommandType = CommandType.StoredProcedure

myCommand.Parameters.Add(New SqlParameter("@.userid",SqlDbType.int))
myCommand.Parameters("@.userid").Value = Trim(userid)

'add other params
dim objreader as
If objCon.State = 0 Then objCon.Open()
objreader = mycommand.ExecuteReader() ' objdatareader is your sqldatareader.
myCommand.dispose()

hth

Tuesday, March 20, 2012

Can't see the Report Manager page

Hi There,

I have installed the Sql Server 2005 reporting services and I see that two default directories being created in IIS (Report and ReportServer..). For some reason, if I type http://localhost/reports, I am unable to see the report manager homepage. Can anybody suggest me if I need to configure any more stuff to see the report manager?

I enabled the anonymous authentication and still cannot see....

I can see the webservice however by typing http://localhost/reportserver...

Any suggestions are greatly apprecaited...

Thanks.

Sam.

I got it. I had to set up the reportserver to be accessible anonymous along with Reports.

Thanks.

sql

Cant see stored procedures

Hi,

Can anyone help me. I've created a stored procedure in sql server and I'm trying to run it from my asp.net page. On Database Explorer I can't see it, or any for that matter, however I can see tables in the same schema.

Also I can't see it when I build a table adapter either.

Can anybody help?

Thanks

Sam

My first suspicion is that you didn't succeed in creating the stored procedure as you think you have done. To allay that suspicion, can you see the proc in Sql Server Management Studio?

|||

Yes I can see it and execute it, it works fine through sql server

I'm thinking that it might be because I'm using the express versions of the software sql server studio and visual web developer. Do you think that might be limiting the functionality?

|||

No. That wouldn't limit what you can see in the Database explorer. I've just attached Northwind to SqlExpress, and can see the procs, views etc in DataBase Explorer in VWD.

Try clicking the Refresh button at the top of the Database Explorer panel.


|||

check you master database mybe you created it in default database which is usual master when you open New Query window.If it is true put line below on top of your proceureUSE [DATABASE NAME] GO

|||

As JPazgier mentioned you probably created the proc in the default master db. If so, script out the proc, drop the proc from master db, re-create it in the actual db. If that is not the case and the proc is already in the right database, then check your connection string to see if your application is connecting to the right database.

cant see Report manager page

Hi Friends
we've report server (sql server 2005 standard edi) on win 2003 server. i can see report manager page (i.e. http://servername/reports) from my machine but some of out users cant see this page !!
all they can see is "sql server reporting services" text nothing else. no reports and no models ertc.,

i assume its something to do with rights issue. where can i set these rights so that all users within our domain can see and create reports off report server page.
Thanks for your help.From the main page, select the properties tab, then select the security sub-tab. You can grant the necessary permissions to any group or user there.|||Thanks for that Brian. I just tried that but did not work.
our domain name is "yabba.co.nz" so i added domain by clicking "new role assignment" but to no avail.
so i tried add one of users ,who is having this problem like "yabba.co.nz\Peter" but got following error
The user or group name 'yabba.co.nz/Peter' is not recognized. (rsUnknownUserName)

any ideas please.
Thanks for your help|||You should be specifying the user or group name the same way you would for an ACL, such as for the file system. If you are using a domain user, the report server machine must be a part of that domain.|||Thank you very much Brian.
That really helped . now all our users could view report manager page and they can view and run reports now :)

one thing remained though, they cant see "Report builder" link .i tried to assign all roles (i.e. browser,content manager etc.,) but still did not help.
any ideas on this one.
Thanks for your help again :)|||

The user must have "Execute Report Definition" permission. This is a system level permission that can be configured from the "Site Settings" link at the top of Report Manager.

|||Thank you very much Brian.
That worked like a charm. Thanks for all your help :)

Monday, March 19, 2012

Can't see content tab or properties tab.

An administrator installed reporting services. I went to the url to the
report manager, I cannot see anything on the home page, no tabs at all. How
do I set it up to show me these tabs?
Thanks,
Rick.Log into the machine locally as a member of the local administartor's group.
You'll be able to assign permissions either using the SiteSettings-->Manage
site wide security or through the properties tab
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"Rick" <noodle@.noodle.com> wrote in message
news:%23cSbAlPaEHA.644@.tk2msftngp13.phx.gbl...
> An administrator installed reporting services. I went to the url to the
> report manager, I cannot see anything on the home page, no tabs at all.
> How
> do I set it up to show me these tabs?
> Thanks,
> Rick.
>

Saturday, February 25, 2012

Cant pass 0 in stored procedure parameter

Hi
I have an if clause in my code to add the final parameter value to send to the database.
If Page.User.IsInRole("MICMS") Then
cmdCheckUser.Parameters.Add("@.C_ID", 0)
Else
cmdCheckUser.Parameters.Add("@.C_ID", Session("C_ID"))
End If

If the user is in the role, the error is triggered saying that @.C_IDis expected by the stored procedure. If i then change the value from 0to 10, the stored procedure works fine.
Is there any reason that the stored procedure is failing when the value 0 is used and not when any other value is used?
Thanking you in advance.Because the parameters.add is overridden based on what is passed (look at them when you hit the left parens). Since you are passing a numerical value of a low number, it thinks that it is the sqldbtype. You will need to cast the value to a string cStr(YOURVALUEHERE).
Nick

Can''t open reports page?


I have problem and I can't open http://localhost/reports. I get error "The request failed with HTTP status 400: Bad Request." When I try open page http://localhost/reportserver he open OK.

Lp,

Hello,

Check your RSWebApplication.config and insure that the URL listed for ReportServerUrl is correct. Check your IIS logs and see details about the error.

Larry Smithmier

Can''t open reports page?


I have problem and I can't open http://localhost/reports. I get error "The request failed with HTTP status 400: Bad Request." When I try open page http://localhost/reportserver he open OK.

Lp,

Hello,

Check your RSWebApplication.config and insure that the URL listed for ReportServerUrl is correct. Check your IIS logs and see details about the error.

Larry Smithmier

can't open default report builder page

Hi All,
I am trying to open the report builder. I can't seem to find a menu item or
any other way to get into it. I am guessing it is in the
http://servername/reportserver page?
I have everything setup as far as I can tell. I have been working in the
visual studio creating reports. I deployed my project, but I can't get the
http://servername/reportserver" page to open.
I get this error:
An internal error occurred on the report server. See the error log for more
details. (rsInternalError) Get Online Help
File does not exist.
Can someone please tell me what file does not exsist' Also I dont know
which error log this is talking about.
TIA,
JoeI had the wrong name of the page.

Sunday, February 12, 2012

Can't Install Express because .Net Framework 2 is installed! I'm going around in circles.

I'm new to SQL Express and from the SQL Express DOWNLOAD page you need to install .NET Framework 2 then install SQL Express. After installing .NET Framework 2.0 I then attempt to install SQL Express and I get a message that SQL Server 2005 Setup has detected incompatible components from beta versions of Visual Studio, .NET Framework or SQL Server 2005. I used the Visual Studio removal tool and it took out .NET Framwork. I re-installed this and did a reboot and get the SAME ISSUE! CAN ANYONE GET ME OUT OF THIS MS loop nightmare.

Thanks! Jeff

Make sure that you uninstalled any beta-versions of SQLServer 2005 / VS / The Framework and other beta products that might have shipped the .NET 2.0 beta along with them. THen run the removal tool. THis should clean out every reference to the assemblies and evidences.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||Thanks Jens but this is a clean Win Pro 2K wkstation that NEVER had any of these products, BETA or live installed. When I ran the removal tool it took .NET 2 off and I tried to the SQL xpress install and it wanted .NET 2K. Could the site that I downloaded it from have been BETA? I would guess not as I saw no reference to it and it was a link right off the SQL Express site that mentioned I needed this first anyway. I'm still baffled. I also looked at a full SQL Server 2005 disk from MS and it also wanted the same .NET 2 loaded before an install. I only need SQL Express for the app. I'm running. Thanks Jeff|||

This issue has been answered several times in this forum. Check out my answer to this post for example.

Mike

|||

Thanks Mike for some direction. Again this was a clean O/S and I was simply following the instructions on the SQL Express page with no luck. I looked at the logs as you suggested and saw no real issue. Here is the summary. I looked at each log file and do not see what is causing the fuss other than an additiona of .42 to the end of the version of .NET. So I uninstalled .NET again and re-downloaded it from the same site and re-installed it and behold all is well.

Loaded DLL:C:\WINNT\system32\msi.dll Version:3.1.4000.2435
Product "{44568A1C-53F6-49A5-A163-CD9ADC0F76D5}" versioned 2.0.50727 is not compatible with current builds of SQL Server.Expected at least version: 2.0.50727.42

Why the old version is still floating on the links to SQL Express is yet another MS mystery to solve, GFL. I really did search the forum and did not see any answers to this.Thanks again, your log viewing saved the day! Jeff

Can't Install Express because .Net Framework 2 is installed! I'm going around in circles.

I'm new to SQL Express and from the SQL Express DOWNLOAD page you need to install .NET Framework 2 then install SQL Express. After installing .NET Framework 2.0 I then attempt to install SQL Express and I get a message that SQL Server 2005 Setup has detected incompatible components from beta versions of Visual Studio, .NET Framework or SQL Server 2005. I used the Visual Studio removal tool and it took out .NET Framwork. I re-installed this and did a reboot and get the SAME ISSUE! CAN ANYONE GET ME OUT OF THIS MS loop nightmare.

Thanks! Jeff

Make sure that you uninstalled any beta-versions of SQLServer 2005 / VS / The Framework and other beta products that might have shipped the .NET 2.0 beta along with them. THen run the removal tool. THis should clean out every reference to the assemblies and evidences.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||Thanks Jens but this is a clean Win Pro 2K wkstation that NEVER had any of these products, BETA or live installed. When I ran the removal tool it took .NET 2 off and I tried to the SQL xpress install and it wanted .NET 2K. Could the site that I downloaded it from have been BETA? I would guess not as I saw no reference to it and it was a link right off the SQL Express site that mentioned I needed this first anyway. I'm still baffled. I also looked at a full SQL Server 2005 disk from MS and it also wanted the same .NET 2 loaded before an install. I only need SQL Express for the app. I'm running. Thanks Jeff|||

This issue has been answered several times in this forum. Check out my answer to this post for example.

Mike

|||

Thanks Mike for some direction. Again this was a clean O/S and I was simply following the instructions on the SQL Express page with no luck. I looked at the logs as you suggested and saw no real issue. Here is the summary. I looked at each log file and do not see what is causing the fuss other than an additiona of .42 to the end of the version of .NET. So I uninstalled .NET again and re-downloaded it from the same site and re-installed it and behold all is well.

Loaded DLL:C:\WINNT\system32\msi.dll Version:3.1.4000.2435
Product "{44568A1C-53F6-49A5-A163-CD9ADC0F76D5}" versioned 2.0.50727 is not compatible with current builds of SQL Server.Expected at least version: 2.0.50727.42

Why the old version is still floating on the links to SQL Express is yet another MS mystery to solve, GFL. I really did search the forum and did not see any answers to this.Thanks again, your log viewing saved the day! Jeff

Cant Handle Dts Error - Transaction was deadlocked...

Hi, i get this error while imanuallyexecute dts. But when i execute dts on my .aspx page, i can't handle this error on "... catch(Exception ex) {... }" part.

catch (Exception ex)
{return ex.Message ;
//DtsPackage.OnError += new PackageEvents_OnErrorEventHandler(DtsPackage_OnError); }
Here is dts message in a text file.

Step 'DTSStep_DTSDataPumpTask_3' failed

Step Error Source: Microsoft OLE DB Provider for SQL Server
Step Error Description:Transaction (Process ID 124) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Step Error code: 80004005
Step Error Help File:
Step Error Help Context ID:0

Any idea?

A deadlock happens when two users are trying to get each other's resources.

Here's an example:

Bob is running a process that is updating the Employee table and, in the middle of it, his code tries to update the Customer table.

Sally is running a process that is updating the Customer table on the same Customer that Bob is ABOUT TO deal with and, in the middle of it, her code tries to update the Employee that Bob has already got locked.

Neither can get the other's resource until the other one lets go.

|||

Of course it is. I know what a deadlock is. My question is i can't handle error from my web page. Dts does not return error code. It says "Dts succeeded...".

And i handle it with getting output and get the rows which start with "Error....".

Thanks for your reply..

Can't get to where to manage roles

Yesterday, I was able to go to http://localhost/reports and manage roles and
users in those roles.
Today, that page looks different. I'm not sure if anyone ran anything or
what, but I now just see links for various projects.
I noticed in IIS that there is a pages/roles.aspx page so I typed
http://localhost/reports/pages/roles.aspx and I did see the list of roles.
But when I click on "Browsers" it tells me the IUSR account does not have
permissions.
What's going on? Shouldn't I be able to get to roles without having to know
the .aspx page? Where are the links for this?
I'm so confused. Thanks for any help.
RonNevermind. I needed to set anonymous access to off in both Reports and
ReportServer.
"Ronald S. Cook" <rcook@.westinis.com> wrote in message
news:%23oPNn$pWHHA.600@.TK2MSFTNGP05.phx.gbl...
> Yesterday, I was able to go to http://localhost/reports and manage roles
> and users in those roles.
> Today, that page looks different. I'm not sure if anyone ran anything or
> what, but I now just see links for various projects.
> I noticed in IIS that there is a pages/roles.aspx page so I typed
> http://localhost/reports/pages/roles.aspx and I did see the list of roles.
> But when I click on "Browsers" it tells me the IUSR account does not have
> permissions.
> What's going on? Shouldn't I be able to get to roles without having to
> know the .aspx page? Where are the links for this?
> I'm so confused. Thanks for any help.
> Ron
>
>

Can't get to report manager home page.

I have Reporting Services 2005 installed on my Windows XP machine. I can access the Report Manager home page with the built-in Administrator account. However, my own account, which is a member of the Computer Admin group, is denied access with a 401.3 error. The 401.3 seems to be access denied due to not being on the ACL. I am using simple file sharing. What should I do to give access to my own account?

I don't know if IIS works with simple file sharing. It is something at the IIS security layer, nothing to do with SSRS. You might try some other files a simple ASP.NET app.|||

It wouldn't be correct to say that IIS doesn't work with Simple File Sharing, since I am able to get to the Report Manager home page using the built-in administrator account. Also, I should mention that if I allow anonymous access to the Report Manager directory I can get to the Report Manager home page under my own account, but then the home page is crippled (no site settings tab for example). I agree this might not be a SSRS problem per se, but I was hoping someone has encountered this problem when using a development machine (Windows XP) to host SSRS, as I am.

|||Yes, turning off Simple File Sharing works.

Friday, February 10, 2012

can't get to report manager

My company recently upgraded to CRM 3.0 and i was trying to get to the report
manager page in my browser to make custom reports. Unfortunately, whenever i
try to go to the report manager page i get the error listed below. Has anyone
ever seen this before? Thanks in advance for any help you can give me.
Server Error in '/ReportMgr' Application.
----
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: Assembly microsoft.crm.platform.proxy.dll security
permission grant set is incompatible between appdomains.
Source Error:
Line 15: <add assembly="Microsoft.Crm.ObjectModel, Version=3.0.5300.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Line 16: <add assembly="Microsoft.Crm.Platform.ComProxy,
Version=3.0.5300.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Line 17: <add assembly="Microsoft.Crm.Platform.Proxy,
Version=3.0.5300.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Line 18: <add assembly="Microsoft.Crm.Platform.Server,
Version=3.0.5300.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Line 19: <add assembly="Microsoft.Crm.Platform.Sdk, Version=3.0.5300.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Source File: c:\inetpub\wwwroot\web.config Line: 17
----
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
Version:1.1.4322.2300did you solve this problem I am seeing something similar?
"ACreel" wrote:
> My company recently upgraded to CRM 3.0 and i was trying to get to the report
> manager page in my browser to make custom reports. Unfortunately, whenever i
> try to go to the report manager page i get the error listed below. Has anyone
> ever seen this before? Thanks in advance for any help you can give me.
> Server Error in '/ReportMgr' Application.
> ----
> Configuration Error
> Description: An error occurred during the processing of a configuration file
> required to service this request. Please review the specific error details
> below and modify your configuration file appropriately.
> Parser Error Message: Assembly microsoft.crm.platform.proxy.dll security
> permission grant set is incompatible between appdomains.
> Source Error:
>
> Line 15: <add assembly="Microsoft.Crm.ObjectModel, Version=3.0.5300.0,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
> Line 16: <add assembly="Microsoft.Crm.Platform.ComProxy,
> Version=3.0.5300.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
> Line 17: <add assembly="Microsoft.Crm.Platform.Proxy,
> Version=3.0.5300.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
> Line 18: <add assembly="Microsoft.Crm.Platform.Server,
> Version=3.0.5300.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
> Line 19: <add assembly="Microsoft.Crm.Platform.Sdk, Version=3.0.5300.0,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
>
> Source File: c:\inetpub\wwwroot\web.config Line: 17
>
> ----
> Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
> Version:1.1.4322.2300

cant get sqldatasource to return results from a stored procedure

I thought I would impliment a new feature of my web page using stored procedures and the SqlDataSource object, for practice or whatever, since I don't normally use that stuff.

This is the stored procedure:

set ANSI_NULLSONset QUOTED_IDENTIFIERONgo-- =============================================-- Author:Lance Colton-- Create date: 7/31/06-- Description:Find the contest winner-- =============================================ALTER PROCEDURE [dbo].[AppcheckContest]-- Add the parameters for the stored procedure here@.BeginDatedatetime ='1/1/2006', @.EndDatedatetime ='12/31/2006', @.SectionIDint = 10,@.WinnerIDint = 0OUTPUTASBEGIN-- SET NOCOUNT ON added to prevent extra result sets from-- interfering with SELECT statements.SET NOCOUNT ON;-- Insert statements for procedure hereSELECT top 1 @.WinnerID = P.UserIDFROM cs_Posts PWHERE P.PostDateBETWEEN @.BeginDateAND @.EndDateAND P.SectionID = @.SectionIDAND P.UserID <> 2100-- I don't want to win my own contest...AND SettingsID = 1000-- This number could be different if i had more than one CS installed?AND IsApproved = 1ORDER BYNEWID()-- yes this is slow, but it works...RETURN @.WinnerIDEND

It's really simple - just needs to return the one randomly chosen integer userID. I've tested it in query designer or whatever it's called in Management Studio and it works fine there at least.

Thinking I was done the hard part, I created a new web form in visual studio, dropped a SqlDataSource on it, and used the 'configure data source' wizard from the smart tag to do all the work for me. I didn't have any trouble using the wizard to select my stored procedure, and i'm using the sa connection string to simplify my debugging. I tried using the FormParameter / FormField way of getting the output and setting the input parameters. I can't seem to get it working though. There's no errors or anything, just the output isn't coming through.

Here's the code from the aspx codebehind file:

Partial Class Contest Inherits System.Web.UI.Page Protected Sub btnSelectWinner_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSelectWinner.Click Dim stuff As New System.Web.UI.DataSourceSelectArguments SqlDataSource1.Select(stuff) SqlDataSource1.DataBind() lblWinnerID.Text = SqlDataSource1.SelectParameters("WinnerID").ToString End SubEnd Class

As you can see, I wasn't sure if you're supposed to call databind() or select() to actually get the stored procedure to execute, so I tried both. I was hoping the last line of code there would set the label to the value contained in the @.WinnerID parameter, but instead it sets it to "WinnerID".

Here's the code from the .aspx file. Most of this was generated by the Wizard, but I messed around with it a bit.

<%@. Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Contest.aspx.vb" Inherits="Contest" title="Untitled Page" %><asp:Content ID="Content1" ContentPlaceHolderID="CPHMain" Runat="Server"> <asp:Button ID="btnSelectWinner" runat="server" Text="Find Winner" /> <asp:Calendar ID="Calendar_From" runat="server"></asp:Calendar> <asp:Calendar ID="Calendar_To" runat="server"></asp:Calendar> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:appcheck-csConnectionString-sa%>" SelectCommand="AppcheckContest" SelectCommandType="StoredProcedure" CancelSelectOnNullParameter="False"> <SelectParameters> <asp:FormParameter FormField="Calendar_From" Name="BeginDate" Type="DateTime" /> <asp:FormParameter FormField="Calendar_To" Name="EndDate" Type="DateTime" /> <asp:Parameter DefaultValue="10" Name="SectionID" Type="Int32" /> <asp:formParameter FormField="lblWinnerID" defaultvalue="666" Direction="InputOutput" Name="WinnerID" Type="Int32" /> </SelectParameters> </asp:SqlDataSource>   <asp:Label ID="lblWinnerID" runat="server" Text="?"></asp:Label></asp:Content>

okay well i gave up on using a sqldatasource since nobody replied.

here's my final working code using an sqlCommand object instead:

PartialClass ContestInherits System.Web.UI.PageProtected Sub btnSelectWinner_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles btnSelectWinner.ClickDim objCommandAs New SqlClient.SqlCommandDim objConnAs New SqlClient.SqlConnectionDim strQueryResultAs New Object objConn.ConnectionString = ConfigurationManager.ConnectionStrings("appcheck-csConnectionString-sa").ConnectionString objCommand.Connection = objConn objCommand.CommandType = CommandType.StoredProcedure objCommand.CommandText ="AppcheckContest"Dim intWinnerIDParamAs New SqlClient.SqlParameter("@.WinnerID", SqlDbType.Int)Dim DateFromParamAs New SqlClient.SqlParameter("@.BeginDate", SqlDbType.DateTime)Dim DateToParamAs New SqlClient.SqlParameter("@.EndDate", SqlDbType.DateTime) intWinnerIDParam.Direction = ParameterDirection.Output DateFromParam.Direction = ParameterDirection.Input DateToParam.Direction = ParameterDirection.Input objCommand.Parameters.Add(intWinnerIDParam) DateFromParam.Value = Calendar_From.SelectedDate DateToParam.Value = Calendar_To.SelectedDate objCommand.Parameters.Add(DateFromParam) objCommand.Parameters.Add(DateToParam) objConn.Open() objCommand.ExecuteScalar() objConn.Close()Try lblWinnerID.Text ="Winner ID: <a target='_blank' href='http://forum.appcheck.net/web/user/Profile.aspx?UserID=" & intWinnerIDParam.Value & "'>" & intWinnerIDParam.Value & "</a>" Catch ex As Exception lblWinnerID.Text = "error"End Try End SubEnd Class
<%@. Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Contest.aspx.vb" Inherits="Contest" title="Untitled Page" %><asp:Content ID="Content1" ContentPlaceHolderID="CPHMain" Runat="Server"> Contest Start Date:<asp:Calendar ID="Calendar_From" runat="server"></asp:Calendar> Contest End Date:<asp:Calendar ID="Calendar_To" runat="server"></asp:Calendar> <asp:Button ID="btnSelectWinner" runat="server" Text="Find Winner" /> <asp:Label ID="lblWinnerID" runat="server" Text="?"></asp:Label></asp:Content>
set ANSI_NULLSONset QUOTED_IDENTIFIERONgo-- =============================================-- Author:Lance Colton-- Create date: 7/31/06-- Description:Find the contest winner-- =============================================ALTER PROCEDURE [dbo].[AppcheckContest] @.BeginDatedatetime, @.EndDatedatetime, @.SectionIDint = 10,@.WinnerIDint = 0OUTPUTASBEGINSET NOCOUNT ON;SELECT top 1 @.WinnerID = P.UserIDFROM cs_Posts PWHERE P.PostDateBETWEEN @.BeginDateAND @.EndDateAND P.SectionID = @.SectionIDAND P.UserID <> 2100-- I don't want to win my own contest...AND SettingsID = 1000-- This number could be different if i had more than one CS installed?AND IsApproved = 1ORDER BYNEWID()-- yes this is slow, but it works...END
|||Hi,

I've had a similar issue for the last few days.
I only found 1 page that helped me solve it:
http://dotnetjunkies.com/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/data/RetValAndOutputParamsInsert.src

I hope this helps you.

Cheers
Luke

|||

The above posters link is correct. The output/return value parameters are only available during the "ED" events (Inserted/Updated/Deleted). So if you want them, you have to capture them during that event.

And just a FYI - NewID isn't random, not even close. Google a better random method, which usually involves taking the last 32 bits of newid and feeding it into the rand function.

Cant get Reports Server page to work

hi I have sql 2005 Standard on WinXP and i cant get http://localhost/ReportServer to work.
I get the web page error
Server Application Error
The server has encountered an error while loading an application during the

processing of your request. Please refer to the event log for more detail

information. Please contact the server administrator for assistance.

I have re-installed sql 2005, reinstalled IIS .
I have run the aspnet_regiis -i and still nothing.

Please someone, anyone , help.

just a suggestion

have a look in your sql server configuration tools // configuration manager // expand the network configuration until you get protocols and then in the right hand pane you should see TCPIP - double click - it might say disabled. - double click and in the properties - then select IP addresses tab - 127.0.0.1 make sure this is enabled. Also check this for remote connections.

We have been down this road and that's what solved ours.

Hope it helps

jewel

|||Hi, I tried as you suggested. That was already enabled.
Still not working.|||what does your event viewer say?|||Event Type: Warning
Event Source: W3SVC
Event Category: None
Event ID: 36

Description:
The server failed to load application '/LM/W3SVC'. The error was 'The specified metadata was not found.|||

here is a link that may help :)

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q257267

|||Hi, i tried what was said in the post but still nothing.
i

dont have the file mentioned above in my c:\winnt\system 32. I think

the above is for win nt . I have win xp and my component services

doesnt hang.
|||This seems more like an IIS issue. How about trying to recreate the default web site? If you deploy an ASP.NET app on the default website, does it work? If you reinstall SQL and IIS, make sure you install IIS before SQL.

Cant get proper Field size using Enterprise Manager

This is frustrating. Im new at MS SQL and have created a table using Enterprise Manager. I need one of the fields to hold a paragraph or page of text... Ive tried every data type and even those with max length of 8000 or greater, I cannot get it to save more than the first 256 characters. I use an "INSERT" or "UPDATE" command from a PHP script on the front end...

any help would be amazing!

thank you!

michael wolffhave you thought that perhaps it is php that is not letting your text be longer then 256??

if you are using sql to insert the record get php to print out the sql that it is sending to the server and then see what happens if you execute that in the query analyzer|||Originally posted by rokslide
have you thought that perhaps it is php that is not letting your text be longer then 256??

if you are using sql to insert the record get php to print out the sql that it is sending to the server and then see what happens if you execute that in the query analyzer

the php shows the field as it should be... then i execute the INSERT... then missing text!|||have you actually tried executing the sql in the query analyzer?

I have been doing web based updates to sql for ages and I have only experienced this problem when I had stuffed up the command somewhere.|||you mean running the insert directly in EM to see if it takes the field size?

no, but ill try it now!|||i tried it and got this:

*********
Server: Msg 103, Level 15, State 7, Line 1
The identifier that starts with 'IN CASE YOU WERE WONDERING!! We've had some problems with our host and are currently working on fixing the problems this has cau' is too long. Maximum length is 128.
Server: Msg 128, Level 15, State 1, Line 1
The name 'IN CASE YOU WERE WONDERING!! We've had some problems with our host and are currently working on fixing the problems this has cau' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
************

its a 'VARCHAR' field of max length 8000... whys it telling me the max is 128 here? and whats it mean by "The nam"? its just text...

*****

heres the statement i ran:

INSERT INTO headlines VALUES (getdate(),"IN CASE YOU WERE WONDERING!! We've had some problems with our host and are currently working on fixing the problems this has caused with the site. Just getting tour dates updated, BIG TEXTBIG TEXTBIG TEXTBIG TEXTBIG TEXTBIG TEXTBIG TEXTBIG TEXTBIG TEXTBIG TEXTBIG TEXT 25 BIG TEXTBIG TEXTBIG TEXTBIG TEXTBIG TEXTBIG TEXT 50 BIG TEXTBIG TEXTBIG TEXTBIG TEXTBIG TEXTBIG TEXT 100",25)

field types are: datetime, varchar, numeric...

and ideas?

thank you.

michael wolff|||okie, well that error message is not coming from MS SQL. MS SQL would say something like - Action aborted. String or Binary data would have been truncated - or some such...

can't remember the exact syntax...

so something else is saying that the field is 128/256.

in your php do you define the fields that you are putting data into? do they have default values for things like length??

I have passed the error to a friend that uses php and will pass on what he says.|||dont need to define the fields... well, its just a 'textarea' html field... and that value is passed into the 'INSERT' command...

the errors i posted above i got directly from the Query Analyzer... so i dont know...

please let me know what your friend says!

thank you

michael wolff|||Hi Michael,

I wonder if it's not just a problem with your double quotes around the string.
Could you try it with 'single quotes' (apostrophes?).
SQL thinks you refer to a column or other database name if you put it within double quotes.

Cheers,
Robert|||still cut it off at 254 characters..... and this is directly with the QA... so its the same results as doing it from a PHP script...|||Can you provide me with the script to create the table and the insert statement you're using and I'll take a look for you ?

Thanks
Mark|||i created the table directly in EM...

but heres the INSERT code, pretty straighforward:

$query="INSERT INTO headlines VALUES (getdate(),\"$newheadline\",\"$theid\")";|||Originally posted by celloshred
i created the table directly in EM...

You could right click the table in EM and choose All tasks->Generate SQL Scripts to get the script that would help us track down the problem.

I guess this is not the case, but there was a limit in old ODBC drivers which cut off chars/varchars at 256 characters.|||you got there just before me :-)|||not sure what that is, but heres the file (attached)|||Its the double quotes around the inserted string. Use single quotes.
However as you have a single quote inside the string you provided, additional quotes will need to surround those quotes.

Or you could on use run via iSQL

SET quoted_identifier OFF

which will allow you to use the query just as you have it, ie with double quotes