When you come across the above error while inserting into the database table using LINQ the reason for that is your Database table doesn't have a primary key I was trying to insert the data into the table which does not have any primary key created on it the solution is to create the primary key on that table.
A solution's to the problem's related to Web Technologies like ASP.Net, Angular Js, WebApi,Python & Other Open Source Technologies.
Showing posts with label Linq. Show all posts
Showing posts with label Linq. Show all posts
Sunday, October 29, 2017
Tuesday, September 27, 2016
To check the If Exist condition (SqlServer) in linq using c#
public void
IfExist(string username)
{
var name =
dbcontext.userdetails.Any(s => s.username == username);
if (name
== true)
{
Console.WriteLine("Record
Exists");
}
else
{
Console.WriteLine("Record
Does Not Exists");
}
}
To check if any record exist in the table using linq c#
public void
CheckRecordExistOrNot()
{
var query =
(from td in dbcontext.taskdetails select
td).ToList();
if
(query.Count > 0)
{
Console.WriteLine("Record
Exists");
}
else
{
Console.WriteLine("Record
Does Not Exists");
}
}
The type parameter 'Entity_Code.display_Result' in ExecuteFunction is incompatible with the type 'bmModel.display_Result' returned by the function
If you get the following error while displaying the data using procedure
then follow the below steps :-
Then go to the procedure and select the procedure and select goto
definition
Then check the class
names if the class names are same and the column names of the results from the
table are same
Now check if the column names from the
table are same
Now if the result from the table and the
class names are not same then change the class names both must be same
Subscribe to:
Posts (Atom)
Git Commands
Git Version To check the git version Git -v Git Clone To clone the repository, use the following command: Git clone [u...
-
Below are the steps to deploy the Django application on XAMPP apache server. Assuming that you have already downloaded and installed the...
-
using MongoDB.Bson; using MongoDB.Driver; static MongoClient client = new MongoClie...
-
Git Version To check the git version Git -v Git Clone To clone the repository, use the following command: Git clone [u...