Sql Server 2005 - Modify Query "log-in User Detail Should Also Display With The Help Of Session"?
Oct 14, 2010
I am using sql server 2005. In this query i want the log-in user detail should also display but it is not displaying . modify the query so that log-in user detail should also display with the help of session[userId].tostring(); Query written by me is:
SELECT DISTINCT MUDMEMBER.PK_ID, MUDMEMBER.EMPLOYEE_ID, LKB.BANK_NAME, MUHD.SALARY_ACCOUNT_NO, MUHD.PF_NO,
MUHD.PAN_NO, MUHD.GENDER, LKD.DESIGNATION_NAME FROM M_LEADERLED MLL INNER JOIN M_USER_DETAILS MUDMEMBER ON
MLL.LED_ID = MUDMEMBER.PK_ID AND MLL.START_DATE <= Getdate() AND MLL.END_DATE > Getdate() AND MLL.LEADER_ID = '1' LEFT OUTER JOIN
M_USER_HR_DETAILS MUHD ON MUHD.FK_USER_ID = MUDMEMBER.PK_ID AND MUHD.IS_ACTIVE =1 LEFT OUTER JOIN
LK_BANKS LKB ON LKB.PK_ID = MUHD.FK_BANK_ID LEFT OUTER JOIN LK_DESIGNATION LKD ON
LKD.DESIGNATION_VALUE = MUHD.FK_DESIGNATION_VALUE AND LKD.FK_ORGANIZATION_ID = 1 AND LKD.IS_ACTIVE = 1 WHERE MUDMEMBER.ACTIVE = 1
I'm building a user control to display detail information on a parent record. The user control will be displayed via an Ajax Modal Popup. The user control works and is displayed when expected. The problem that I'm having is that I'm not able to pass in the primary key for the parent. The control is displayed via the _ItemCommand event of a Repeater. In the markup for the user control, I explicity set the ContactId to 0 to avoid an error when the control loads (its still underdevelopment, eventually that I'll check if the value is valid).
I was assuming that I could change the property in the _ItemCommand event, but obviously its not working.In the Page_Load event this code successfully sets the ContactId property of the control. The _ItemCommand event appears to set the value. However when I set a test label on the user control to the Me.ContactId, its showing '0' as if it was never passed in.
I'm trying to implement a SessionState server to allow multiple web servers to share the same state. At first this will be the different dev machines, and later it'll be the different web servers in the web farm.
So far, I'm making good progress I think, but one of the requirements has me confused. In order to implement this, I need to make sure that all web servers are using the same machine key.
This is a sample MachineKey taken from my local dev machine:
If we have a Session State Server deployed locally, do I need to ensure that all other machines using this service (specifically, the other devs working on the same project, and then when we deploy to the web farm) have the exact same entry in their Machine.Config files?
Or do I have to somehow generate a new machine key that can apply to all the machines?
I am trying to display this query result in an aspx page.
It is very slow in loading. Here is the query. The inner query inside the outer quesry is the problem.(Please see the underlined part in the query) - (If I remove that part it is very fast.)
--This column is the issue ,Governing_Class=( case when exists (select top 1 tqc.class_code from t_quote_class tqc inner join t_quote_class_premium tqcm on tqc.class_code =tqcm. class_code where tqc.appid=pi.appid and tqc.class_code not in('8742' ,'8810','7380') order by tqcm.premium_amt desc ) then ( select top 1 tqc.class_code from t_quote_class tqc inner join t_quote_class_premium tqcm on tqc.class_code =tqcm. class_code where tqc.appid=pi. appid order by tqcm.premium_amt desc ) ......... From tables
I find my own way redundant to perform an insert command in a master-detail transaction. Sample, is a Purchase Order, before inserting the details/items will need to find the master key otherwise were not able to make the details connection. Normally we send command to button object which will submit the whole page rather than part of it and these means were not able to capture beforehand the master key to refer in the details.
So, Im thinking of how you do efficiently a master/detail batch update like we normally do in windows apps.
i have a table for customer forecast which contains customer, week number and quantit as columns. now i need to write query and list the week as column for each customer and each cell should have a quantity. how to write query for this using pivot logic. i dont want to use cursor.
How would I go about using my session data (ie username) for an SQL query to populate a dropbox? Here is what I have so far: SELECT Client_Name, Client_ID FROM Client WHERE (Client_Name LIKE '%@Client_Name%')
I am having trouble getting a SQL query to post its results to a Session variable. I am close, but no success thus far. Here is what I have: [Code]....
However, I keep getting this error when I click to a new page that is using this "PracticeID" Session variable: No mapping exists from object type System.Data.SqlClient.SqlCommand to a known managed provider native type.
I'm trying this example: [URL] I got it to work before, like 6-months ago. I'm coming back to this now and I can't seem to get the example working. Do I need to create a query in SSMS and then set up my Master/Detail views off of that? It seems like the GridView is NOT linked to the DropDownList and it seems like there is no way to link the two Objects.
Order No Date Product Qty Customer A101 10-Oct-2010 Mac Book 10 John A102 10-Oct-2010 I-Phone 25 Smith A103 10-Oct-2010 I-Pad 40 Kallis
Here Order No is primary key
Order Detail Table
Order No Date Product Qty Customer Batch No A101 10-Oct-2010 Mac Book 03 John B01 A102 10-Oct-2010 I-Phone 05 Smith B02 A103 10-Oct-2010 I-Pad 10 Kallis B03 A101 10-Oct-2010 Mac Book 02 John B04 A102 10-Oct-2010 I-Phone 07 Smith B05 A103 10-Oct-2010 I-Pad 15 Kallis B06
Here Batch No is primary key
The above table is just a sample table.
I have more than 1000 Order in my table. And for each Order there are at least 12 Order Detail is available in my Order Detail Table. It uses to take long time on loading the report for the first time. So, I thought to select Top 20 records from Order table. I have used the below query in crystal report command
Select Top 20 O.OrderNo, O.Product, O.Date, O.Qty,OD.Unit,OD.Rate from Order O inner join Order Detail OD on O.OrderNo = OD.OrderNo
1. After execution of above query, I would like to know whether all the records from Order Detail Table will be checked during execution (OR) only matching Top 20 records of Order Table will be checked in Order Detail Table and executed?
2. How to use stored procedure in Crystal Report command?
3. What are the steps I need to take, to load Crystal report fast during first time page load?
I used SQL SERVER 2008 R2 express as my web development database and I set its compatibility level to 2005. Unfortunately this database cannot be be attached to SQL server 2005. Are there any other options?
The following query uses join operation, i want the same query to execute without using join operation. Is it possible to do so? If yes than how can i do it?select jname, jcode from heardt inner join judge ON heardt.jud1 = jcodThe reason i am trying to do this is because i am using odbc connection for mysql and join operations are not getting executed at all as web page is loading for infinitely long and not giving any output. That is the reason why i want to try without using join operation
I have an application wich will staore and display the images from the SQL Server 2005.The image i am storing in the DB as byte.I am working on 15 inch montor with resalution of 1024/768 but when i open my application in a big screen of 21 inch or more the image come only half of the form.How can i change the image size based on the screen resalution?
I am using URL Routing for display user profiles. I am using master page and child pages. The profile page is a child page and the master page has a login status control. When I login (say user x) through the modal popup which is in the master page itself, i can browse the site with smoothly and reach the routed page. When I log out from the routed page using the login status i get redirected to my home page as required as my login status also is logged out. If i login from this homepage now with another username say y, i get logged in successfully.
The problem is that when I again use the routed to get to the routed page, I get the previous user x still logged in. When i come to homepage I see user y logged in. So I have two sessions working; one in the routed page, and other in the whole of the website.
I've created a ssrs report using cube and i drag and drop the columns in the ssrs report and it works fine.Issue arise when i would like to update the mdx query. If i modify the mdx and try to save then it pops up a window with a message -"If you modify the MDX statement associated with this query and then return to design mode, your changes will be lost."After this message my changes get lost.Pls let me know how to make the changes in the MDX after designing a ssrs report.
I simply want to display a message on the login page when the user is automatically redirected there after requesting a page that they were logged in for but their session has now expired. So essentially if the user was working but stepped away for a lunch break without logging out I want the system to tell them why they were sent back to the login page.
Something like "You have been idle for too long so you must log back in".
This has to be easy I am just running into a wall here. I thought about getting the original ticket and reading the expiration date but I'm a little lost.