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

Thursday, March 22, 2012

cant access the datasource control

When I put a sqldatasource in my page and want to configure it and add a new connection to it I recieve this error : "object reference not set to an instance of an object" . Do you have any idea about solving this problem. please help me Thanks

Hi,

when asking a question about code or when you get an error always try to provide therelevant pieces of code and the error message that you get. This helps the people around here to better help you out.

Grz, Kris.

|||

My program has only a simple datagrid that should get data from a sql table and show it.This is only a test after changing the IIS settings. You can see my code here:

When I run this program I don't recieve any error but the explorer shows the blank page. When I try making connectionstring via sqldatasource I recieve that error:"the object reference...".thanks for helping

public

partialclassado1 : System.Web.UI.Page

{

privatevoid bindgrid()

{

string conStr ="Data Source=.;Initial Catalog=Northwind;Persist Security Info=True;User ID=sa";SqlConnection conn =newSqlConnection(conStr);// Open the connection

conn.Open();

// Create a data adapter objectSqlDataAdapter adapter =newSqlDataAdapter("SELECT * FROM testt", conn);DataSet ds =newDataSet();

adapter.Fill(ds);

GridView1.DataBind();

conn.Close();

}

protectedvoid Page_Load(object sender,EventArgs e)

{

if (!IsPostBack)

{

bindgrid();

}}}

///////////////////////////////

the body of aspx file is here:

<

body><formid="form1"runat="server"><div> <asp:SqlDataSourceID="SqlDataSource1"runat="server"></asp:SqlDataSource><asp:GridViewID="GridView1"runat="server"></asp:GridView></div></form>

</

body>

/////////////////////////////////////

|||

Hi,

hsharifi:

publicpartialclassado1 : System.Web.UI.Page

{

privatevoid bindgrid()

{

string conStr ="Data Source=.;Initial Catalog=Northwind;Persist Security Info=True;User ID=sa";

SqlConnection conn =newSqlConnection(conStr);

// Open the connection

conn.Open();

// Create a data adapter objectSqlDataAdapter adapter =newSqlDataAdapter("SELECT * FROM testt", conn);DataSet ds =newDataSet();

adapter.Fill(ds);

GridView1.DataBind();

conn.Close();

}

protectedvoid Page_Load(object sender,EventArgs e)

{

if (!IsPostBack)

{

bindgrid();

}}}

///////////////////////////////

the body of aspx file is here:

<

body><formid="form1"runat="server"><div> <asp:SqlDataSourceID="SqlDataSource1"runat="server"></asp:SqlDataSource><asp:GridViewID="GridView1"runat="server"></asp:GridView></div></form>

</

body>

/////////////////////////////////////

it seems like you're trying to do 2 things here: you want to use code & the SqlDataSource control together, that's a no go.

Get rid of the SqlDataSource control on your page and in the codefile, just before you call the DataBind() method place this line:

GridView1.DataSource = ds;
GridView1.DataBind();

Grz, Kris.

|||

Hi Xlll ,and thank you for replying me.

I did the thing that you said but my problem is still going on. After running my program the browser shows a blank page. I had to change many settings in IIS, do you think this problem is related to these changes or may be I should reinstall vs.net after that.

I would be glad to hear your opinion. Thanks

|||

Hi,

before re?nstalling you can first let the aspnet_regiis -i tool do its work to set the correct settings for the correct framework in IIS.

Something else that you can try: place a TextBox, Button and Label control on a webform. In the Button Click event you place this code:

Label1.Text = TextBox1.Text

and see if it executes well on your server. It's probably something stupid but I like to use such scenario's to quickly test out if ASP.NET is installed properly on a machine.

Grz, Kris.

Tuesday, March 20, 2012

cant access report manager page

Hi friends
suddenly today i cant access my report manager page. i get error "request timed out". it worked nicely yesterday.
any ideas on how to troubleshoot this one.

am running sql server 2005 on xp professional machine.
ThanksMake sure IIS is running and security hasn't change. Has anything changed on machine since last working (e.g. new software, service packs)?|||

Yes Philip

i tried to uninstall sqlexpress but had issues with it. but finally i managed to uninstall successfully and after restarting my machine i can access report manager page.

