Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Wednesday, March 28, 2012

long running queries quit - audit logout

I have a web based application that launches sql queries using ADO from
ASP/VBScript. Typically 2 - 10 queries are executed in a loop, and the
result sets are sent off to Crystal Reports at the end of the run with the
report being displayed in a browser window. In general this all works well
is has been very reliable.
Lately I've been having trouble with some of these queries on databases that
have gotten quite large (25 - 40G) but only a couple of the tables have
rowcounts in the tens of millions, most are relatively small. The behavior
is that the first query runs, sometimes for up to 90 minutes, seems to
complete, and then the pid is gone. Looking at the profile trace, I can see
that the query executed nearly 13 M reads with a duration of over 90
minutes. The line following the SQL:BatchCompleted event is Audit Logout,
and thats the last trace of the process. Under "normal" operation, the next
query would start and they would all run until the loop is complete. I've
seen this now with 2 completely different sets of queries, on 2 different
dbs, yet the symptoms are the same. It completes a very simple query that
returns a single datetime value. Then the first "real" query runs, anywhere
from 60 - 90 minutes or more, and then the process goes away.
It seems as if I've reached some threshold or internal timeout. I have the
connection time and query timeouts set to very large values (1000 minutes),
so it's not that.The client process is of course IIS. This is running SQL
Server 2000 SP3, NT 4.0, IIS 5.5.
I have had sets of queries that have taken as long as 3 hours to complete,
but each individual query probably never exceeded 45 minutes in duration.
Can anyone think of what is causing this to happen -- why does the pid go
away after the first query completes? Is there some other internal timeout
somewhere that I'm running into?
Any advice is appreciated,
-GaryYou might be experiencing lock_timeout. See if it helps:
http://msdn.microsoft.com/library/en-us/tsqlref/ts_set-set_1yr8.asp
"Gary" <gld@.hotmail.com> wrote in message
news:bisSc.243431$IQ4.52808@.attbi_s02...
> I have a web based application that launches sql queries using ADO from
> ASP/VBScript. Typically 2 - 10 queries are executed in a loop, and the
> result sets are sent off to Crystal Reports at the end of the run with the
> report being displayed in a browser window. In general this all works well
> is has been very reliable.
> Lately I've been having trouble with some of these queries on databases
that
> have gotten quite large (25 - 40G) but only a couple of the tables have
> rowcounts in the tens of millions, most are relatively small. The behavior
> is that the first query runs, sometimes for up to 90 minutes, seems to
> complete, and then the pid is gone. Looking at the profile trace, I can
see
> that the query executed nearly 13 M reads with a duration of over 90
> minutes. The line following the SQL:BatchCompleted event is Audit Logout,
> and thats the last trace of the process. Under "normal" operation, the
next
> query would start and they would all run until the loop is complete. I've
> seen this now with 2 completely different sets of queries, on 2 different
> dbs, yet the symptoms are the same. It completes a very simple query that
> returns a single datetime value. Then the first "real" query runs,
anywhere
> from 60 - 90 minutes or more, and then the process goes away.
> It seems as if I've reached some threshold or internal timeout. I have the
> connection time and query timeouts set to very large values (1000
minutes),
> so it's not that.The client process is of course IIS. This is running SQL
> Server 2000 SP3, NT 4.0, IIS 5.5.
> I have had sets of queries that have taken as long as 3 hours to complete,
> but each individual query probably never exceeded 45 minutes in duration.
> Can anyone think of what is causing this to happen -- why does the pid go
> away after the first query completes? Is there some other internal timeout
> somewhere that I'm running into?
> Any advice is appreciated,
> -Gary
>
>|||Thanks for the tip. I checked a server and it's returning -1 (infinite) for
this. I'm thinking that the problem is the client connection to the database
dropping sometime during the processing of a query, and when the statement
complete event occurs, SQL detects that the connection is gone and therefore
the audit logoff event.
"oj" <nospam_ojngo@.home.com> wrote in message
news:O7lkZQ$fEHA.3632@.TK2MSFTNGP09.phx.gbl...
> You might be experiencing lock_timeout. See if it helps:
> http://msdn.microsoft.com/library/en-us/tsqlref/ts_set-set_1yr8.asp
>

