Posts Tagged bikash
Unable to update the EntitySet ‘yourTableName’ because it has a DefiningQuery and no element exists in the element to support the current operation.
Recently i am switching to MVC4 with Razor view engine for ASP.NET, C# web application. Tomorrow i was developing a blogging site where there were some works related to database. There i have created a table with 4 columns but none of them were made primary key.
When i tried to run the application the visual studio 2012 shows the error “Unable to update the EntitySet ‘UserTable’ because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation.” Here UserTable was my table name.
The database was sql server compact edition of visual studio 2012. I became confused about the error because this type of table with no primary key works well before. After a while i came to know that the problem was because of the lacking of primary key in the table. when i mark one of the columns as a primary key then the project run without error. This type of error was new to me so i thought to write down here so later on it may be helpful to someone like me.
Summary of the error and solution:
Problem: No primary key in the table
Solution: Add a primary key in the table
Bikash, Software Engineer.
Find your GrameenPhone account balance or remaining MegaBytes for internet uses using Modem insted of Mobile phone
Most of us feel too much burden when we have to see our account balance or remaining megabytes because of changing simcard from modem to mobile phone. That’s why, to remove our burden we can use USSD activator plugins for GrameenPhone modem software. By using this we can find our account balance or remaining megabytes from the software. Then we do not need any mobile phone for knowing these necessary information. We can also know other information entering appropriate USSD numbers. This is an useful plugins for the GP users. Anyone can try this for better feelings.
To download the plugins click here. Install the plugins then restart the modem software. Then you will find USSD tab. Click on the that tab and start using.
Thanks for reading this post.
C2 is max(C,H),
Input and output:
minl([Head|Tail], Minimum) :-
Minimum is min(Head, TailMin).
Input = minl([4,5,1,2,9],X).
Odd or even:
odd_even(X):- X mod 2 =:= 0,
odd_even(X):- write(‘odd number’),nl.
nth(Count, Item, [_|Tail]):-
Count > 1,
Count0 is Count-1,
nth(Count0, Item, Tail).
%ache kina chke kre yes or no rslt
Finding fibonacci series:
stored(Goal) -> true;
fib(1,1) :- !, write(‘1, ‘).
fib(2,1) :- !, write(‘1, ‘).
N1 is N-1, memo(fib(N1,F1)),
N2 is N-2, memo(fib(N2,F2)),
F is F1 + F2,
write(F), write(‘, ‘).
Input = fib(7,X).
Output: 1, 1, 2, 3, 5, 8, 13
Other fibonacci code:
fib(X, Ans) :- Xm1 is X – 1 ,Xm2 is X – 2 ,
fib(Xm1, Sub1), fib(Xm2, Sub2),
Ans is Sub1 + Sub2.
fib(0,A). means A=0; 0 tomo fibonacci number is 0
fib(7,A). A=13; 7 th fibonacci number is 13
fibonacci series: 0,1,1,2,3,5,8,13,21,34,55,89,144;
N3 is N1+N2,
%fib_for(FirstNumber, SecondNumber, Result).
% Example: ?-fib_for(1,1,Result).
%at first have to provide two fibonacci number then have to start execution, when executing have to press ; for next fibonacci number.
Checking prime number:
N is Y*Y,
N =< X,
X mod Y =:= 0.
Y < X,
Y1 is Y+1,
Y is 2, X > 1, \+divisible(X,Y).
Finding power of a number:
power(X,N,V):-X>0,N>0,N1 is N-1,power(X,N1,V1), V is V1*X.
Finding factorial of a number:
X1 is X-1,
Y is X*Z.