Tag: c#

Why does trying to save a URL with a stored procedure only insert a point?

What I want is to save the url of an image, as I have seen the URLs are saved with two or four diagonals depending, so they are not taken as special characters and I already try those two ways, sending my URL string with more than one Diagonal attached. I have debugged and followed […]

Making database mdf work across different computers

I know this is kind of a stupid question but it gives me a lot of problems. Me and my partners in college projects have a lot of issues making the database mdf work when we send each other the visual studio projects. It gives us errors about the versions of sql server. Is the […]

How to update data in activitypointer

How do I programatically update the subject in an activepointerbase? I’m getting a message that Create/Update method not allowed in Activity Pointer CRM 2011 I am getting an activitypointer record, and attempting to update it: var activityPointer = xrmServiceContext.ActivityPointerSet.FirstOrDefault(x => x.Id == myGuid); I then attempt to update it: activityPointer.EntityState = EntityState.Changed; organizationService.Update(activityPointer); And I […]

Error accessing Schema from web app over over local network

I have a web app that is working correctly on the computer running the server, but when I attempt to run the web app on another device over the local network I get this error: The specified schema name “WORKGROUP\LAPTOP-1” either does not exist or you do not have permission to use it. The command […]

Conditional sum using linq for Or condition

When I use two conditions joined by an OR, the result is not correct for SQL Server. How can I fix it? This is my LINQ code and result in SQL (that reflection created for me): query.Where(p => ((p.Code == “100000”) Or p.Code.EndsWith(“200”))) query.Where(p => (p.year == “2015”))} I added this where clause at runtime, […]

How to check that given time slot is already exists in SQL Server 2012

I want to check the given start time and end time is between the start time and end time in SQLServer 2012. Case: I have a table, its having two column start time and end time with two rows, Please see below that is my table StartTime | EndTime 10:00:00 | 17:00:00 17:30:00 | 18:30:00 […]

How to connect ASP.NET project with SQL Server database table in Visual Studio (C#)

I have created simple database table in Visual Studio 2015 called Users and updated it. I want to connect it with my project, so after I fill in my text fields and press ‘Sign Up’ button, it can get saved to database. I am aware that I’ll have to use string connections and other stuff […]

Audit log in asp.net core and dapper

I need to implement audit log using asp.net core and dapper.net.. I found solutions in Entity Framework 7 audit log The solution provided here are in the EF Core (Shadow Properties) but I want to implement same using dapper.net. My Interface looks like in ASP.NET Core public interface IAuditableEntity { int? CreatedById { get; set; […]

“The model backing the 'DataContext' context has changed” but I am on the same migration

I have a C# solution. Recently, we moved the solution into a new repository. In the OLD solution, I have a soon-to-be deprecated console app that accesses my Azure-hosted DB to do some work. We had some new DB migrations in the new repository and had some work that required the console app, so I […]

List all MSSQL servers in the network VB.NET

I am building one project which simply lists all the MSSQL servers running in the network using VB.NET. I can get the list using ‘SqlDataSourceEnumerator’ with the reference to .NET version 3.5. My problem is that, ‘SqlDataSourceEnumerator’ is not giving me the list with reference of .NET version 4.5. So in order to run my […]

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