I have a sql datasource with the ControlParameter called ddlDropDownList.
1. Is my syntax below ok, I am getting a runttime error that the syntax is incorrect.
2. I have the select statement set up the control parameter to get the selected value from the dropdownlist as shown below, is that syntax correct? especially the "selectedItem.value" for the propertyname property.
I have been working on a stored procedure to calculate likert scales for course evaluations. I have the stored procedure done but I ran into an interesting but frustrating situation.
I used a case statement along with a select query to count the number of responses of a given value. Likert scales are usually 5 point scales 5 being the highest and 1 being the lowest. The value that gave me the trouble was null values. In my evaluation page the instert query puts a null value in the field instead of leaving the response blank. These are the two queries I used both are syntactically correct but one works and the other doesn't. #1 Null query that works
Can anyone explain the differences and why one works but the other doesn't? Can it be as simple as switching the WHEN and the column name and if it is would it be advisable the other ones around?
I am using Linq to SQL. Tables have timestamp columns and I am using regular Linq methodology in ASP.NET MVC.I do use detached entities and always try to do updates without first querying the database for the original entity. To update an entity I use context.Attach(entity, true) followed by context.SubmitChanges() and all is fine. The sql statement that gets executed looks like:
Working on a heavy ajax based site with over 100 methods from all the ajax calls inside each of each controller all with basically the same code.Was thinking of changing them to a big case statement for readability which would keep the code a bit more dry and make it easier to read.What I am wondering is: Will there be a performance hit and is there a better way to deal with it?
I have my project set up with the virtual path "/MyVirtualPath", create the virtual directory in IIS 6 (W2003) and everything works fine. Then to work better with Google Analytics I change the virtual path "/myvirtualpath" and change all redicecciones and links to lowercase. also applies the class "lowercase route urls in aspnet mvc" and works perfectly.
The problem I had to modify the virtual directory in IIS, delete virtual path "/MyVirtualPath" and I created the new "/myvirtualpath", but in all cases I use tilde "~" or where I make a "RedirecToAction" (which should take "LowercaseRoute"), continues to maintain the virtual path "/MyVirtualPath". For example, if I see the HTML source code in the browser, see "/MyVirtualPath/Content/Site.css" instead of "/myvirtualpath/Content/Site.css. "
I have a query with group-by clause. I want to use it in recusionCTE.How is it possible?I want to know the totalamount for each fname done through this query:select top 10 fname,SUM(totamt) as 'Total Amount' from tables_list group by fname order by 'Total Amount' descBut when any person logins he must be able to see this list for his own hierarchy down the line including himself.
I have created the folowing stored procedure and it is working fine... I have used OVER clause in the query written in the WITH block. Can some body provide description about working of OVER clause and why I need to use it with the ROW_NUMBER() function.
CREATE PROCEDURE SelectOrder @PageIndex INT, @PageSize INT AS BEGIN WITH Order AS ( SELECT ROW_NUMBER() OVER (ORDER BY OrderId DESC) AS Row, * FROM Orders ) SELECT * FROM Order WHERE Row between (@PageIndex - 1) * @PageSize + 1 and @PageIndex*@PageSize END
I have a [Permission] and [Unit] table (permissions types are to view, update, add, ... records). One of the [Unit]'s is "1" for "ALL Units". What I want to do is use either a CASE or IF statement in my view which will pair every [UnitId] (except "1" ofcourse) if/when the [UnitId] is set to "1".
I am having trouble with my ORDY By Case Statement. It doesn't seem to be ording correctly. To see it in action, please go to [URL] and click on "latin" and it should change the sort order and when you click back on "common" it should change it back but it doesn't. Here's my code:
I was wondering how I would go about setting up the CASE keyword in SQL from my Web app. I have a table where I need to update anywhere between 20 and 300 rows with different values. My table looks like this
ID EventID SeatType SeatCount Status Comments
On my page, these rows are listed in a table with a textarea to add comments. So when I click a button I need to update All the comments for all the users of a certain "EventID".I think my SQL Statement should go something Like this:
UPDATE Events SET Comments = CASE [code]....
Is that correct? I would be getting the ID and comment from each row of the table. Also (using C#) what would be the most efficient way to get this information into the query? I was thinking to use a for statement but I hear many string concatenations requires lots of processing?
have a very important issue,i have three Stored Procedures Sp1,Sp2 and Sp3 .the first one (Sp1) will execute the second one (Sp2) and save returned data into @tempTB1 and the Second one will execute the third one (Sp3) and save data into @tempTB2.if I execute the Sp2 it will works and it will returned me all my data from the Sp3 ,but the problem is in the Sp1, when i execute it it will display this Error:INSERT EXEC statement cannot be nested I tried to change the place of execute Sp2 and it display me another error:Cannot use the ROLLBACK statement within an INSERT-EXEC statement.
I am working on an Asp.net webiste.The response time(in case of a postback) of the pages in the website is ok on my local machine.But when I uploaded the same website to the internal development server and tried to access the server pages from my local machine,its taking bit long(in case of a postback) as compared to my local machine.I do not understand why the same webiste runs slowly on the dev server..
Following is the configuration of dev server.
Microsoft Windows Server 2003 R2 Enterprise Edition service pack 2 Intel(R) Xeon(R) CPU E5450 @ 3.00GHZ 3.23 GHZ,2.00 GB of RAM Physical Address extension
Following is the configuration of my local system
Microsoft Windows XP Professional Version 2002 service pack 2 Intel(R) Pentium(R) Dual CPU E2180 @ 2.00 GHZ 2.00GHZ,1.99 GB of RAM.