15,898,760 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Sums Mohs Eds (Top 5 by date)
Sums Mohs Eds
2-Dec-15 9:16am
View
Oh am so sorry, with jquery suppose the structure is
<select multiple="true">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</select>
then it can be selected like below
$("select option[value=2]").attr("selected", true);
incase if it is multiple selection like i have mentioned it in html code, you can repeat the values as shown below.
$("select option[value=2]").attr("selected", true);
$("select option[value=4]").attr("selected", true);
Sums Mohs Eds
30-Nov-15 5:37am
View
Yes for that in the header place a checkbox and in its event change you will have to do what is refered in the link provided in the solution.
Sums Mohs Eds
27-Nov-15 7:24am
View
What is the output you are getting with the query you have mentioned here?
Sums Mohs Eds
27-Nov-15 5:04am
View
Thats what i have mentioned at the start of the solution, if the ID was accordingly you would have. That is, you should be grouping it.
For Example,
SNo NetAmt
1 0
2 0
3 -10761
3 0
4 38834
4 0
4 0
5 -100000
5 0
6 80000
7 28457
7 0
7 0
7 0
7 0
With the above grouping we can still try using CTE.
But then since you have tried using while loop, below is the modified solution which works.
DECLARE @totalRecords INT
DECLARE @I INT
SELECT @I = 1
SELECT @totalRecords = COUNT(sno) FROM tmp1
declare @preval decimal(8,2)
set @preval=0
WHILE (@I <= @totalRecords)
BEGIN
declare @curval decimal(8,2)
declare @nextval decimal(8,2)
select @curval=netamt from tmp1 where sno=@I
if(@preval<>@curval)
Begin
If (@curval=0)
Begin
update tmp1 set netamt=@preval where sno=@I
End
End
if(@curval<>0)
Begin
Select @preval=@curval
End
set @I=@I+1;
END
Sums Mohs Eds
25-Nov-15 7:48am
View
So, I would like to know following details. If at all you are deleting or updating on what basis or depending on what columns you would do that. I mean the where condition will have which columns?