Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Thursday, March 29, 2012

Export fails under Forms Authentication

I am developing a Web site using VS.Net 2005 using Forms authentication under
ASP.Net 2.0. The user enters a SQL logon and password, we authenticate that,
then use an embedded logon and password for all SQL calls. It works fine,
except when I try to export a report.
I have ReportViewer embedded on an aspx form, using local processing. The
report opens just fine, accepts parameter changes and renders correctly.
However, when I select an Export format and click Export, I get an "ASP.NET
session has expired" message with the following stack trace:
[AspNetSessionExpiredException: ASP.NET session has expired]
Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +335
Microsoft.Reporting.WebForms.ExportOperation..ctor() +24
Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +281
Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext
context) +34
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +64
I've been developing in VB and SQL for over 10 years, but I'm new to .Net
and Report Service. I've searched books and Web sites, and nothing I've
found mentions this problem or anything like it (which I'm sure means I'm
looking in the wrong place!).
Thanks.When I click on Export, I get a new IE instance, and the ASP session
identifier in the URL is different. If I replace it with the same string in
the IE instance that displays the reportViewer, the Export works just fine.
Now I need to figure out how to force the Export to open under the same ASP
session.
"Paul Gettys" wrote:
> I am developing a Web site using VS.Net 2005 using Forms authentication under
> ASP.Net 2.0. The user enters a SQL logon and password, we authenticate that,
> then use an embedded logon and password for all SQL calls. It works fine,
> except when I try to export a report.
> I have ReportViewer embedded on an aspx form, using local processing. The
> report opens just fine, accepts parameter changes and renders correctly.
> However, when I select an Export format and click Export, I get an "ASP.NET
> session has expired" message with the following stack trace:
>
> [AspNetSessionExpiredException: ASP.NET session has expired]
> Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +335
> Microsoft.Reporting.WebForms.ExportOperation..ctor() +24
> Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +281
> Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext
> context) +34
> System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously) +64
> I've been developing in VB and SQL for over 10 years, but I'm new to .Net
> and Report Service. I've searched books and Web sites, and nothing I've
> found mentions this problem or anything like it (which I'm sure means I'm
> looking in the wrong place!).
> Thanks.
>|||I found an answer to my own problem, but I'm not sure it is the best
practice. I have to edit the ASP.NET configuration for the site to use
Cookies.
Under State Management, change the Cookieless mode selection to UseCookies.
This (as the documentation explains) causes the site to use Session cookies
to retain the security information, which successfully passes to the browser
window opened by the Export command on the ReportViewer control.
This appears to pass 508 Compliance muster for cookies, but Iâ'm still
checking on that.
"Paul Gettys" wrote:
> When I click on Export, I get a new IE instance, and the ASP session
> identifier in the URL is different. If I replace it with the same string in
> the IE instance that displays the reportViewer, the Export works just fine.
> Now I need to figure out how to force the Export to open under the same ASP
> session.
> "Paul Gettys" wrote:
> > I am developing a Web site using VS.Net 2005 using Forms authentication under
> > ASP.Net 2.0. The user enters a SQL logon and password, we authenticate that,
> > then use an embedded logon and password for all SQL calls. It works fine,
> > except when I try to export a report.
> >
> > I have ReportViewer embedded on an aspx form, using local processing. The
> > report opens just fine, accepts parameter changes and renders correctly.
> > However, when I select an Export format and click Export, I get an "ASP.NET
> > session has expired" message with the following stack trace:
> >
> >
> > [AspNetSessionExpiredException: ASP.NET session has expired]
> > Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +335
> > Microsoft.Reporting.WebForms.ExportOperation..ctor() +24
> > Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +281
> > Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext
> > context) +34
> >
> > System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
> > System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> > completedSynchronously) +64
> >
> > I've been developing in VB and SQL for over 10 years, but I'm new to .Net
> > and Report Service. I've searched books and Web sites, and nothing I've
> > found mentions this problem or anything like it (which I'm sure means I'm
> > looking in the wrong place!).
> >
> > Thanks.
> >

Tuesday, March 27, 2012

Export database over the web?

Hi, i'm not sure if this is possible. I have an SQL Server database and a secure web server. I upload code via FTP but I don't have access to the database.

