I’m trying to build a linq to entities query. This is what I have so far: from x in db.BusSchedule join y in db.BusSchedule on x.ID equals y.ID – 1 where Convert….
Tag: c#
Escape single quote in sql query c#
Here I have this method in my CandidateOp class file. I’m passing the ComboBox text in the form and I am getting the ID to the integer type variable tempPrID. The partyIDtoInsert, is a stored procedure I have created and it is being called in the method getpartyID as shown before, to get the id of united national party. If
NVarChar to C# Data Types
The database stores nvarchar, I retrieve the information and I’d like to jam it into C# data types without any declarative conversion code. Can you implicitly convert nvarchar to C# data types? (e.g. nvarchar to int) Answer Nvarchar is a string, if you want to turn it in to a int you will have to go through some kind of
How do you write a parameterized where-in raw sql query in Entity Framework
How do you write a parameterized where-in raw sql query in Entity Framework? I’ve tried the following: But as expected, it throws an error on DateParam because it’s expecting a single value. Answer This isn’t a problem specific to entity-framework, you can solve it by generating your own parameter names dynamically. The resulting query sent to SQL-Server will look like
There is insufficient system memory in resource pool ‘default’ to run this query. on sql
I have a running service that gets 50-100 queries per minute. And these are not high cost queries. This service has been running for around 3-4 months without any errors. Suddenly few days ago it started giving “There is insufficient system memory in resource pool ‘default’ to run this query.” error occasionally. When I investigate the problem I saw that
Checking for empty or null JToken in a JObject
I have the following… JArray clients = (JArray)clientsParsed[“objects”]; foreach (JObject item in clients.Children()) { // etc.. SQL params stuff… command.Parameters[“@MyParameter”]….
Execute query using C# [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 8 years ago. Improve this question I am trying to execute some SQL code, connected directly to my database, but I don’t know how to execute the query. Answer SqlCommand has
SqlDependency onchange event infinite loop
I have a simple query, and the event fires at the correct time. However, once fired, the property, .HasChanges, of the SqlDependency object is always set as true. The first time OnChange is fired, the SqlNotificationEventArgs Info property is “Inserted”. The second time the event is fired it’s “Already Changed”. I commented all of my code in the OnChange event
Error parsing query: [ Token line number = 1,Token line offset = 27,Token in error = BY ]
I’m trying to pass a SQL command to delete data which has a property BY ( unique nvarchar), but I get this parsing error every time. Error parsing query: [ Token line number = 1,Token line offset = 27,Token in error = BY ] I have also tried to do the same command to a different property called Category (which
Getting records with month by month, year by year and day by day from SQL Server
I’m looking for a fast and easy SQL Query to get records year by year, month by month and day by day. My database example: ID – DATE – CatID – VALUE 1 – 2013-08-06 – 32 – 243 2 – 2013-…