I have a stored procedure that receives a string parameter “OrderByColumn” and builds dynamic query accordingly. This is the part of my stored procedure code: ROW_NUMBER() OVER (ORDER BY CASE WHEN @OrderByColumn=’Date’ AND @OrderDirection=0 THEN tbl_Docs.Date END ASC, CASE WHEN @OrderByColumn=’Count’ AND @OrderDirection=0 THEN tbl_Docs.Count END ASC, And in my code behind function that calls […]
There are few string lists in my web application that i don’t know where to store in DB or just class. ie. I have 7 major browsers with which users enter the site. I want to save these stats thus i need to create browser column in UserLogin database. I don’t want to waste space […]
Using SqlServer session state provider with ASP.NET. From : http://msdn.microsoft.com/en-us/library/aa478952.aspx , the ASPStateTempSessions table’s SessionId column is made up of : “Session Id” + “Application Id”. My question is, wouldn’t “Session Id” be enough to make this column unique ? If so, is adding the “Application Id” just some additional security to make sure sessions […]
I have a sql job that sends email to all users everynight. It has a footer with Unsubscibe link which opens the asp.net page. As a querystring, i want to add encrypted EmailID to the link. so i can decrypt and use it to update the database. How can i use encryption in sql and […]
is there any way to insert in bulk (i mean all gridview rows) to sql server database in single submit. its an ASP.Net app and I also want to validate data.
i want to get daily,monthly,yearly hits ( visit count ) of my site . What is the best way to do this in asp.net ? tnx.
Lets say there’s a table Table1 with Primary key as “MainID” and this MainID is being used as a Foreign key in many tables. Now when I try and delete a record from Table1 who’s MainID as foreign key is being used in some child tables, then it throws this exception that “Foreign key conflict […]
I’ve got a gridview that populates from four tables, and the select command (shown below) is fully functional. I’d like to be able to search the gridview, and display only those rows whose “Status” column value is equivalent to the selected item on a dropdown list. I believe I have the select statement right for […]
This seems like it should be really obvious, but how can I put a DateTime object into an MSSQL database? When I convert it to a string, it keeps adding “-7:00” at the end for the time zone offset and so the query isn’t accepted. How can I fix this?
If I use a textbox I have no issues getting data into sql. I’d like to use a textarea with autowrap and all that. But when I change the <input type=”text” id=”au_id”> to <textarea name=”au_id”> I can’t get the .value of au_id.Value code listed below. All I want is to swap single line text box […]