Thanks

|||Excellent result!

cant access report manager options

Hi friends
i installed sql server 2005 standard edi with reporting services on win2003 server.
i can open report manager page in IE but i cant access anything i mean report builder,upload file link option etc., they are disabled for some reason.

Yes i went to site settings(interestingly i can access this !!) and gave all rights i see there to the user but no avail.

interestingly i can access all options from IIS manager !
any ideas how to fix this ?
am using IIS6its still a problem !!
any help much appreciated. Thanks|||Does giving yourself Local Administrator on the server machine help?
Or Domain Administrator

By default you should be

BUILTIN\Administrators Content Manager

|||

Hi Jerry

Actually i logged in as domain administrator. what i dont understand is i cant access any options on report manager page (except site settings) in IE but i can access everything in IIS's management console!!

i even tried deleting virtual directories and reconfigured reporting services still made no difference.!

|||finally got it working
i added relevant user on "properties" page that we see reportmanager home page. everything fine now :)

cant access report manager options

Hi friends
i installed sql server 2005 standard edi with reporting services on win2003 server.
i can open report manager page in IE but i cant access anything i mean report builder,upload file link option etc., they are disabled for some reason.

Yes i went to site settings(interestingly i can access this !!) and gave all rights i see there to the user but no avail.

interestingly i can access all options from IIS manager !
any ideas how to fix this ?
am using IIS6its still a problem !!
any help much appreciated. Thanks|||Does giving yourself Local Administrator on the server machine help?
Or Domain Administrator

By default you should be

BUILTIN\Administrators Content Manager

|||

Hi Jerry

Actually i logged in as domain administrator. what i dont understand is i cant access any options on report manager page (except site settings) in IE but i can access everything in IIS's management console!!

i even tried deleting virtual directories and reconfigured reporting services still made no difference.!

|||finally got it working
i added relevant user on "properties" page that we see reportmanager home page. everything fine now :)

Sunday, March 11, 2012

Cannot view http://webserver/Reports/Pages/Folder.aspx page from my system

Hi,
I am trying to view http://webserver/Reports/Pages/Folder.aspx page that resides on my collegues system as he has got SQL Reporting Services installed on it, but what all i can see is the title 'SQL Server Reporting Services' and 'Home' written on it. I am not able to view tabs like 'Contents', 'properties' which my collegue can when he browses for the page from his system.

Is there any problem with the rights. Please suggest how can I view these options like 'Contents' etc.

Ashu

Report server out of the box only gives local admins any rights. All other rights must be granted by a local admin.

Have a local admin click on the properties tab on the home page and then on the security tab. From there they can add new users and give them the desired permissions.

You can find more information on the predefined roles here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rswork/htm/rms_security_v1_01h4.asp

Cannot view actual report

Hi,

I am using the reportviewer control the following way

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="RenderReport.aspx.cs" Inherits="pages_RenderReport" Title="View Report"%>

<%@. Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<html runat="server">

<head runat=server></head>

<body>

<form runat=server>

<table width="100%" cellpadding=0 cellspacing=0 border=0>

<tr>

<td valign="top" id="report" width="100%" style="height: 104%">

<rsweb:ReportViewer ID="reportViewer" runat="server" Width=100% SizeToReportContent=false BorderWidth="1pt" ExportContentDisposition="AlwaysInline" AsyncRendering="False" Height="600px" Font-Size=Small ShowParameterPrompts=true ShowPageNavigationControls=true ProcessingMode="Remote">

</rsweb:ReportViewer>

</td>

</tr>

</table>

</form>

</body>

</html>

I cannot see the report at all?..All i see is the parameters area.

thanks.

It doesn't appear that you specified a report to render. The Report Viewer control won't render anything unless it's given a report.

-Albert

|||

Actually i had set the report in the code. I should have included that code in this forum. I however figured out the problem.

Thanks.

Cannot view actual report

Hi,

I am using the reportviewer control the following way

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="RenderReport.aspx.cs" Inherits="pages_RenderReport" Title="View Report"%>

<%@. Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<html runat="server">

<head runat=server></head>

<body>

<form runat=server>

<table width="100%" cellpadding=0 cellspacing=0 border=0>

