Tag: c#

C# client : how to get current datetime from SQL Server?

I have used a date time in my project. My project is client server and developed with c#. Now, I want to get date time clients from SQL Server on server, that when the system date time client was in trouble, Application get current date time from server. For example: A timer that each hour […]

Convert field in linq query c#

This question already has an answer here: Why LINQ to Entities does not recognize the method 'System.String ToString()? 7 answers

Where messages are stored in SignalR

I’m new to SignalR, but I’ve read and done some of SignalR tutorials. I wonder where messages are stored in SignalR. If I integrate some authentications and build a chat app, where messages are stored? If I need a SQL database, how can I design it to save users’ conversations?

How and where can I modify the auto generated query from DataAdapter?

I am using a DataGridView and I wanted to update my table from the grid. I get the error “Dynamic SQL generation is not supported against multiple base tables” when using the DataAdapter.Update(dataTable). The reason is because I have filled my dataTable by joining 2 tables. This is the function I am using to update […]

SQL Server ConnectionString Error

Just changed over to a SQL Server database and am trying to access my connectionstring set in my web.config. I am getting the following error: The ConnectionString property has not been initialized. Web.Config code: <configuration> <configSections> <sectionGroup name=”applicationSettings” type=”System.Configuration.ApplicationSettingsGroup, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089″> <section name=”EditorGenerator.Properties.Settings” type=”System.Configuration.ClientSettingsSection, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089″ requirePermission=”false” /> </sectionGroup> </configSections> <connectionStrings> […]

SQL Server stored procedure hashes differently in C# to Management Studio

I am calling a stored procedure to create and hash a new password. It is being called from a .NET/C# WebAPI controller. _sqlDataContext.ExecuteCommand(“[Users].[SetNewPassword]”, new List<SqlParameter> { new SqlParameter(“@UserId”, SqlDbType.UniqueIdentifier) { Value = user.Id }, new SqlParameter(“@Password”, SqlDbType.NVarChar, 256) { Value = command.Password } }); userId and command.Password are a GUID and simple string respectively. The […]

Accessing MongoDB from a SQL Server 2008 CLR trigger

I’m using a SQL CLR trigger to push updates from the relational DB to a MongoDB instance. Both databases are running on the same Windows 2012 machine. My SQL CLR project is built on .NET 3.5 and is using the mongocsharpdriver 1.10.0. The C# code within my trigger is as follows: SqlPipe pipe = SqlContext.Pipe; […]

With ToList or AsQueryable Calling procedure in Entity Framework

I wonder, if I call procedure with .ToList() or .AsQueryable() does have same effect in Entity Framework? Look at this: var query1 = DB.sp_GetConsultants().AsQueryable(); var query2 = DB.sp_GetConsultants().ToList(); I knew that AsQueryable just creates a query and ToList executes it, but when I looked into SQL Server Profiler and saw that both query1 and query2 […]

WCF web app hosted on Azure error connection to SQL server

I hosted a WCF web application on Azure. It works perfectly on local. I can access to the web app but when I try to query the data from the azure web app it seems like it cannot connect to the SQL server containing the data which is located in an AWS ec2. config.UseVerboseErrors is […]

Connect JavaScript and Ms Sql

Here is scope of the project I know enough html and CSSs to build a website. I know enough of MS sql to build stored procedures and complicated quires. I’m trying to bring everything to new next level The question is very broad but I need some navigation. How do I build web based app […]

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