Wednesday, March 21, 2012

LogOnInfo is not a member of Schools.Table.

Hello,

I am gettign an error while I am using Crystal Report 9 with asp.net 1. Actually, till yesterday I it was working fine and today, I have changed the position of my computer. I don't know what happened. Please help.

Error is

1) C:\Schooloutlook\FormFile\Report\MForm7.aspx.vb(77): 'LogOnInfo' is not a member of 'Schools.Table'.

2) C:\Schooloutlook\FormFile\Report\MLocalDensity.aspx.vb(118): 'Location' is not a member of 'Schools.Table'.

Thanks
CeemaOpen the report and Do verify database

Monday, March 12, 2012

Logo.jpg won''t appear on report

Hi all,

I have a VS2005 / SQL Server 2005 report that looks fine when I run it from Visual Studio.But when a user clicks a button on my app (ASP 2.0 / VB 2005) and I have it go to the report manager site (http://servername/Reports/Pages/Folder.aspx) so they can run the report (the only report in that folder) the logo appears on the screen-rendered report as only a box w/ an "X" in it.The rest of the report is fine.

Logo.jpg is part of the project; I've tried dragging it directly to the header section, and dragging an Image control from the Toolbox to the header and going thru the wizard to specify Logo.jpg (trying both the "Embedded - the image is stored as part of the report" option and the "Project - the image is stored as part of the project" option.)The jpg is already the correct size, about 2" x 1".

If anyone has any ideas I'd be very grateful... thanks in advance.

- LenexaKS

Host the image on a website and link to it.|||That worked (once I renamed the logo jpg file to not have spaces in the name)... thanks!|||Duh, of course you can have spaces in the JPG name... I just hadn't uploaded the report from VS to the report manager before that attempt.

Logins to the website doesnt work after DB backing up and restoring

Hi all, plz help...

I have an asp.net login control on my website;

my users are stored in a SQL DB;

The problem is when I back-up my DB from my PC and restore it to my server; the logins doesn't work anymore. I mean the user I've created on my PC can't login on the website on the internet...

Thanks a lot...

I've had this same problem. If you delete the user from the database and re-add it, it will work. Does anyone know why this happens? Is there a numeric ID the server uses for the user name?|||

Thank god someone else had the same problem; it's been so long that I'm working on it that I allways thought it only happens to me..

Yes if I delete and then re-register same user it works but I can't say to my users please re-register:))

is there any way to programmaticaly do it? or any REAL solution??

How did you handle that? I mean does it work now?

|||Wait, when you say they are stored in a sql db, do you mean they are stored in a table or they are sql logins of the database? This happened to me when I had a user with a sql login.|||Backup/Restore does not transfer the logins. You need to generate the script to create the logins and run it to set the permissions after your restore.|||

They are in a table..

I'm not talking about SQL logins. Logins are aspnetdb logins for a web site. I mean users inside the aspnetdb_Membership and aspnetdb_Users tables...

|||The users may be in a table. You still need to run a script to SET the permissions for the users.|||

What script s that?

Users (I mean the user connecting by internet) already got permissions and re-mapped?

|||

The user exists in your table but he/she does not yet have the permissions to execute any scripts.

Check out BOL for sp_addlogin, sp_grantlogin, sp_defaultdb, etc.. If you are not sure of the scripts, try generating the script for existing logins.

|||

Hi,

I think the answer is hidden somewhere over there I didn't even realised that there could be that much stored procedure and functions... Anyways I found that sp's but I didn't understand anything:) how can I work em out from a query? Also I found "dt_validateloginparams" could that also be related?

Actually theres a parameter HasAccess like below:

EXEC

%%LocalLogin(Name= @.loginame).SetAccess(HasAccess= 1)

I think this is the key line but where does it store this HasAccess info? I couldn't find it in the tables?

Thanks a lot...

|||

In Enterprise Manager, right click on the DB -> All Tasks -> Generate Scripts -> Options tab -> select "Script SQL Server Logins" -> Back to General tab -> Click on Preview.

You can either paste the code into a stored proc and call it from your application or parameterize the scripts and use it for any login...as creative as you can get...

|||

Hi;

I'm sorry; I'm as lame as I couldn't figure it out. Maybe you already told me the answer but I don't know...

Could you please tell me what to do:)