<tr>

<td valign="top" id="report" width="100%" style="height: 104%">

<rsweb:ReportViewer ID="reportViewer" runat="server" Width=100% SizeToReportContent=false BorderWidth="1pt" ExportContentDisposition="AlwaysInline" AsyncRendering="False" Height="600px" Font-Size=Small ShowParameterPrompts=true ShowPageNavigationControls=true ProcessingMode="Remote">

</rsweb:ReportViewer>

</td>

</tr>

</table>

</form>

</body>

</html>

I cannot see the report at all?..All i see is the parameters area.

thanks.

It doesn't appear that you specified a report to render. The Report Viewer control won't render anything unless it's given a report.

-Albert

|||

Actually i had set the report in the code. I should have included that code in this forum. I however figured out the problem.

Thanks.

cannot view

Thought I edited a previous post but apparently not. The cannot view problem is with a png file inserted on a start page of a web site. Other Gif and Jpeg files are viewable with IE and Mozilla but not the png file.

Your post is marked as a question but there is no question in it. How can we help?

Thanks
Laurentiu

|||Sorry for the confusion as I am a new user to these boards and didn't get the post in place as I intended. We've placed some banner ads from sponsors on our web site and I cannot view them with IE. The ones that are there in either Gif or Jpeg are viewable but we have one in png and I cannot see it. This same banner is on another site in Germany and I cannot view that one either. I've also tried other browsers such as Mozilla and get the same results. I'm of the opinion there is a setting in XP or my Norton 2005 program that may be causing the problem but so far have not been able to find it. Any help would be greatly appreciated.|||

I'd like to help but I don't know the answer to your question - this is a SQL Server newsgroup focused on security. Someone may know the answer to this, but it's a safer bet to post to an appropriate newsgroup.
To venture a guess, you may need to convert the image to a supported format or you may need to upgrade your IE browser.

For figuring out why IE does not display the PNG banner, you should check the IE newsgroups from the link below:

http://www.microsoft.com/windows/ie/support/newsgroups/default.mspx

Search for threads that discuss PNG issues and if you don't find an answer to your question on those newsgroups, then I suggest that you post your question again there.

Thanks
Laurentiu

|||thank you for your help in guiding me to the correct board to post my question.

Tim

Cannot use Large Page Extensions & AWE

Hi,

We are seeing the following line on the sql errorlog on a Itanium2 server running SQL Server 2005 Enterprise RC1.

Cannot use Large Page Extensions: lock memory privilege was not granted.

Is it something to be alarmed with?

This server has 16GB memory so it's my understaning that AWE does not have to be enabled on the instance as the 64-bit architecture can directly address more than 3GB of memory?
Cheers,
Priyanga


Few questions:

(1) Have you enabled AWE option. Assume not, but checking.
(2) Are you running 32-bit version of SQL Server on a 64-bit machine? 32-bit windows applications automatically run on 64-windows through WoW.
(3) Are you starting SQL Server with any trace flags?

|||

Short answer to your question, no, you don’t have to worry, but read on.

Indeed 64-bit SQL Server can address more than “usual” limit of 32 bit address space.

However, locked pages in memory privilege allows SQL Server to keep pages in memory and do not allow the OS to page them out. This may translate to performance gain, but does require the privilege. The privilege also allows to use large page extensions, which also may be benefitial for performance reasons.

You will get this message in default server configuration if you have large amounts of RAM (which you do).

I would recommend enabling the privilege and testing your server. You may get performance gain.

HTH,
Boris.

|||

Thanks Boris.

How do i enable the "locked pages in memory privilege" setting?
I could not see this as a sql server system configuration.

Also, to clarify, i don't need to enable "AWE enabled" configuraton on this instance as 64-bit does it natively?

Cheers,
Priyanga

|||

It is Windows level privilege. This is from Windows help:

You can configure this security setting by opening the appropriate policy and expanding the console tree as such: Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\.

This security setting determines which accounts can use a process to keep data in physical memory, which prevents the system from paging the data to virtual memory on disk. Exercising this privilege could significantly affect system performance by decreasing the amount of available random access memory (RAM).

