Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Tuesday, March 27, 2012

Attach database in MSDE

Hi

I have deattached a database from SQL Server 2000 and would like to use this database in MSDE. But how do I attach or register this database in MSDE?

Regards

MYou can use the sp_attach_db system stored procedure to reattach it, running it either through Query Analyzer if you have a machine with the SS2K client tools installed or with isql from the command line.

That enough information?

Don

Sunday, March 11, 2012

Assigning Foreign Key To New SQL Server Table

Hi

I am creating new SQL Server Tables using SQL Server 2005. I have set
primary key to the tables .But I do not know how to assign Foreign key
to the tables .I need to do some joins later and that is why I have to
put Foreign key to the table . The Primary key is visible and can be
assigned easily .But How do I assign foreign key .

Thanks

*** Sent via Developersdex http://www.developersdex.com ***.. . (kmandal@.sark.com) writes:
> I am creating new SQL Server Tables using SQL Server 2005. I have set
> primary key to the tables .But I do not know how to assign Foreign key
> to the tables .I need to do some joins later and that is why I have to
> put Foreign key to the table . The Primary key is visible and can be
> assigned easily .But How do I assign foreign key .

First of all, questions about SQL 2005 are best asked in the SQL 2005
newsgroups, as these are monitored by the SQL Server deverlopers. Access
info here: http://go.microsoft.com/fwlink/?linkid=31765

As for your question, the syntax is as in this example:

ALTER TABLE tbl ADD CONSTRAINT fk_myforeignley (col1, col2)
REFERENCES othertbl (col1, col2)

Or were you using the table designer? I recommend that you learn the
syntax to create table from SQL statements. In the long run that will
make you more effective and productive, than clicking around in the
table designer. Also, there are several *serious* bugs in the table
designer when it comes to modify existing tables, so the less you use
it, the better.

(If you are dead set on it, I believe that if you right-click there
are foreign keys in the context menu.)

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||
Hi

Thanks for your reply . It worked and I was able to assign Foreign key
to the tables . Thanks again .

*** Sent via Developersdex http://www.developersdex.com ***|||Foreign keys will definitely help with relational integrity. However,
for the purposes of joining the foreign key need not be pre-defined.
That is what the join syntax in the select statement is for.

Wednesday, March 7, 2012

Assign a string to a variable