Thanks a lot..

|||I just did. Thats the best I can do.|||Ok man; thanks.. I'll try..|||http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx

Friday, March 9, 2012

Login with different Roles

Hello readers

I have a problem with the following:

I made a login page in Visual Web Developer 2005 and I used the ASP.net Configationtool in the Website menu. Made some couple test accounts to login and made a role: "Beheerders". Made 1 of my test accounts a "Administrators".

So my problem is when I log in with the account with the "Beheerders" role, i go to the page of the "normal user". I tried to look in many sites, I could find some nice aid but not 100% the one that could solve my problem.

This is my code i programmed in the seperatefile of Login.aspx

Imports System

Imports System.Data

Imports System.Data.SqlClient

Imports Login

PartialClass Login

Inherits System.Web.UI.Page

ProtectedSub Login1_LoggedIn(ByVal senderAsObject,ByVal eAs System.EventArgs)Handles Login1.LoggedIn

Dim userinfoAs MembershipUser = Membership.GetUser(Login1.UserName)

Dim UserRol()AsString

UserRol = Roles.GetRolesForUser(userinfo.UserName)

If (Roles.IsUserInRole("Beheerders") =False)Then

Response.Redirect("~\Index.aspx")

EndIf

EndSub

ProtectedSub Login1_LoggedIn()

EndSub

ProtectedSub Login1_LoginError(ByVal senderAsObject,ByVal eAs System.EventArgs)Handles Login1.LoginError

'Parameters instellen voor InvalidCredentialsLogDataSource

InvalidCredentialsLogDataSource.InsertParameters("ApplicationName").DefaultValue = Membership.ApplicationName

InvalidCredentialsLogDataSource.InsertParameters("UserName").DefaultValue = Login1.UserName

InvalidCredentialsLogDataSource.InsertParameters("IPAddress").DefaultValue = Request.UserHostAddress

InvalidCredentialsLogDataSource.InsertParameters("Password").DefaultValue = Login1.Password

'Er was een probleem bij het aanmelden

'Nakijken of gebruiker bestaat in de databank

Dim userInfoAs MembershipUser = Membership.GetUser(Login1.UserName)

If userInfoIsNothingThen

'Ongeldige gebruikersnaam...