I would like to emphasize the last point. Understand the implication of granting this privilege. E.g. if you have something else on this server, SQL Server may effectively consume most of the RAM, unless you set 'max server memory' as well. This is why I recommend testing your server.

As for the second quesiton, no, you do not need to set "AWE enabled" on 64-bit server.

Regards,
Boris.

Thursday, March 8, 2012

cannot update all the values of Query

I have faced a situation that when i try to update a page. Some values can be updated while some cannot. I try to print the executed SQL query and get the following

1"UPDATE orders SET2cust_id=15,po_code='PO20060610',3po_amt=10000.0000,4add_charges=0,5commission='eeeeeee',6lab_charges=0,7fty_dis=0,8pay_trm='adasds',9cust_dis=0,10trade_trm_desc='',11curr_rate=1,12ship_expense=0,13shipmark='eng ship mard new2',14sidemark='Eng Side Mark new333'15,inner_box='Eng Inner Box new333',16confirmation='rend confirmation2',17contract='end contact23',18internal_remark='testing testing 26/6/2007 333',19rec_curr_rate=0,rec_amt=0,shipmark_attach='',20sidemark_attach='',inner_box_attach='',21ord_type=1,status=2,ord_confirm_code='',22commission_type=1,sidemark_lang='English',23curr_code='HKD',unit_code='PCS',24trade_trm='FOB Hong Kong',rec_curr='USD',25ord_date='2006/06/10', po_date='01/01/2007',exp_delivery_date='01/01/2007',26act_delivery_date='01/01/2007', pay_start_date='10/10/06',pay_end_date='10/10/06',upd_time='2007/03/15 15:41:14' WHERE ord_id=292;Set @.ord_id=292;"

The fields sidemark, inner_box, internal_remark cannot update, while others can.

I think it's really strange... since i have no idea why some can be updated while some others and the SQL seems to me is correct.

Please give me some advices on solving this.

Thank you.

If I run this query against the table (definition below) it all works and all of those fields are updated.

Perhaps there is a problem with the definition of the table - you can post the definition if you like and I'll test again with the same definition. I had to call my table orders2 as I tested in Northwind, which already has an orders table...

UPDATE orders2 SET
cust_id=15,po_code='PO20060610',
po_amt=10000.0000,
add_charges=0,
commission='eeeeeee',
lab_charges=0,
fty_dis=0,
pay_trm='adasds',
cust_dis=0,
trade_trm_desc='',
curr_rate=1,
ship_expense=0,
shipmark='eng ship mard new2',
sidemark='Eng Side Mark new333'
,inner_box='Eng Inner Box new333',
confirmation='rend confirmation2',
contract='end contact23',
internal_remark='testing testing 26/6/2007 333',
rec_curr_rate=0,rec_amt=0,shipmark_attach='',
sidemark_attach='',inner_box_attach='',
ord_type=1,status=2,ord_confirm_code='',
commission_type=1,sidemark_lang='English',
curr_code='HKD',unit_code='PCS',
trade_trm='FOB Hong Kong',rec_curr='USD',
ord_date='2006/06/10', po_date='01/01/2007',exp_delivery_date='01/01/2007',
act_delivery_date='01/01/2007', pay_start_date='10/10/06',pay_end_date='10/10/06',upd_time='2007/03/15 15:41:14' WHERE ord_id=1

CREATE TABLE [orders2] (
[ord_id] [int] IDENTITY (1, 1) NOT NULL ,
[cust_id] [int] NULL ,
[po_code] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[po_amt] [decimal](18, 2) NULL ,
[add_charges] [decimal](18, 2) NULL ,
[commission] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[lab_charges] [decimal](18, 2) NULL ,
[fty_dis] [decimal](18, 2) NULL ,
[pay_trm] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[cust_dis] [decimal](18, 2) NULL ,
[trade_trm_desc] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[curr_rate] [decimal](18, 2) NULL ,
[ship_expense] [decimal](18, 2) NULL ,
[shipmark] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[sidemark] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[inner_box] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[confirmation] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[contract] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[internal_remark] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[rec_curr_rate] [decimal](18, 2) NULL ,
[rec_amt] [decimal](18, 2) NULL ,
[shipmark_attach] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[sidemark_attach] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[inner_box_attach] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[ord_type] [int] NULL ,
[status] [int] NULL ,
[ord_confirm_code] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[commission_type] [int] NULL ,
[sidemark_lang] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[curr_code] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[unit_code] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[trade_trm] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[rec_curr] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[ord_date] [datetime] NULL ,
[po_date] [datetime] NULL ,
[exp_delivery_date] [datetime] NULL ,
[act_delivery_date] [datetime] NULL ,
[pay_start_date] [datetime] NULL ,
[pay_end_date] [datetime] NULL ,
[upd_time] [datetime] NULL ,
CONSTRAINT [PK_orders2] PRIMARY KEY CLUSTERED
(
[ord_id]
) ON [PRIMARY]
) ON [PRIMARY]
GO