Users of my system login under various regions and record data based on their region. These users need to be able to download their data only into an Access database where they can run their own adhoc reports.

Is there a way whereby users can click a button on my aspx page that will pass a variable (user region) and allow them to download an access model or the data into an access model.

Thanks in advance for any help.

You could export the report to a csv. And then import the data into access.|||

Hi thanks for the reply.

Would the users be able to invoke this action and download the file. Users need to import the data into an MS Access database that they hold locally.

|||It would require some training on the users side. The users would export the information from the report into a CSV file and save it to their hard drive. You'd then have a form on the access database that would allow them to "upload" the file into access without having to get into the dirty details of importing.

Export Data to SQL File?

Hello,
I'm relatively new to SQL Server -- generally I use Access for my web
projects -- but I'm building a site for a client and they want an SQL
back-end, and I've got my tables built and queried from the ASP pages
just fine.
My question is this: how can I export the data from my SQL Server
database onto the customer's server while retaining the structure and
data. I've seen files with sql extensions that had both the CREATE and
INSERT statements, and I'm wondering if this might be the best method to
use.
I'd like the transfer to be as simple as possible so I won't have to
answer an array of questions about SQL Server that I probably won't be
able to. Any advice?
Thanks!
Jonathan
PS: I already have my copy of SQL Server for Dummies handy. :-p
PPS: Running SQL Server 2000 Personal Edition on a Windows 2000
Professional system.You can backup the database and restore it to their server
or you can detach the data and log file using sp_detach_db
and have them attach the database to their server using
sp_attach_db. You can find more info in books online as well
as in the following articles. You only need to follow the
sections on moving user databases:
Moving SQL Server databases to a new location with
Detach/Attach
http://support.microsoft.com/?id=224071
INF: Moving SQL Server 7.0 Databases to a New Server with
BACKUP and RESTORE
http://support.microsoft.com/?id=304692
-Sue
On Wed, 20 Oct 2004 20:24:52 -0400, "Jonathan S."
<spam@.jdspt.com> wrote:
>Hello,
>I'm relatively new to SQL Server -- generally I use Access for my web
>projects -- but I'm building a site for a client and they want an SQL
>back-end, and I've got my tables built and queried from the ASP pages
>just fine.
>My question is this: how can I export the data from my SQL Server
>database onto the customer's server while retaining the structure and
>data. I've seen files with sql extensions that had both the CREATE and
>INSERT statements, and I'm wondering if this might be the best method to
>use.
>I'd like the transfer to be as simple as possible so I won't have to
>answer an array of questions about SQL Server that I probably won't be
>able to. Any advice?
>Thanks!
>Jonathan
>PS: I already have my copy of SQL Server for Dummies handy. :-p
>PPS: Running SQL Server 2000 Personal Edition on a Windows 2000
>Professional system.|||YOu may encounter user/login mismatches in moving the database from one
server to another... Make sure you read the white papers Sue Mentioned
And one of these as well..
Moving SQL Server Databases
http://www.support.microsoft.com/?id=224071
Moving Databases between Servers
http://www.support.microsoft.com/?id=314546
Using WITH MOVE in a Restore to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465
How To Transfer Logins and Passwords Between SQL Servers
http://www.support.microsoft.com/?id=246133
Mapping Logins & SIDs after a Restore
http://www.support.microsoft.com/?id=298897
Utility to map users to the correct login
http://www.dbmaint.com/SyncSqlLogins.asp
How to Resolve Permission Issues When a Database Is Moved Between SQL
Servers
http://www.support.microsoft.com/?id=240872
User Logon and/or Permission Errors After Restoring Dump
http://www.support.microsoft.com/?id=168001
Disaster Recovery Articles for SQL Server
http://www.support.microsoft.com/?id=307775
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:5n7en01brh6gd2d0vekmbpbkgdrv4c12us@.4ax.com...
> You can backup the database and restore it to their server
> or you can detach the data and log file using sp_detach_db
> and have them attach the database to their server using
> sp_attach_db. You can find more info in books online as well
> as in the following articles. You only need to follow the
> sections on moving user databases:
> Moving SQL Server databases to a new location with
> Detach/Attach
> http://support.microsoft.com/?id=224071
> INF: Moving SQL Server 7.0 Databases to a New Server with
> BACKUP and RESTORE
> http://support.microsoft.com/?id=304692
> -Sue
> On Wed, 20 Oct 2004 20:24:52 -0400, "Jonathan S."
> <spam@.jdspt.com> wrote:
> >Hello,
> >
> >I'm relatively new to SQL Server -- generally I use Access for my web
> >projects -- but I'm building a site for a client and they want an SQL
> >back-end, and I've got my tables built and queried from the ASP pages
> >just fine.
> >
> >My question is this: how can I export the data from my SQL Server
> >database onto the customer's server while retaining the structure and
> >data. I've seen files with sql extensions that had both the CREATE and
> >INSERT statements, and I'm wondering if this might be the best method to
> >use.
> >
> >I'd like the transfer to be as simple as possible so I won't have to
> >answer an array of questions about SQL Server that I probably won't be
> >able to. Any advice?
> >
> >Thanks!
> >
> >Jonathan
> >
> >PS: I already have my copy of SQL Server for Dummies handy. :-p
> >
> >PPS: Running SQL Server 2000 Personal Edition on a Windows 2000
> >Professional system.
>|||Thanks very much for your responses and for the links. I'll definetely
be reading up on this.
I appreciate the help.
Thanks,
Jonathansql

