Tag: asp.net

GridView Pagination Altering URL

I’m using a GridView to display a set of records (cars) from my MSSQL DB. I am also using a URL rewrite on the same page. The actual name of the page, including the query string, would be Range.aspx?name=a1, which is rewritten to site.com/range/a1/ The issue I’m having is that when I try to page […]

How ASP.NET application can copy recently added data from SQL Server database to another similar one on different SQL Server

The problem I’m trying to solve: I have a dev SQL Server database which is mainly used for staging data entry (occasionally it’s getting extra table) and when the person using the system (MVC web app) is happy with the data entry made that doesn’t break the system can by single click of a button […]

Delete user from database when it's removed from Active Directory

I have a website built in ASP.net, c# and SQL SERVER which has a table in the database with the users information. I would like to know how to check if the user was removed from the Active Directory to proceed to delete from the database. I don’t know if this can be done instantly […]

Store Excel Sheet data to sql server

I am getting error message like Format of the initialization string does not conform to specification starting at index 0. While exporting an Excel file. Please advise This is my code: string file = string.Format(“{0}\\{1}”, Request.PhysicalApplicationPath,Guid.NewGuid().ToString().Replace(“-“,string.Empty)); fileuploadExcel.SaveAs(file); //Create connection string to Excel work book string excelConnectionString = string.Format(“Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=’Excel 12.0;HRD=YES;IMEX=1′”, fileuploadExcel.PostedFile.FileName); //Create Connection to […]

issue with FileUpload Control in ASP.NET & Stored Procedure

Friends I need your help to fix an issue. DETAIL I have a Registration form based on update panel (works in slides) where one slide asks the user to upload his/her photo (optional). ISSUE Everything works fine, fine name is saved in Database, user folder creates in server side But the file is not uploaded […]

Calling Scalar User Defined Function in Where Condition in Entity Framework

I have a SQL Function ‘DecryptField’ as : ALTER FUNCTION [dbo].[DecryptField] ( @EField as varchar(10) ) RETURNS varchar(10) BEGIN Declare @decrypted varchar(10) SET @decrypted = ‘Something’ + @EField return @decrypted END I want to call that function in Entity Framework.(EF Version : 6.0 target framework: 4.0). By searching over the Internet, I found a solution […]

ASP.net how to use a CompareValidator to compare a textbox input to a column in database?

Is there a way to use CompareValidator to validate user input against data in a database table? For example, I have a table STUDENT that contains a column Student_ID. I need to display an error message if a user entered Student_ID value in a textbox that does not exist in the database.

Web.config connection string works with bogus values – but why?

I am stuck with the .net connection to SQL Server 2012. After reading dozens of tutorials and questions I could not find any clue. For me it seems to be too much magic going on with SQL Server. I am using Visual Studio Express 2012 for Web, SQL Server 2012, .net 4.5 Other people complain […]

Return data from multiple tables in a gridview on a single button click

There are five tables. My question is how to perform search on one table and move to another table if the result is not there, and display relevant information where ever it’s found, in a gridview, on my .aspx page. The problem is I have to implement this search using a single button click event […]

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 […]

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