|||

Your orders is a table or View? Do you receive any specific error?

Thanks

|||

orders2 is a table.

I didn't get any errors and the update was sucessful.

|||

I see that yours is tableSohnee ,but the object orders with whichthtang has a problem is a table or view?

Wednesday, March 7, 2012

Cannot subscribe via email

When I go to the subscription page, in the delivered by drop down box, i only get "File Share" as an option. Is there a setting on the report server configuration file that is making the "Email Delivery" option not viewable?

Thanks.

silly question, but did you specify an email server (smtp)?

Also, what version are you using (2000, 2005)?

|||

That is correct, RS will only display the extensions which are configured and ready to use. In order to use the email extension, you need to provide a SMTP server name at least - via the RS configuration tool in RS 2005 or manually editing RsReportServer.config in RS 2000.

Thanks

Tudor

Cannot start transaction

Hi,
I have this problem with SQL Server 2000.
Opening an ASP page I read this error:
"cannot create new transaction because capacity was exceeded"
The error code is cannot "8004d01d"
Can anyone help me?
Thanks> Hi,
> I have this problem with SQL Server 2000.
> Opening an ASP page I read this error:
> "cannot create new transaction because capacity was exceeded"
> The error code is cannot "8004d01d"
> Can anyone help me?
I assume you did try to search Usenet archives? There is plenty information
about this issue there. See:
http://groups.google.pl/groups?hl=p...sa=N&tab=wg&lr=
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.

Thursday, February 16, 2012

Cannot select "Server Database Engine" when installing SQL Server Sep 2005 CTP

I am trying to install SQL Server Sep 2005 CTP - ENTERPRISE, there are
check boxes on the Components to Install page of the Microsoft SQL Server Installation Wizard to select component groups for your SQL Server installation, they are all disabled, except "Workstation Components, Development Tools, and SQL Server Books Online".
I tried installing and after it finishes, there are no SQL instances.... What am I doing wrong? Please help. Thank you.

1. What is your operating systems. SQL Server 2005 Enterprise needs server operating systems such as W2K SP4, W2K3 EE SP1, LH Server.

2. What is the instance name you select? If you have already installed SQL Engine with instance name "SQLEngine" and now you restart setup with the same instance name "SQLEngine", then SQL Engine cannot be selected as it is already installed with under the specified instance name. You can only choose other components, which has not been installed under the specified instance name or other shared common components.

Note, "SQLEngine" is a fabricated instance name.

Cannot select "Server Database Engine" when installing SQL Server Sep 2005 CTP

I am trying to install SQL Server Sep 2005 CTP - ENTERPRISE, there are
check boxes on the Components to Install page of the Microsoft SQL Server Installation Wizard to select component groups for your SQL Server installation, they are all disabled, except "Workstation Components, Development Tools, and SQL Server Books Online".
I tried installing and after it finishes, there are no SQL instances.... What am I doing wrong? Please help. Thank you.

1. What is your operating systems. SQL Server 2005 Enterprise needs server operating systems such as W2K SP4, W2K3 EE SP1, LH Server.

2. What is the instance name you select? If you have already installed SQL Engine with instance name "SQLEngine" and now you restart setup with the same instance name "SQLEngine", then SQL Engine cannot be selected as it is already installed with under the specified instance name. You can only choose other components, which has not been installed under the specified instance name or other shared common components.

Note, "SQLEngine" is a fabricated instance name.