LoginErrorDetails.Text ="Geen gebruiker met naam """ & Login1.UserName &""" in de databank !"

Else

'Nakijken of gebruiker Lockedout of Approved is

IfNot userInfo.IsApprovedThen

LoginErrorDetails.Text ="Uw account is nog niet goedgekeurd!"

ElseIf userInfo.IsLockedOutThen

LoginErrorDetails.Text ="Uw account is geblokkeerd wegens te veel mislukte aanmeldpogingen!"

Else

'Het wachtwoord was verkeerd

LoginErrorDetails.Text ="Verkeerd wachtwoord - """ & Login1.Password &""""

EndIf

EndIf

'Record wegschrijven naar datasource

InvalidCredentialsLogDataSource.Insert()

EndSub

EndClass

Thanks for your help.

Regardings

Griffin1987

I believe your problem here is that in the loggedIn event, the cookie is not actually set yet. To get the name of the user, use the name from the control which I think is

login1.UserName

Wednesday, March 7, 2012

Login to SQL Database

Hi,

I'm trying to login to SQL server for ASP .NET and I receive this message:
< Login Failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection>
I'm working on intranet and we have a web sence in the company network

When I connect from VB .NET I don't have any problem, the only problem is between SQL and ASp.NET

Any help please,

ThanksMake sure the application in IIS does not allow anonymous access, just Integrated Windows access. That is usually what has caused this problem for us.

Friday, February 24, 2012

Login problem: MSDE database from ASP.Net

I have created an MSDE database and successfully used it with an VB.Net
program on my desktop. Works great.
I have just begun learning ASP.Net. I created another MSDE database. But I
can't get past the login problems. "Predict" is the name of the database.
"GARY" is the Windows user account name. The error message is as follows:
Cannot open database requested in login 'Predict'. Login fails. Login failed
for user 'GARY\ASPNET'.
I used the following 2 connection strings. Neither works.
data source=(local)\VSdotNET;database=Predict;integrate d security=true
workstation id=GARY;packet size=4096;integrated security=SSPI;data
source="GARY\VSDOTNET";persist security info=False;initial catalog=Predict
Does anyone know what MSDE might be looking for here?
hi Gary,
Gary Frank wrote:
> I have created an MSDE database and successfully used it with an
> VB.Net program on my desktop. Works great.
> I have just begun learning ASP.Net. I created another MSDE database.
> But I can't get past the login problems. "Predict" is the name of
> the database. "GARY" is the Windows user account name. The error
> message is as follows:
> Cannot open database requested in login 'Predict'. Login fails. Login
> failed for user 'GARY\ASPNET'.
> I used the following 2 connection strings. Neither works.
> data source=(local)\VSdotNET;database=Predict;integrate d security=true
> workstation id=GARY;packet size=4096;integrated security=SSPI;data
> source="GARY\VSDOTNET";persist security info=False;initial
> catalog=Predict
> Does anyone know what MSDE might be looking for here?
you have to grant the account trying to log in (GARY\ASPNET) login
privileges as long as granting hin db access to the required databases..
as you can see from the raised error, using WinNT trusted authentication via
asp, you are not using the account you are logged in with, but the account
IIS is running on..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:3jdk15Fp8sp6U1@.individual.net...
> hi Gary,
> Gary Frank wrote:
> you have to grant the account trying to log in (GARY\ASPNET) login
> privileges as long as granting hin db access to the required databases..
> as you can see from the raised error, using WinNT trusted authentication
> via asp, you are not using the account you are logged in with, but the
> account IIS is running on..
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
Thanks Andrea. I am using MSDE and not SQL Server. As I understand it,
MSDE does not come with comprehensive administration tools. I can't figure
out how to grant access using MSDE. Are you aware of any tools I can
download or pay for without buying SQL Server, in order to grant database
access to a Windows user account?
|||hi Gary,
Gary Frank wrote:
> Thanks Andrea. I am using MSDE and not SQL Server. As I understand
> it, MSDE does not come with comprehensive administration tools. I
> can't figure out how to grant access using MSDE. Are you aware of
> any tools I can download or pay for without buying SQL Server, in
> order to grant database access to a Windows user account?
you can use the command line tool, oSql.exe, provided with MSDE, like
described in
http://support.microsoft.com/default...EN-US;q325003, or you can
have a look at a free prj of mine, available at the link following my
sign... other tools,, both free and commercial, are listed at
http://www.microsoft.com/sql/msde/partners/ and/or
http://www.aspfaq.com/show.asp?id=2442..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.14.0 - DbaMgr ver 0.59.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

Monday, February 20, 2012

Login Page Using SQL DB

I apologize because this question is probably so amazingly simple it sounds retarded, but I am a 100% newbie to ASP.NET --

I am using WebMatrix to create an ASP.NET login page (coding in VB), and I have a SQL server with a table in it called "LoginInfo". That table has three fields, "PrimaryKey", "UserID" and "PIN".

Basically, the goal is that the user goes to the page and enters their UserID and PIN into two different boxes and then pushes a button and it logs them into the page. My problem is, I have the UserID/PIN text boxes, I have the button, I have the SQLDataConnection (I just dragged the table from the Database onto the page and it made it for me), but I don't know what to do at all now.

How do I have the UserID text box check against the UserID's pulled from the table in the SQL server, and how do I have the PIN numbers check against the PIN numbers pulled from the SQL table, and then if they match up let the user into the site?

I'm sorry if this is a lengthy question to answer or if it is so simple its irritating, as I said I am a complete newbie.Have you gone through theASP.NET Web Matrix Project Guided Tour? There is a section called "Build an End-to-End Application" which containsCreate Login page that should help you.

Terri|||Thanks a TON tmorton, you're the best. This is a great resource I hadn't known about. I just read the entire thing for the login page and it's excellent. I will be reading many of the other tutorials also.

Thanks a million!|||There are lots of other resources for ASP.NET Web Matrix, and here are 2 more free ones that should not be missed:

Inside ASP.NET Web Matrix, which is a .PDF file containing a free online book by Alex Homer and Dave Sussman.

The .NET Show: ASP.NET Web Matrix with Microsoft's Scott Guthrie and Nikhil Kothari.

And also, there is a forum here specifically for ASP.NET Web Matrix:view forum 30

Glad to help!

Terri

Login Page just refreshes with ASP.NET 2.0 Login Control

I am try to login using the ASP.NET 2.0 Standard Login Control. When I enter the correct userId/Password and hit the Login button, the page just refreshes, no error is displayed. But if I enter wrong userid/password..it give me an error.

Also I check the Membership.ValidateUser() returns true, that means the user is validated, but still I am able to redirect to ReturnURL.?

Is there something wrong with the Authentication, or Creating a cookie. Can somebody shed some light on this,

I have the following machine configuration

Windows XP Pro Service Pack2
IIS 5.1
SQL Server 2000
Visual Studio 2005
DISABLE ANONMYOUS ACCESS IN IIS
ENABLE WINDOWS AUTHENTICATION

I am getting the following output :

Membership.ValidateUser(Login1.UserName, Login1.Password) : - True
HttpContext.Current.User.Identity.Name : - // is blank
User.Identity.IsAuthenticated :- False
User.Identity.AuthenticationType :- // is blank

NOTE : The applicationName is same in web.config as well as in the aspnet_Applications table in SQL Server 2000 membership database.

Do you have an error logged in the SQL Server error log file (name starts with ERRORLOG)?

If not, then you should post the question on an ASP forum.

Thanks
Laurentiu

Login Page just refreshes with ASP.NET 2.0 Login Control

I am try to login using the ASP.NET 2.0 Standard Login Control. When I enter the correct userId/Password and hit the Login button, the page just refreshes, no error is displayed. But if I enter wrong userid/password..it give me an error.

Also I check the Membership.ValidateUser() returns true, that means the user is validated, but still I am able to redirect to ReturnURL.?

Is there something wrong with the Authentication, or Creating a cookie. Can somebody shed some light on this,

I have the following machine configuration

Windows XP Pro Service Pack2
IIS 5.1
SQL Server 2000
Visual Studio 2005
DISABLE ANONMYOUS ACCESS IN IIS
ENABLE WINDOWS AUTHENTICATION

I am getting the following output :

Membership.ValidateUser(Login1.UserName, Login1.Password) : - True
HttpContext.Current.User.Identity.Name : - // is blank
User.Identity.IsAuthenticated :- False
User.Identity.AuthenticationType :- // is blank

NOTE : The applicationName is same in web.config as well as in the aspnet_Applications table in SQL Server 2000 membership database.

Do you have an error logged in the SQL Server error log file (name starts with ERRORLOG)?

If not, then you should post the question on an ASP forum.

Thanks
Laurentiu