Hi
I'm using a varchar variable (@.Cadena) to store a select statement.
--
declare @.cadena varchar(1000), @.quincena int, @.anio int, @.numeroempleado
int, @.CadSDOS varchar(1000), @.sdos numeric(9,2)
set @.quincena = 24
set @.anio = 2004
set @.numeroempleado = 589
SET @.Cadena = '(SELECT CASE ' + CAST(@.Quincena AS varchar) + '
WHEN 1 THEN ImpQuin01
WHEN 2 THEN ImpQuin02
WHEN 3 THEN ImpQuin03
WHEN 4 THEN ImpQuin04
WHEN 5 THEN ImpQuin05
WHEN 6 THEN ImpQuin06
WHEN 7 THEN ImpQuin07
WHEN 8 THEN ImpQuin08
WHEN 9 THEN ImpQuin09
WHEN 10 THEN ImpQuin10
WHEN 11 THEN ImpQuin11
WHEN 12 THEN ImpQuin12
WHEN 13 THEN ImpQuin13
WHEN 14 THEN ImpQuin14
WHEN 15 THEN ImpQuin15
WHEN 16 THEN ImpQuin16
WHEN 17 THEN ImpQuin17
WHEN 18 THEN ImpQuin18
WHEN 19 THEN ImpQuin19
WHEN 20 THEN ImpQuin20
WHEN 21 THEN ImpQuin21
WHEN 22 THEN ImpQuin22
WHEN 23 THEN ImpQuin23
WHEN 24 THEN ImpQuin24
END As SumaSDOS
FROM HisMovimientosQnal
WHERE Anio = ' + CAST(@.Anio AS varchar) + ' AND NumeroEmpleado = ' +
CAST(@.NumeroEmpleado AS varchar)
+ ' AND TipoIncidencia = ''SDOS'')'
EXEC (@.Cadena) --Execute the select statement
--
Till this point, the result is shown correctly.
I would like to store that result into another variable.
How can I do it?Gonzalo Torres wrote:
> Hi
> I'm using a varchar variable (@.Cadena) to store a select statement.
> --
> declare @.cadena varchar(1000), @.quincena int, @.anio int, @.numeroempleado
> int, @.CadSDOS varchar(1000), @.sdos numeric(9,2)
> set @.quincena = 24
> set @.anio = 2004
> set @.numeroempleado = 589
> SET @.Cadena = '(SELECT CASE ' + CAST(@.Quincena AS varchar) + '
> WHEN 1 THEN ImpQuin01
> WHEN 2 THEN ImpQuin02
> WHEN 3 THEN ImpQuin03
> WHEN 4 THEN ImpQuin04
> WHEN 5 THEN ImpQuin05
> WHEN 6 THEN ImpQuin06
> WHEN 7 THEN ImpQuin07
> WHEN 8 THEN ImpQuin08
> WHEN 9 THEN ImpQuin09
> WHEN 10 THEN ImpQuin10
> WHEN 11 THEN ImpQuin11
> WHEN 12 THEN ImpQuin12
> WHEN 13 THEN ImpQuin13
> WHEN 14 THEN ImpQuin14
> WHEN 15 THEN ImpQuin15
> WHEN 16 THEN ImpQuin16
> WHEN 17 THEN ImpQuin17
> WHEN 18 THEN ImpQuin18
> WHEN 19 THEN ImpQuin19
> WHEN 20 THEN ImpQuin20
> WHEN 21 THEN ImpQuin21
> WHEN 22 THEN ImpQuin22
> WHEN 23 THEN ImpQuin23
> WHEN 24 THEN ImpQuin24
> END As SumaSDOS
> FROM HisMovimientosQnal
> WHERE Anio = ' + CAST(@.Anio AS varchar) + ' AND NumeroEmpleado = '
+
> CAST(@.NumeroEmpleado AS varchar)
> + ' AND TipoIncidencia = ''SDOS'')'
> EXEC (@.Cadena) --Execute the select statement
> --
> Till this point, the result is shown correctly.
> I would like to store that result into another variable.
> How can I do it?
Exec @.variable =(@.Cadena)
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)|||Look up the topic sp_ExecuteSQL in SQL Server Books Online. It has some
examples which shows how to assign the results to an output variable.
Also, just by glancing through the code, it seems like you might have a
better/easier way of retrieving the results without using Dynamic SQL. But
then without further knowledge of your table structures & business rules, it
is hard to tell.
Anith|||I don't know your table structure, but this thing looks suspiciously
de-normalized...
Anyways, you might look into sp_executesql instead of EXEC. Safer and
shouldn't require all the CASTs, plus you can get a little performance boost
out of it since it compiles the query plan for parameterized queries. Check
it out in BOL.
"Gonzalo Torres" <condormix2001@.yahoo.com.mx> wrote in message
news:O4nRqYCJFHA.1860@.TK2MSFTNGP15.phx.gbl...
> Hi
> I'm using a varchar variable (@.Cadena) to store a select statement.
> --
> declare @.cadena varchar(1000), @.quincena int, @.anio int, @.numeroempleado
> int, @.CadSDOS varchar(1000), @.sdos numeric(9,2)
> set @.quincena = 24
> set @.anio = 2004
> set @.numeroempleado = 589
> SET @.Cadena = '(SELECT CASE ' + CAST(@.Quincena AS varchar) + '
> WHEN 1 THEN ImpQuin01
> WHEN 2 THEN ImpQuin02
> WHEN 3 THEN ImpQuin03
> WHEN 4 THEN ImpQuin04
> WHEN 5 THEN ImpQuin05
> WHEN 6 THEN ImpQuin06
> WHEN 7 THEN ImpQuin07
> WHEN 8 THEN ImpQuin08
> WHEN 9 THEN ImpQuin09
> WHEN 10 THEN ImpQuin10
> WHEN 11 THEN ImpQuin11
> WHEN 12 THEN ImpQuin12
> WHEN 13 THEN ImpQuin13
> WHEN 14 THEN ImpQuin14
> WHEN 15 THEN ImpQuin15
> WHEN 16 THEN ImpQuin16
> WHEN 17 THEN ImpQuin17
> WHEN 18 THEN ImpQuin18
> WHEN 19 THEN ImpQuin19
> WHEN 20 THEN ImpQuin20
> WHEN 21 THEN ImpQuin21
> WHEN 22 THEN ImpQuin22
> WHEN 23 THEN ImpQuin23
> WHEN 24 THEN ImpQuin24
> END As SumaSDOS
> FROM HisMovimientosQnal
> WHERE Anio = ' + CAST(@.Anio AS varchar) + ' AND NumeroEmpleado = ' +
> CAST(@.NumeroEmpleado AS varchar)
> + ' AND TipoIncidencia = ''SDOS'')'
> EXEC (@.Cadena) --Execute the select statement
> --
> Till this point, the result is shown correctly.
> I would like to store that result into another variable.
> How can I do it?
>

