Tag: .net

SQL Express vs SQL CE, latency/lag

Specifications say SQL CE runs as an “in-memory-process”. What does that really mean, and what is the difference of this compared to SQL Express? And does it matter if SQL Express is connected as attached or detached in that respect? I’m specially concerned with latency/lag, as my program is not typically User-activity based, but mainly […]

Facebook like Feed

I want to agregate updates of my tables into a feed. Let´s take sample tables News, User->[Info-Update, Friendships, Images, Videos], SomeOtherTable On every update or insert an event is fired. Now there will be, for this different types, some handlers that should generate the feed. Problem 1: FeedTable, its columns, localized titles and text. My […]

MIN and MAX for a year from datetime using linq to sql

How can I perform this MS SQL Query with Linq to SQL in C# SELECT DATEPART(yy, MAX (articleDate)) AS max_year, DATEPART(yy, MIN (articleDate)) AS min_year FROM News; Thanks

Set today date to Default Value or Binding

I’m using MSSQL2008. The date type is Date, and I would like to set the default date to now or today. I’ve tried GETDATE(), but I get “Error validating the default for column ‘Date’”. If I persist with GETDATE(), it doesn’t work.

Datetime values incorrect within stored procedure, related to .NET membership user validation

I’m having a strange problem with SQL Server 2008, in which some datetime variables within stored procedures are getting incorrect values (1754-01-01). Here is the background/context of the situation: I’m working on an ASP.NET web application using the SqlMembershipProvider class. I use the out-of-box functionality for storing user data in the database, validating usernames/passwords, etc. […]

Search full name with single input box

Let’s say I have a table that contains the following fields: UserId | FirstName | LastName I’d like to put together a search form with a single input for finding people by name. I’ve seen quite a few questions that touch upon this, but am looking for some guidance from someone that has implemented this […]

Possible reasons for error: “The cast to value type 'Decimal' failed because the materialized value is null”

I’m getting a report of errors from a production system. I don’t have easy access to the production system. I will get all the data that I need for it in due course, but what I’m trying to do is expedite the process of resolution of this issue. I’m trying to eliminate as much guesswork […]

Determining current owner of SQL Server instance is by interrogating Failover Cluster Management Service using C#

How can I determine who the current owner of SQL Server instance is by interrogating Failover Cluster Management Service using C#? This is on SQL Server 2008. I have the fail over cluster management service configured and I need a programmatic way to determine the current owner.

Without installing SQL Server, .net application which inserts data can run on the machine?

Is there any way that without installing SQL Server on a machine, a .NET application which inserts and updates data can run on the machine?

C# sql query to add attributes for the elements in xml

I want to display the XML file by taking tag from the XML_TAGS table, and attributes from theMAPPED_TAGS_ATTRIBUTES table – something like <element attributes></element>: String sql = “SELECT Dtd_Tag,Dtd_Attribute_Name FROM Xml_Tags, Mapped_Tags_Attributes WHERE Mapped_Tags_Attributes.Pdf_Tag = Xml_Tags.Pdf_Tag ORDER BY Mapped_Tags_Attributes.Pdf_Tag FOR XML AUTO”;

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