User Profile Using Sql+ Getting Data From Cookie
Sep 24, 2007
does anyone know how i can make it so you can view all the users in the database on a page and there names are clickable with a link and then shows there profile page which is basicly a text box that all users can edit there own.
i have a "users" table and mysite stores there username in a cookie called user for the session.
This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database) Help pleaseee
I have added one webpage designed in ASP.Net with C# and sql server 2005 as database. There is table for user registration in which there is a column for ProfileCreationDate the data type of that column is date time .
I would like to fetch data of those user who have created profile within 7 days. For getting desired result I am trying this query.
select Name ,Profession,ProfileCreationDate from tblRegistration where DATEDIFF ( Day , '" + System.DateTime.Now + "',ProfileCreationDate)<7 order by ProfileCreationDate DESC
System.DateTime.Now is a function for getting current date time in C#
The query is neither giving error nor giving desired result.
I have a user who cannot login to a .mdb when he is logged in to Windows, on his workstation or any other. No one can login to the .mdb when he is logged in to Windows.
He CAN login to the same .mdb if someone else is logged in to Windows, either on his workstation or any other.
When the user logs in he gets the following error:
MS SQL Server Login
Connection Failed:
SQL State: €˜28000€™
SQL Server Error 18456
[Microsoft][ODBC SQL Server Driver][SQL Server] Login failed for user €˜domainusername€™
I have removed and recreated the ODBC Connection while he is logged in. I have tried changing the trusted login to administrator (in the window that pops up when he fails to connect).
He has the permissions he needs to the .mdb because he can login under anyone else€™s profile.
I tried copying his profile to a brand new user and ended up with the same result.
This leads me to wonder if there is some corruption in one of his profile€™s .dat files or ???
This is the boss€™ account and he does not want to be given a new username and profile€¦
Microsoft SQL Server 2000 - 8.00.760 (Intel X86)
Running on MS Windows 2003 Server Standard SP1
All workstations are XP SP2 with MS Access 2003 SP2 (from Office Pro distro)
We use roaming profiles. All systems within the same physical and logical network and domain.
Any help you can provide will be greatly appreciated.
Please let me know if there is any additional information you need.
Could somebody please help me out? I'm running Windows 2000 on my laptop. I opened a new user account and gave it administrative privilegies. I copied the administrative profile to the new account and everything seemed to work except when I tried to open any office application a dialogue appeared prompting me to place the Windows 2000 office CD rom in the drive. Why has this happened? How can rectify this problem since I don't have the CD rom.
after i login, i should be able to see the login person's profile, and edit it. anyone know how to do this?currently i am using grid view to display the profile, and created a store procedure in database ALTER PROCEDURE [dbo].[select_customer_by_login] -- Add the parameters for the stored procedure here(@Username nvarchar(50))AS SELECT C.CustomerName, C.TFN, C.Address, C.City, C.State, C.PostCode, C.Phone From dbo.Login L, dbo.Customer C Where L.CustomerID = C.CustomerID and L.UserID=@Username; @Username is the login account when people login. the error output is Procedure or Function 'select_customer_by_login' expects parameter '@Username', which was not supplied.
Hello I have a report i want to cache each night. To make this possible, we do not use parameters but use filters based upon de user that is executing the report. So we can cache the report the first time any user executes it and the same report is already cached for all users becasuse the security is based on filters, not in query parameters.
When i try to schedule it, i get the message: "user profile dependencies and cannot be run unattended rsHasUserProfileDependencies"
Although user variable paramter is not used in the query and it is only used in the filter when any user views the report RS dont allow me to schedule it.
How can I schedule this report to be executed all night unattended ?? The user is not a query parameter so it should allow it.
We have a previous SQL 2012 cluster that emails us when a new database is added. I am unable to figure out why we get this error any time we add a new database to it, and also it prevents us from adding a new availability group to this cluster because of this error.
I also am unable to figure out what profile it is talking about as this was setup before me and I am not a DBA.
I put HttpWebRequest in a CLR so I can call website in my SQL. In same calls, I need pass cookies from the previous call to the next call. So I am thinking I can do this in two ways:
1, store the cookiecontainer somewhere , but not sure if CLR allow me to do that ,
2, return the cookiecontainer, and send it to the next call from SQL, this way I need use cookie string, is there a function to serialize a cookiecontainer?
i created a cookie as follows HttpCookie myCookie = new HttpCookie("Portal"); myCookie["EMail_ID"] = Email_ID;myCookie["Role"] = Role_ID.Value.ToString();myCookie.Expires = DateTime.Now.AddMinutes(1); Response.Cookies.Add(myCookie);
Now i have to take the"EMail_ID" as input parameter in sqldatasourse.
Hi,is it possible to build a SQL SELECT COMMAND with a Cookie Request in between a IF ELSE Loop?My idea is to change the SQL SELECT COMMAND depending to a cookie.Is there any help or tutorial that somebody can suggest? caspar.netcologne, germany, EU
I am trying to setup custom forms authentication in Reporting Services.
I have followed the UFAIRS sample. I have the site running, reporting services running, and I have a page where I can input my login information.
I can debug the code- and I get to this section of code:
Protected Overrides Function GetWebResponse(ByVal request As WebRequest) As WebResponse
Dim response As WebResponse = MyBase.GetWebResponse(request)
Dim cookieName As String = response.Headers("RSAuthenticationHeader")
' If the response contains an auth header, store the cookie
If Not (cookieName Is Nothing) Then
Utilities.CustomAuthCookieName = cookieName
Dim webResponse As HttpWebResponse = CType(response, HttpWebResponse)
Dim authCookie As Cookie = webResponse.Cookies(cookieName)
' If the auth cookie is null, throw an exception
If authCookie Is Nothing Then
Throw New Exception("Authorization ticket not received by LogonUser")
End If
' otherwise save it for this request
Me.AuthCookie = authCookie
' and send it to the client
Utilities.RelayCookieToClient(authCookie)
End If
Return response
Notice the line: Dim cookieName As String = response.Headers("RSAuthenticationHeader")
Basically the cookie name is null after that, and therefore it processes no further and I never get a cookie and I can never authenticate. Any thoughts as to what I am doing wrong?
Also, this is on a test box, so I don't have SSL capabilities. Unless there is a way to "emulate" SSL, I pretty much don't know if this works without SSL, or if this is causing the problem. We have environments that use SSL, but I do not have access to it at the moment- I will have to do additional work to get that up and running.
Hello, I have run into a strange problem with RS 2000. I have a base class that will call a reporting server web service, render a report to pdf, then write the report output to the stream. This has worked fine for me for reports.
However, when I render a graph to pdf, I get the following exception:
I only get this exception in our staging environment, not locally.
Here is a code snippet from the ReportServerProxy class, but it is pretty textbook according to the MSDN samples..
public class ReportServerProxy : ReportingService { protected override WebRequest GetWebRequest(Uri uri) { HttpWebRequest request; request = (HttpWebRequest)HttpWebRequest.Create(uri); // Create a cookie jar to hold the request cookie CookieContainer cookieJar = new CookieContainer(); request.CookieContainer = cookieJar; Cookie authCookie = AuthCookie; // if the client already has an auth cookie // place it in the request's cookie container if (authCookie != null){ request.CookieContainer.Add(authCookie); } ...
}
As I said, I can run reports one after another without issue, graphs are causing me problems.
Hi all, Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Login failed for user ''. The user is not associated with a trusted SQL Server connection.Here is my code and i am using windows authentication: <%@ Import Namespace="System.Data" %><%@ Import Namespace="System.Data.SqlClient" %> <% Dim connAkaki As SqlConnection Dim cmdSelectAuthers As SqlCommand Dim dtrAuthers As SqlDataReader connAkaki = New SqlConnection("Server=.SQLEXPRESS;database=akaki") connAkaki.Open() cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki) dtrAuthers= cmdSelectAuthers.ExecuteReader() While dtrAuthers.Read() Response.Write("<li>") Response.Write(dtrAuthers("Firstname")) End While dtrAuthers.Close() connAkaki.Close() %>
Hi all hope some one can help - please bear with me new to this Basically I have had to change pc's so I copied and pasted my ASPNET.MDF and LDF from my old pc to new PC including webpages/apps etc.. created. However now all I get is "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path """" Just don't understand what permissions the db should have, does it need to match the SQL Express owner...
I installed my asp.net 2.0 web application and sql express june editon on my windows 2003 server.When the application tries to reach the database i am getting the following error"Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed."I can understand that it has something to do with user right but more than that I am pretty lost. Can anyone translate this error for me and give me some tips on what do to.I checked first the user running the sql express service and saw it was the NETWORK SERVICE user. I changed it to be the local system account but that did not make any difference. The application is running just fine on my local computer(Win XP sp2). This one has SQL express April edition though.
Hi all Recently i was asked to design and implement an On-line WebSite for a Shop Store.I decided to define some Category for this Shop's Products such as MP3-Players,Mobiles,Televisions,Monitors and so on....and then Assign each product to a certain Category.Something like Amazon.Com , So i designed my Category and Product Table as follow: Category Table----------------CatID int Primary-KeyCatDesc varchar(50) Product Table-------------ProductIDProductDescCatID After that i noticed that each category has its own Fields and Property and sometimes somecategories have common Fields for example , Price ,Color are two Common Property or Fieldsfor all Categories that i mentioned earlier But , Size is a special property for only[Monitor] or [Television] Categories and isn't useable for [Mice] or [KeyBoard] categories for example. So i Added a table for Keeping each category's Fields as follow: Category Fields Table---------------------FieldID intCatID intFieldDesc varchar(50)FieldType tinyint --> 0=Numeric 1=String 2=Boolean... After that i should save each Field's Value somewhere for each product so i added thefollowing Table(Product-Field-Value Table) for this purpose: Product-Field-Value Table-------------------------ProductIDFieldIDValue So far every thing is ok But i've faced with a new issue!!!.As you have realized so far , each productbelongs to certain category and each category has its own Fields List , in the other hand one category maybe has only 3 to 6 Fields but another Category might has 10 or more fields,So my problem here is when user wants to Add new product to Databse ,how should i get the Field's value for each product in an ASPX page ?in the other hand i'm dealing with a dynamic structure as you can see, so how should i Render the appropriate User Entries for getting Values of each product dynamically and then Saving these values in the Database? what Asp.Net Components should i use for this purpose? Could anyone help me? Thanks in advance.Kind Regards.
Hi, This is Raj..could anyone pls explain the sql profile and how we will set the row-level locks as a dba.Sorry it is a silly question but sometimes these questions are bugging my mind. Thnak u in advance.
I use the default database called "ASPNETDB.mdf" that is automatically created in Visual Studio Express 2005.... There is an table called "aspnet_Profile" that holds the profile-properties, UserID etc. There is also another table called "aspnet_Users" that holds all usernames, UserID etc... No to my problem: I have a SqlDataSource-control and want to select all users that have the property profile.Color = "Blue".... How can I write the SQL-part for that?
I am using a SqlDatasource and need to set a SelectParamter to the ProviderUserKey (The GUID of the user when Profiles are enabled) Can anyone tell me whether it is possible and How? I am currently using the session state to store it in and then using the session=... to get the value into the parameter. Is there a direct way of passing this value into a SelectParameter when using a SqlDataSource? Thanks in advance.
Hi, Is it necesarry that to run SQL Mail, you need MS Exchange Server as the mail server? Our mail server is MDaemon 2.8. Can anyone tell me what would be the mail profile for MDaemon? TIA Wilson
Is there any way that I can use an ASP.NET profile variable in a T-SQL parameter? I need to base a query on the current ASP.NET profile variable for purposes of creating a report. Thanks Deon
Hello.When I create a user at the ASP.NET database, I need to insert more fields than the defaults, and I do it like this: Dim customProfile As ProfileCommon = ProfileCommon.Create(CreateUserWizard1.UserName, True) customProfile.telephone = (CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("TelephoneText"), TextBox)).Text(telephone example)Those data are inserted at the DB at the aspnet_Profile table, in the fields PropertyNames & PropertyValuesString, but they are saved together (see image above)
I want to separate those properties in the GridView as long as each property appears in a column, is it possible? Thank you very much, i'm expecting your answers.
Hi, I use the Table Profile Provider: http://www.asp.net/downloads/sandbox/table-profile-provider-samples/ When I call for example: Profile.FirstName does this access the DB every time this call appears in my code? Or all the profile is loaded to the cache when the user first loggs on? thanks
I had a profile element named "Country", however, I want it to be named "CountryId". I can change this in the web.config with no problems, but then I need to update the code manually any place Profile.Country is referenced. Also, it seems I would have to write some SQL to update all the values in the profile table from Country to CountryId. Is there an easier way to do this? I'm using Visual Studio 2005 and SQL Server Express 2005.Thanks,Wes
Hi all. Quick question. I'm using VS2005, C#, aspx page.I'm creating a Profile to store login and password. That part is working... I can call the values (and display them) using this code <%= Profile.login %> and <%=Profile.password %>Now I want to create a Grid View that will connect to the SQL db, see if the login and password value stored in the Profile match that of ones in the SQL db. So if the profile is login: bob password: dog, the grid view will output all application ID numbers associated with the bob and dog. Here is the SQL code...trying to use the <%=Profile.login %> as a filter on the login and password doesn't seem to work...Can anyone tell me what I'm doing wrong? How can I reference a value in the Profile within an SQL statement?SELECT ApplicationStatus.Description, Customer.CustomerName, Application.ApplicationDateFROM Application INNER JOIN ApplicationStatus ON Application.ApplicationStatusID = ApplicationStatus.ApplicationStatusID INNER JOIN Customer ON Application.ApplicationID = Customer.ApplicationID INNER JOIN [User] ON Application.DealerId = [User].UserIdWHERE ([User].LoginId = '<%= Profile.login %>') AND ([User].LoginPwd = '<%= Profile.password %>') AND (ApplicationStatus.Description = 'Pending')
I have created a profile object which is a list to store photoId into an array. (kinda like a shopping cart) which will persist in the list untill manually deleted by the user.I want to use the photo Ids stored in this object in my profile as a parameter for an sql select statement to be displayed into a data grid. What is the best way to go about this... and suggestions... I know you can use a profile property as a parametere in a sqldatasource but Im not sure how to do this for an array.HELP
I created a new MAPI profile on the server, and it seems to work fine with Outlook. I also dropped the previous default MAPI profile.
Now, when I go to the EM SQLAgent Properties, the only MAP profile offered in the SQLMail drop-down is the old, deleted profile. Also, only the old profile comes up with xp_get_MAPI_profiles.
How can I get SQLAgent to recognize that I've set up a new mail profile?
We have a delay between the login and the first statment after the login. I see in the profiler trace that this delay is due to an eventClass "SQLTransaction" and the only information I have about it is that the objectName is "UpdateLoginStats". It is very interesting but this event usually takes 0 time, but when run from one specific user, it takes 10-1000 MS.