Friday, February 24, 2012

ASPNETDB relation with my databas

HI!
I have a ASPNETDB as my login databas. but now i want to connect this databas or the aspnet_user table to my table, how do i?
I want to check the username in aspnet_user table and select the same username in my table?

I want to write all sql code in a sql file. so i want to know how i can connect to the sql file from my c# code?

I hope somebody understand me...

Hi sallad88,

I want to write all sql code in a sql file. so i want to know how i can connect to the sql file from my c# code?

Not 100% sure what you mean by this, but if i understand you correct, you can write a stored procedure for this. Since what you want is to "check the username in aspnet_user table and select the same username in my table", you can write your stored procedure like this:

create procedure sp_check_name

as

select * from My_own_table
where Firstnamein

(select username from [asp.net db].dbo.aspnet_users ) // you can access asp.net db this way (specify the database name, schema name, table nameexplicitly)

And in your application, you can bind your sqlcommand to this stored procedure and call executereader function. This will return you desired result set.

Hope my suggestion helps

|||

Yes that was one thing...

And its work fine, I will come back when i can explain the other things better and when iam there in my application...

Thanks for know

aspnetdb on host, connection string

Hi

I am having trouble connecting to aspnetdb on the shared host. On my local server this is my connection string which works fine:

<addname="MyLocalSqlServer"connectionString="Data Source=.\SQLExpress;Integrated Security=SSPI;Initial Catalog=aspnetdb;User Instance=false"

providerName="System.Data.SqlClient" />

But, this doesn't work on the host (just putting in host address):

<addname="MyLocalSqlServer"connectionString="190.40...232,1444;Integrated Security=SSPI;Initial Catalog=aspnetdb_booksale;User Instance=false"

providerName="System.Data.SqlClient" />,

and I get the error :

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

so I put in the user id and password that i used when I created the aspnetdb_booksale db

<addname="MyLocalSqlServer"connectionString="Data Source=196...232,1444;Integrated Security=False;User ID=aspnetdbbooksale; password=amanda;Initial Catalog=aspnetdb_booksale;User Instance=false"

providerName="System.Data.SqlClient" />

and I get the error:

The ConnectionString property has not been initialized.

Any ideas for me?

Amanda

Hi

My problem is not the connection string, because the one below works when I use the add user wizard. However, I get the error when I use the "createuser.membership" method. Funny tho it worked on my local server...

<addname="MyLocalSqlServer"connectionString="Data Source=196...232,1444;Integrated Security=False;User ID=aspnetdbbooksale; password=amanda;Initial Catalog=aspnetdb_booksale;User Instance=false"

|||

So you mean you got the "The ConnectionString property has not been initialized" when you connect from remote machine using the connection string below?

addname="MyLocalSqlServer"connectionString="Data Source=196...232,1444;Integrated Security=False;User ID=aspnetdbbooksale; password=amanda;Initial Catalog=aspnetdb_booksale;User Instance=false"

Really strange. Every time you got the same error message?

Thursday, February 16, 2012

ASP.Net, Microsoft SQL Server 2005 and XML

Hi!
I work in a web site project which uses ASP.net and Microsoft SQL
Server 2005. I use XML and XSL for my pages. My problem is:
oAs the data in the database contain some characters that are not
allowed by XML structure, I used CDATA for all my fields in order to
store them in the XML file like that :
vignettes_xml = vignettes_xml + "<transcription_texte><![CDATA[" +
reader1.GetString(47) + "]]></transcription_texte>"
oBut After I realized that with CDATA I can't access to my XML
structures inside the field (knowing that some fields in the database
stored XML data). So I changed my field to normal writing like that:
vignettes_xml = vignettes_xml + "<transcription_texte>" +
reader1.GetString(47) + "]</transcription_texte>"
oThe problem is : with both the first and the second writing I have in
my XML variable transcription_texte an empty data. But in my database
every transcription_texte contains a long XML structure. I did not
understand what the source of the problem is.
Your answers can be very helpful.
Regards,
Djamila.
Hello djamilabouzid@.gmail.com,
Its not all that clear as what is cause a problem here because we don't know
what reade1.GetString(47) is actually returning.