Monday, March 26, 2012

Export data into a script as "insert into"s

Hello,

I am using a Web based front end to a SQL Server db installed at my host that only lets me import data into tables either manually (in a 'datasheet' view) or with a SQL query.

Does anybody know if I can export data from my local db as a script such as

insert into TestTable(Id, Name) values ("1", "Test1")
insert into TestTable(Id, Name) values ("2", "Test2")
.
.
.

... so that I can run this script on the Web front end and insert data into the db at my host?

Many thanks in advance.Here's a link to some stored procedures you might find useful. I think the DataAs InsCommand may be what you are looking for.

http://www.mssqlcity.com/Scripts/scrImpExp.htm|||Thanks for your help Fred.

That stored procedure mostly does the job but looks like it needs a few slight mods because some data types aren't implemented (such as text which is written out as 'None Yet')...

Friday, March 23, 2012

Export Access table into MS SQL server preserving Unicode characters?

Hi,

usually, I'm not using MS servers, but I have a big problem with a
Access table.

I should create a web application for a Historical Dipartment.
They have create a populated a Access database using unicode
compression field (for ancient language).

I would like to export this table into MySQL o Postgres, but it's
impossible because when I export this table in a .txt o cvs format the
unicode charaters have been "destroyed" for memory allocation problems
(cause Access use a compression tool for unicode fields).
Also with professional tools for dump Access to another DBMS.

I would to know if using a MS SQL server I can skip this problem cause
both MSQLserver both Access are Microsoft product.

Thank you ;)
Jdreamers_spa@.yahoo.it (JJ) wrote in message news:<1b641cf1.0402030348.1ca6bdd8@.posting.google.com>...
> Hi,
> usually, I'm not using MS servers, but I have a big problem with a
> Access table.
> I should create a web application for a Historical Dipartment.
> They have create a populated a Access database using unicode
> compression field (for ancient language).
> I would like to export this table into MySQL o Postgres, but it's
> impossible because when I export this table in a .txt o cvs format the
> unicode charaters have been "destroyed" for memory allocation problems
> (cause Access use a compression tool for unicode fields).
> Also with professional tools for dump Access to another DBMS.
> I would to know if using a MS SQL server I can skip this problem cause
> both MSQLserver both Access are Microsoft product.
> Thank you ;)
> J

You could use DTS or a linked server to get the data directly into SQL
Server, provided that you define the destination columns as a Unicode
data type (e.g. nvarchar). But you might want to post this in an
Access newsgroup, as exporting data to a file with Unicode characters
intact is presumably something that has been done before (and changing
database platform to resolve an import/export issue seems a little
drastic).

Simon

Monday, March 12, 2012

Experts only: SQL Server does not exist or access denied.

Hi,
I'm accessing MS SQL server standard edition using ASP.net 1.1 web applications
my site has traffic ranking 84,000 on alexa.com. all web applicationsare mounted on One sigle Application pool. I have developed
monitoring webservice for monitoring the runtime errors occured duringtransactions, where I came across below errors all the time. duringheavy traffic.
1. SQL Server does not exist or access denied.
2. General network error. Check your network documentation.
3. Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
First one is very important as Microsoft it self agree that it was bug in their products. How can I fix it.

