Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Monday, March 19, 2012

Logon Problem - I am an idiot "ID 10 T"

Tried using webmatrix code builder to simply bind a web grid to a sql table.
Works great in WEbMatrix, but when I move the code to Visual Studio.VB,
I get a logon error when the code is run.

Any Help is Greatly Appreciated... I am stuck....

Here is the code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

DataGrid1.DataSource = GetCustomers()
DataGrid1.DataBind()

End Sub

Private Function GetCustomers() As System.Data.SqlClient.SqlDataReader

Dim connectionString As String = "server='localhost'; trusted_connection=true; Database='ASPExamples'"
Dim sqlConnection As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(connectionString)

Dim queryString As String = "SELECT [Customers].* FROM [Customers]"
Dim sqlCommand As System.Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand(queryString, sqlConnection)

sqlConnection.Open()
Dim dataReader As System.Data.SqlClient.SqlDataReader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)

Return dataReader

End Function

End ClassProblem is solved,

It was SQL Server Security, I had to add a user <Machine Name\ASPNET>
..and explicitly give permissions for SELECT, UPDATE, Etc...

Funny, but the same exact code in WEB MATRIX did not require this to be done.

Any insight on this please respond....

Logon Failure when executing report

I'm using RS 2005. I created a report that works fine in Visual Studio
and I can deploy it to the report server without any errors. But when
I try to execute the report in the Report Manager or by using a URL, I
get the following error: Logon Failed: unknown user name or bad
password. I have the default security settings for the report (Builtin
Administrators Group only). I am logged on as a domain administrator
when I try to run the report. What logon is the error referring to?
Thanks in advance for any help.How do you authenticate against your datasource?
What happens if you try it from a different computer?
If you are using NT authentication in your datasource, check what user you
are running the report as. One way is by adding your report site to Trusted
SItes in IE (Internet Options -Security) and then set Always prompt for
username and password in the Security Settings.
Kaisa M. Lindahl
"dba56" <lvigorito@.berdonllp.com> wrote in message
news:1137038010.522621.70160@.o13g2000cwo.googlegroups.com...
> I'm using RS 2005. I created a report that works fine in Visual Studio
> and I can deploy it to the report server without any errors. But when
> I try to execute the report in the Report Manager or by using a URL, I
> get the following error: Logon Failed: unknown user name or bad
> password. I have the default security settings for the report (Builtin
> Administrators Group only). I am logged on as a domain administrator
> when I try to run the report. What logon is the error referring to?
> Thanks in advance for any help.
>|||Thanks for the quick response. It turned out to be the execution
account. Don't know why it needs to log on with the execution account
when executing a report. But once I entered the correct login and
password for the execution account in the configuration utility,
reports run without any glitches.|||Hi
I've the same problem when executing my report from the Report Manager. It
works fine in the development tool though.
I run my report under almost the same conditions as you did, i.e
- as a local admin on the test server (Report Service and source database on
the same machine, the development tool to)
- The data source is set the SQL authentication and I have gone as far as
using the sa login
- In the config manager I have updated the Sevice to run as a local user
which is a member of the admin group and the two ReportinServices groups.
I still get the "log in failure". What more is there to do?
/Jesper
"dba56" wrote:
> Thanks for the quick response. It turned out to be the execution
> account. Don't know why it needs to log on with the execution account
> when executing a report. But once I entered the correct login and
> password for the execution account in the configuration utility,
> reports run without any glitches.
>

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.

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

Friday, February 24, 2012

Login problem publishing to my machine from VS2005

So I'm trying my first Report project from Visual Studio 2005 and I
get a good connection string and run the project. When I run it it
tries to deploy to http://localhost/reportserver, and asks for a login
and password. But nothing works. I don't even think I have a password
set up for reporting services on this machine.
Once it fails and I run it again, it runs fine in local mode on my
machine. Does anyone know what is going on here?So this never happens to anyone else? Very weird. Maybe it's time to
just format the damn thing and install everything again.