Tag: asp.net

SqlDataSource select statement syntax error

I’m working on an ASP page for a project, which should provide an interface for the user to maintain information on local little league baseball and softball. I keep getting an error: Syntax error in FROM clause. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace […]

Updatetext funciton in SQL 2005 wth asp.net

I have the table, called Contract in my DB. There is column Comment(datatype text). I’m trying to add some comments a lot of times to this column from my asp.net application. Just like concatenate text in this cell with new text from textbox. Maybe there is an easiest way to do it, but I didn’t […]

Saving text of dynamic textboxes and labels on dynamically created linkbutton click event

I am developing a shopping cart kind of thing. For that, on selecting products they get added to a temporary table, and so on. Then a popup window opens which loads dynamic labels, text-boxes and linkbutton based on the number of rows in the temporary table in the page load event. I want to allow […]

Retrieve last inserted GUID

I need the last inserted row GUID at the time of page loading in ASP.NET. I tried with a stored procedure, but at the time of insertion I am getting how to use that value in the page load procedure like this: USE [emp] GO /****** Object: StoredProcedure [dbo].[procTestTableInsert] Script Date: 3/12/2014 5:55:33 PM ******/ […]

Return a string value from stored procedure

I want to create a stored procedure to return the record counts in a number of other stored procedures.I have the following to create a string value: ALTER PROCEDURE usp_Prepare_Default_Page @Status int, @CurrentUser int, @DisplayUser int, @OwnRecords BIT = 0, @array VARCHAR(MAX) = ” OUTPUT AS BEGIN DECLARE @dgActions INT = 0 DECLARE @dgAllocByMe INT […]

Configure IIS 8 for SQL Server Authentication

I’m getting the following error when trying to query SQL Server 2012 from Windows 2012 IIS 8.5, in an MVC 4 website: SqlException (0x80131904): Login failed for user [domain/user] I have the connection string in Web.config set up just the way we did it back in the olden days: <add name=”MYPROJECT.Properties.Settings.defaultConn” connectionString=”Data Source=MYSERVER;Initial Catalog=MYDATABASE;Persist Security […]

DbMigration & DbModelBuilder behavior before compilation in Entity Framework

I have an attribute as such: [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] public class IsUnicodeAttribute : Attribute { public bool IsUnicode { set; get; } public IsUnicodeAttribute(bool isUnicode) { this.IsUnicode = isUnicode; } } And I have it read at the DbModelBuilder as: modelBuilder.Properties<String>() .Having(p => p.GetCustomAttributes(false).OfType<IsUnicodeAttribute>().FirstOrDefault()) .Configure((config, attr) => config.IsUnicode(attr.IsUnicode)); While not having a database yet, […]

Make Certificate Visible to user after user meets target

I am having problem wrapping my head around this problem. If you run the query embedded in code below, it shows Total Questions (TotalQuestions) asked, Total Correct (TotalCorrect2) and percentage correct (PercentCorrect2). We have students who participate in video tutorials. After each lesson, they are given quizzes, a total of 30 questions. To pass through […]

how to import excel sheet into sql database in asp.net

This question already has an answer here: Excel “External table is not in the expected format.” 16 answers

Trouble with window authentication on IIS 7

I am trying to set up a Test server to try out asp.net (3.5) web applications before they’re moved to Production. I want to mirror the settings in IIS from Production server. On my web app, application pool is set as Classic .NET AppPool with identity NetworkService and Windows Authentication is enabled. When I attempt […]

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