http://support.microsoft.com/kb/328306

Client uses TCP/IP and Named Pipes.

I'm hoping to get it fixed using this thread.

Thanks,
Satalaj.

Have you checked the server loads on the machine that is running SQL during peak times?

I'm far from an expert on this subject, but it seems the server can't respond due to server load. How many concurrent users do you have during peaks?

Cheers!

/Eskil

|||

Yes, It is happening during peak load. How can I fix it.

Server DB size is 3GB and RAM 1GB. server uses 60% to 99% of RAM during peak load.

|||

Did you check the Eventviewer to see if your SQL Server Service is getting restarted/recycled during this peak loads that makes it unavailable for a few seconds/minutes.

|||

Hi urstop

If this is the case then all my webapplications should produce same erro, It is only happening for someweb applications mounted on one application domain.

|||

But are your other web applications also have lot of traffic. Because if the traffic is less for other applications then there are chances that during this error period we do not have any traffic coming to your other web applications. Just a thought.

|||I have written a webservice whichkeeps log of all error it gets called from webapplication if any erroroccured in web applications. Do you know how can I stop recycling ofthe SQL server. or Do I need to update the RAM on SERVER. if so howmuch RAM will be required for DB of size 3GB|||

You have mentioned that you have 1GB of RAM. I think that should be good enough for your DB size.

Also, does your eventviewer has events which indicate that SQL Service is getting recycled? Becuase it should not be a case where we are looking in a wrong areaSmile

|||

RAM/CPU limitations on your SQL server will usually result in slow queries during peak times and not error messages. Take a look at your page file usage and memory available to see if this might be the case. I would definately suggest adding a gb, 2gb should be plenty but extra never hurts.

Is the web server separate from the SQL server or are they on the same machine? If they are on the same separating the two might help as well.

|||

Hi Dustin, web and SQl server are separated. I'm going to see the log as per urstop suggession

Friday, March 9, 2012

Expects parameter which was not supplied....need help....

I wanted to add new record into two different tables. By using one web form...
Not so sure I coded it correctly. And I got this error trying to insert new record

" Procedure 'sp_insert' expects parameter '@.mid', which was not supplied. "

Isn't it i have include @.mid in my code ...??

<STORED PROCEDURES>
sp_insert

(
@.mid char(10),
@.status char(10),
@.name char(20),
@.dj char(20),
@.rank char(20),
@.nric char(14),
@.dob char(20),
@.age char(10),
@.add char(80),
@.school char(50),
@.hp char(10),
@.mp char(10),
@.email char(30),
@.pgname char(20),
@.relationship char(20),
@.contact char(10)

)
AS
insert into Table1(mid,status,name,date_joined,rank,nric,dob,age,address,school,house_phone,Mobile_phone,email,[P/G_name],[P/G_relationship],[P/G_contacts])
values (@.mid,@.status,@.name,@.dj,@.rank,@.nric,@.dob,@.age,@.add,@.school,@.hp,@.mp,@.email,@.pgname,@.relationship,@.contact)

insert into Table2 (name) values (@.name)

RETURN

<WEB FORM>
mycommand = New SqlCommand("sp_insert", mycon)
mycommand.CommandType = CommandType.StoredProcedure

Dim midpar As New SqlParameter("@.mid", SqlDbType.Char, 10)
midpar.Direction = ParameterDirection.Input
midpar.Value = Tb1.Text

Dim statuspar As New SqlParameter("@.status", SqlDbType.Char, 10)
statuspar.Direction = ParameterDirection.Input
statuspar.Value = ddl1.SelectedItem.Text

---
---
---Your webform code is wrong, needs to be something like this:

Dim sqlPar As SqlParameter= myCommand.Parameter.Add("@.mid", SqlDbType.Char, 10)
sqlPar.Direction = ParameterDirection.Input
sqlPar.Value = Tb1.Text

sqlPar = myCommand.Parameter.Add("@.status", SqlDbType.Char, 10)
sqlPar.Direction = ParameterDirection.Input
sqlPar.Value = ddl1.SelectedItem.Text


etc.
etc.
etc.