> Hi!
> I work in a web site project which uses ASP.net and Microsoft SQL
> Server 2005. I use XML and XSL for my pages. My problem is:
> oAs the data in the database contain some characters that are not
> allowed by XML structure, I used CDATA for all my fields in order to
> store them in the XML file like that :
> vignettes_xml = vignettes_xml + "<transcription_texte><![CDATA[" +
> reader1.GetString(47) + "]]></transcription_texte>"
> oBut After I realized that with CDATA I can't access to my XML
> structures inside the field (knowing that some fields in the database
> stored XML data). So I changed my field to normal writing like that:
> vignettes_xml = vignettes_xml + "<transcription_texte>" +
> reader1.GetString(47) + "]</transcription_texte>"
> oThe problem is : with both the first and the second writing I have
> in my XML variable transcription_texte an empty data. But in my
> database every transcription_texte contains a long XML structure. I
> did not understand what the source of the problem is.
> Your answers can be very helpful.
> Regards,
> Djamila.
>
Thanks,
Kent Tegels
http://staff.develop.com/ktegels/
|||Also instead of trying to construct your XML using string concatenations,
why don't you use FOR XML?
Best regards
Michael
"Kent Tegels" <ktegels@.develop.com> wrote in message
news:b87ad747edd8c8b87741135600@.news.microsoft.com ...
> Hello djamilabouzid@.gmail.com,
> Its not all that clear as what is cause a problem here because we don't
> know what reade1.GetString(47) is actually returning.
>
> Thanks,
> Kent Tegels
> http://staff.develop.com/ktegels/
>

ASP.Net, Microsoft SQL Server 2005 and XML

Hi!
I work in a web site project which uses ASP.net and Microsoft SQL
Server 2005. I use XML and XSL for my pages. My problem is:
o As the data in the database contain some characters that are not
allowed by XML structure, I used CDATA for all my fields in order to
store them in the XML file like that :
vignettes_xml = vignettes_xml + "<transcription_texte><![CDATA[" +
reader1.GetString(47) + "]]></transcription_texte>"
o But After I realized that with CDATA I can't access to my XML
structures inside the field (knowing that some fields in the database
stored XML data). So I changed my field to normal writing like that:
vignettes_xml = vignettes_xml + "<transcription_texte>" +
reader1.GetString(47) + "]</transcription_texte>"
o The problem is : with both the first and the second writing I have in
my XML variable transcription_texte an empty data. But in my database
every transcription_texte contains a long XML structure. I did not
understand what the source of the problem is.
Your answers can be very helpful.
Regards,
Djamila.Hello djamilabouzid@.gmail.com,
Its not all that clear as what is cause a problem here because we don't know
what reade1.GetString(47) is actually returning.

> Hi!
> I work in a web site project which uses ASP.net and Microsoft SQL
> Server 2005. I use XML and XSL for my pages. My problem is:
> o As the data in the database contain some characters that are not
> allowed by XML structure, I used CDATA for all my fields in order to
> store them in the XML file like that :
> vignettes_xml = vignettes_xml + "<transcription_texte><![CDATA[" +
> reader1.GetString(47) + "]]></transcription_texte>"
> o But After I realized that with CDATA I can't access to my XML
> structures inside the field (knowing that some fields in the database
> stored XML data). So I changed my field to normal writing like that:
> vignettes_xml = vignettes_xml + "<transcription_texte>" +
> reader1.GetString(47) + "]</transcription_texte>"
> o The problem is : with both the first and the second writing I have
> in my XML variable transcription_texte an empty data. But in my
> database every transcription_texte contains a long XML structure. I
> did not understand what the source of the problem is.
> Your answers can be very helpful.
> Regards,
> Djamila.
>
Thanks,
Kent Tegels
http://staff.develop.com/ktegels/

