Tag: asp.net

show manager approve documents tHRough store procedure

i have a scenario that when any user first upload document then this go for approval first to supervisor then when supervisor approve/reject documents then only approve documents go to manager then again when manager approve/reject document then only approve document shows to director for final approval ALTER PROCEDURE [dbo].[ALLDOCUMNETS] AS begin SELECT DocumentInfo.DocID as […]

SQL Mark Duplicates on same value and similar date

I have a table t1 as per below. The Reg field may be duplicated and the DateSt may be up to 10 minutes apart. I need to select all duplicate records based on the same Reg column value but only if the DateSt between these values is less than X seconds or minutes etc. Then […]

Updating SortOrder using Linq to Sql

I have a table wherein i have some products, user are provided with the up and down buttons to sort the products as per their requirement and the products will be visible on site in that order only I had written a stored procedure to update the sortorder, but now as i have converted my […]

Unable to connect to SQL Server session database – The wait operation timed out

So this issue is NOT one of having too many connection strings or connection strings not being disposed of properly. ASP.NET Sql Server stored session has been working great for months with decent traffic on the website, now I am getting many Unable to connect to SQL Server session database – The wait operation timed […]

Invalid object name 'Web1'.(Web1 is a sql Database name)

throw ex;(While compiling the error displayed “Invalid Object Name”Web1″” can you help me where i put mistake and i am beginner too so give ideas how to learn C# .net,Sql server. public int insertweb(Com_web cw) { int result=0; try SqlConnection con=new SqlConnection(connectionstring); con.Open(); SqlCommand cmd=new SqlCommand(“saveweb”,con); cmd.CommandType=CommandType.StoredProcedure; cmd.Parameters.Add(“@Empid”,SqlDbType.Int).Value=cw.Empid; cmd.Parameters.Add(“@Empname”,SqlDbType.VarChar).Value=cw.Empname; cmd.Parameters.Add(“@Empphonenumber”,SqlDbType.Int).Value=cw.Empphonenumber; cmd.Parameters.Add(“@Empemailid”,SqlDbType.VarChar).Value=cw.Empemailid; cmd.ExecuteNonQuery(); con.Close(); result=1; return […]

InnerJoin Query giving “Failed to enable constraints” error

This question already has an answer here: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints 21 answers

Can you only use one Select command w/SqlDataSource

This is a pretty simple question that I haven’t been able to find an answer for. Is it possible to have two separate SELECT commands (from the same table) in the same SqlDataSource command to populate two different cells in a given GridView? I haven’t been able to find current information so far. ::EDIT:: The […]

How to validate whether SQL server 2008 was busy (not responding) at some point of time during the day

I am part of UI team and we have developed a asp.net mvc application which uses SQL server as the backend. Every time SQL server becomes busy, the application stops responding. I saw the event logs and following entry was made on the application server. System.Data.UpdateException: An error occurred while updating the entries. See the […]

Different Data types Order By in SQL

I have one situation where i want to sort table on from time but if the status of the row is suppose abc i want to order by these records by status. Requirement is all vacant records needs to be display at the bottom and after that in top records i have to display records […]

SQL 2008 Connection String for Custom Service Account help~

can anyone help me on connection strings using custom service account. I have gone through the MSDN guidance on connect to SQL Server using Windows authentication but somehow unable to figure out how to get the custom service account to work. My connection string is as follows: <add name=”GTR.MDFConnectionString” connectionString=”Server=SGDB3;Database=GTR;Trusted_Connection=Yes;”/> Have also created the an […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.