Monday, February 13, 2012

Asp.net session has expired

Hi

I have designed reports using SQL Server Business Intelligence Development Studio tool (Sql Server reporting service). I have uploaded these reports to report manager.

I am displaying list of reports in tree view control, in my application. I am viewing report in Report Viewer control as per the report selection in tree view control, in same page. I am getting

Server Error in '/Application_name' Application or

  • ASP.NET session has expired error frequently while switching between various reports. Kindly provide me solution

  • .

  • Regards

    Sagayaraj Rayappan

    Are you reseting the Report Path each time they click on an item or are you saving the ExecutionID off? You will need to set the report path each time and not try and use the existed execution ID unless you can keep the session alive yourself.|||

    Thanks for the information. I am resetting Report Path each time when we clicked on an item. How to keep the session alive myself?. What is ExecutionID and how to use it?. Kindly give more details on this.

    |||

    You do not want to use the ExecutionID, I just wanted to rule that out first.

    Is the error occuring from within the report viewer or the entire page?

    |||This error occurs for entire page.|||Since the error occurs on the entire page, this points to an issue in your app. If it was the report server session that had the timeout, the error would occur within the viewer (you would still see the toolbar. Try removing the viewer control and replacing it with a simple control and see if the problem persists.|||

    Hi i am also getting the same error.In my web page i refer the reportviewer and showing different reports.While navigate to different reports randomly i am getting this error.

    Can anyone suggest how to solve this?

    Microsoft.Reporting.WebForms.AspNetSessionExpiredException: ASP.NET session has expired

    [AspNetSessionExpiredException: ASP.NET session has expired]
    Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +683
    Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +553
    Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +10
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

    Thanks in advance,Tom

    |||

    Daniel Reib wrote:

    Since the error occurs on the entire page, this points to an issue in your app. If it was the report server session that had the timeout, the error would occur within the viewer (you would still see the toolbar. Try removing the viewer control and replacing it with a simple control and see if the problem persists.

    Hi I'm getting this error from with the ReportViewer control... I've tried to change the session timeout with the following code but it still times out earlier then the timeout value stated...? Is there some other attribute that needs to be changed also?

    rs -i sessionTimeout.rss -s http://localhost/reportserver -v timeout="6000"

    Many thanks in advance,

    Rob.

    |||

    Did you get a solution to this? The setting you have changed is on the reportserver, your problem is on the app that contains the reportviewer. Look at my post here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=371287&SiteID=1&PageID=2

    |||

    Hi Mark,

    My issue was slightly different. Because of the nature of our reporting system, users may leave a report open for a long period of time (maybe hours) and then come back to it and attempt to run a drillthrouhgh report from where they left off.

    My solution to this was to increase the session timeout in the application pool which has worked well. I'm lucky I guess that the user base for the system is very small, i.e. no more than twenty users, so we should run into any resource issues (finger crossed).

    Regards,

    Rob.

  • Asp.net session has expired

    Hi

    I have designed reports using SQL Server Business Intelligence Development Studio tool (Sql Server reporting service). I have uploaded these reports to report manager.

    I am displaying list of reports in tree view control, in my application. I am viewing report in Report Viewer control as per the report selection in tree view control, in same page. I am getting

    Server Error in '/Application_name' Application or

  • ASP.NET session has expired error frequently while switching between various reports. Kindly provide me solution

  • .

  • Regards

    Sagayaraj Rayappan

    Are you reseting the Report Path each time they click on an item or are you saving the ExecutionID off? You will need to set the report path each time and not try and use the existed execution ID unless you can keep the session alive yourself.|||

    Thanks for the information. I am resetting Report Path each time when we clicked on an item. How to keep the session alive myself?. What is ExecutionID and how to use it?. Kindly give more details on this.

    |||

    You do not want to use the ExecutionID, I just wanted to rule that out first.

    Is the error occuring from within the report viewer or the entire page?

    |||This error occurs for entire page.|||Since the error occurs on the entire page, this points to an issue in your app. If it was the report server session that had the timeout, the error would occur within the viewer (you would still see the toolbar. Try removing the viewer control and replacing it with a simple control and see if the problem persists.|||

    Hi i am also getting the same error.In my web page i refer the reportviewer and showing different reports.While navigate to different reports randomly i am getting this error.

    Can anyone suggest how to solve this?

    Microsoft.Reporting.WebForms.AspNetSessionExpiredException: ASP.NET session has expired

    [AspNetSessionExpiredException: ASP.NET session has expired]
    Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +683
    Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +553
    Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +10
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

    Thanks in advance,Tom

    |||

    Daniel Reib wrote:

    Since the error occurs on the entire page, this points to an issue in your app. If it was the report server session that had the timeout, the error would occur within the viewer (you would still see the toolbar. Try removing the viewer control and replacing it with a simple control and see if the problem persists.

    Hi I'm getting this error from with the ReportViewer control... I've tried to change the session timeout with the following code but it still times out earlier then the timeout value stated...? Is there some other attribute that needs to be changed also?

    rs -i sessionTimeout.rss -s http://localhost/reportserver -v timeout="6000"

    Many thanks in advance,

    Rob.

    |||

    Did you get a solution to this? The setting you have changed is on the reportserver, your problem is on the app that contains the reportviewer. Look at my post here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=371287&SiteID=1&PageID=2

    |||

    Hi Mark,

    My issue was slightly different. Because of the nature of our reporting system, users may leave a report open for a long period of time (maybe hours) and then come back to it and attempt to run a drillthrouhgh report from where they left off.

    My solution to this was to increase the session timeout in the application pool which has worked well. I'm lucky I guess that the user base for the system is very small, i.e. no more than twenty users, so we should run into any resource issues (finger crossed).

    Regards,

    Rob.

  • Asp.net session has expired

    Hi

    I have designed reports using SQL Server Business Intelligence Development Studio tool (Sql Server reporting service). I have uploaded these reports to report manager.

    I am displaying list of reports in tree view control, in my application. I am viewing report in Report Viewer control as per the report selection in tree view control, in same page. I am getting

    Server Error in '/Application_name' Application or

  • ASP.NET session has expired error frequently while switching between various reports. Kindly provide me solution

  • .

  • Regards

    Sagayaraj Rayappan

    Are you reseting the Report Path each time they click on an item or are you saving the ExecutionID off? You will need to set the report path each time and not try and use the existed execution ID unless you can keep the session alive yourself.|||

    Thanks for the information. I am resetting Report Path each time when we clicked on an item. How to keep the session alive myself?. What is ExecutionID and how to use it?. Kindly give more details on this.

    |||

    You do not want to use the ExecutionID, I just wanted to rule that out first.

    Is the error occuring from within the report viewer or the entire page?

    |||This error occurs for entire page.|||Since the error occurs on the entire page, this points to an issue in your app. If it was the report server session that had the timeout, the error would occur within the viewer (you would still see the toolbar. Try removing the viewer control and replacing it with a simple control and see if the problem persists.|||

    Hi i am also getting the same error.In my web page i refer the reportviewer and showing different reports.While navigate to different reports randomly i am getting this error.

    Can anyone suggest how to solve this?

    Microsoft.Reporting.WebForms.AspNetSessionExpiredException: ASP.NET session has expired

    [AspNetSessionExpiredException: ASP.NET session has expired]
    Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +683
    Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +553
    Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +10
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

    Thanks in advance,Tom

    |||

    Daniel Reib wrote:

    Since the error occurs on the entire page, this points to an issue in your app. If it was the report server session that had the timeout, the error would occur within the viewer (you would still see the toolbar. Try removing the viewer control and replacing it with a simple control and see if the problem persists.

    Hi I'm getting this error from with the ReportViewer control... I've tried to change the session timeout with the following code but it still times out earlier then the timeout value stated...? Is there some other attribute that needs to be changed also?

    rs -i sessionTimeout.rss -s http://localhost/reportserver -v timeout="6000"

    Many thanks in advance,

    Rob.

    |||

    Did you get a solution to this? The setting you have changed is on the reportserver, your problem is on the app that contains the reportviewer. Look at my post here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=371287&SiteID=1&PageID=2

    |||

    Hi Mark,

    My issue was slightly different. Because of the nature of our reporting system, users may leave a report open for a long period of time (maybe hours) and then come back to it and attempt to run a drillthrouhgh report from where they left off.

    My solution to this was to increase the session timeout in the application pool which has worked well. I'm lucky I guess that the user base for the system is very small, i.e. no more than twenty users, so we should run into any resource issues (finger crossed).

    Regards,

    Rob.

  • ASP.Net on Window server 2000 - database access

    Hi

    I have problem in configuring my web project on Window server 2000. I have created the web application using Visual Studio 2005 tools. I have configured Window server 2000 with the .Net Framework Version 2.0. I can access the page which doesn't have database access.

    The connection string in the web config file is giving me the problem that connection string can't be found. Does any one have any idea?

    My database connection string looks like this.

    <

    connectionStrings>

    <

    addname="etzAusBldConnectionString"connectionString="Data Source=CASCADE;Initial Catalog=etzAusBldBaseData1;User ID=sa1;Password=****"providerName="System.Data.SqlClient" />

    </

    connectionStrings>

    Moe

    Well, how are you looking for it?

    Thursday, February 9, 2012

    ASP.NET 2.0 and connection to remote SQL 2000 server

    Hi
    I created ASP.NET 2.0 web application that uses SQL Server 2000 database and
    it works perfectly when website and Sql server were on local machine.
    Then I installed application on production server. Database is placed on
    another server.
    I received the 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: Named Pipes Provider, error: 40 - Could not
    open a connection to SQL Server)
    Why it thinks I am trying to connect to SQL Server 2005 ? There is no any
    2005 server on remote server!
    This is my connection string:
    Server=servername;Database=SOX;User ID=userxxx;Password=******;
    Query Analyzer and Enterprise Manager connect perfectly (when installed on
    production server) to database server! Then I created small console
    appplication which uses the same data layer as web application (and
    connection string ) - it connected to remote database too! Only ASP.NET
    2.0 application couldn't connect to remote Sql server 2000.
    Can anyone help?If there is no SQL Server 2005 installed on the server then
    it looks like it's hitting the wrong server. Have you tried
    using the IP address?
    Double check the connection string and server name in the
    connection string. On the IIS server, check for aliases and
    entries in the host file that could cause it to go to the
    wrong server. Log onto the server where IIS is installed and
    ping the SQL Server box by name. Make sure the IP address
    for the SQL Server box is correct and pointing to the
    correct server.
    -Sue
    On Sat, 5 Aug 2006 23:06:33 +0300, "Mitya Mitriev"
    <aaa@.stopspam.org> wrote:

    >Hi
    >I created ASP.NET 2.0 web application that uses SQL Server 2000 database an
    d
    >it works perfectly when website and Sql server were on local machine.
    >Then I installed application on production server. Database is placed on
    >another server.
    >I received the 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: Named Pipes Provider, error: 40 - Could not
    >open a connection to SQL Server)
    >Why it thinks I am trying to connect to SQL Server 2005 ? There is no any
    >2005 server on remote server!
    >This is my connection string:
    >Server=servername;Database=SOX;User ID=userxxx;Password=******;
    >Query Analyzer and Enterprise Manager connect perfectly (when installed on
    >production server) to database server! Then I created small console
    >appplication which uses the same data layer as web application (and
    >connection string ) - it connected to remote database too! Only ASP.NET
    >2.0 application couldn't connect to remote Sql server 2000.
    >Can anyone help?
    >

    Asp.net & File

    Hi

    i use this code to retrieve my image field from sql server
    (my file isn't picture !!!)

    ***********
    Dim MyData() As Byte
    MyData = Ds.Tables(mytable).Rows(0).Item(myfield) 'For Example
    Dim K As Long
    K = UBound(MyData)

    Dim fs As New FileStream("c:\mkh.xml", FileMode.OpenOrCreate, FileAccess.Write) 'in this line get error
    fs.Write(MyData, 0, K)
    fs.Close()

    fs = Nothing
    Ds = Nothing
    ************
    but it doesn't work and give me this error in ASP.Net(With Vb)
    <<Access to the path "C:\mkh.xml" is denied.>
    i get this code from microsoft msdn and alot of furoms !!!!
    then why doesn't work??If we start with the error you're getting, the reason is simple. The Account which Asp.Net use to perform different actions (it's called '<MACHINENAME>\ASPNET'), is not allowed access to your XML file by your system. Locate 'C:\mkh.xml', right click it, choose Security & Sharing, locate your ASPNET account, and let this account have the rights to 'Read and Run', 'Read' and 'Write'.

    Begin there, and come back later when that is solved and you need more help.