16,022,798 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 Visual Basic questions
View Javascript questions
View .NET 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 Member 11377180 (Top 19 by date)
Member 11377180
15-Sep-15 7:07am
View
I feel something is wrong with cursor but not getting how to correct it
Member 11377180
15-Sep-15 7:06am
View
Hi..This is what i mentioned.When i run the statements you mentioned it will give me 14 rows(my desired output) but when i run entire thing it repeats result set. For example,
my result set is 3 rows. So the output wud be like:
Fruits:
Apple
Mango
Papaya
Fruits:
Apple
Mango
Papaya
Member 11377180
12-Sep-15 8:18am
View
Yes you are correct. I didnt put Fetch at the end since I thought it will go to first Fetch statement(one before while) after executing while loop. All working fine now,Thanks alot for the help!!
Member 11377180
12-Sep-15 5:07am
View
thanks..its working. but output is: Only first row is taken into cursor and its executing continously... is there anything im missing out? pls check my update proc below:
USE [Opening1]
GO
/****** Object: StoredProcedure [dbo].[HSR] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Alter PROC [dbo].[HSR]
AS
BEGIN
Declare @Showroomcode varchar(50),
@Startdate date,
@Stockno int,
@Servicetag varchar(50),
@TransType int,
@Qty int
BEGIN
DECLARE HSRCursor Cursor
STATIC FOR
select distinct a.Showroomcode,a.Stockno,b.Startdate,a.Servicetag, a.Qty ,a.TransType
from ConsIMEItrndata a,
(select Showroomcode,startdate,stockno,OpeningQty from IMTable) b
where a.Showroomcode=b.Showroomcode
and a.Stockno=b.Stockno
OPEN HSRCursor
IF @@CURSOR_ROWS > 0
BEGIN
FETCH NEXT FROM HSRCursor INTO @Showroomcode,@Stockno,@Startdate,@Servicetag,@Qty,@TransType
WHILE @@FETCH_STATUS = 0
begin
If ( @TransType=1100 or @Transtype=1300)
set @Qty=@Qty*1
else
set @Qty=@Qty* -1
Insert into HSR_OP_Bal(Showroomcode,Startdate,Stockno,Servicetag,OP) values(@Showroomcode,@Startdate,@Stockno,@Servicetag,@Qty)
end
end
CLOSE HSRCursor
DEALLOCATE HSRCursor
end
end
Member 11377180
12-Sep-15 2:49am
View
BEGIN
If ( @TransType=1100 or @Transtype=1300)
Declare @OP int
Begin
set @OP=Qty*1
end
else
Begin
set @OP=Qty* -1
end
Insert into HSR_OP_Bal(Showroomcode,Stockno,Startdate,Servicetag,OP) values(@Showroomcode,@Stockno,@Startdate,@Servicetag,@OP)
end
Im getting this error:Incorrect syntax near the keyword 'else'.
Member 11377180
2-May-15 1:37am
View
ya thats what i want to know. how to merge them? it would be great if u show how to write!
Member 11377180
26-Apr-15 4:50am
View
Suppose Mainmenu dropdownlist has following items: apple,mango,grapes. in database there is no Apple itself and hence no records matching it, in such case how to check and display error msg? Now if i select apple no msg is displayed instead it shows all other records of gridview corresponding to mango and grapes.
Member 11377180
16-Apr-15 7:00am
View
I have improved question.ID is the column connecting 2 tables. right now i hav retreived data from both tables into single gridview. In same gridview i want to sort data based on device and category. im using dropdown for this .how to write stored procedure for this?
Member 11377180
16-Apr-15 7:00am
View
I have improved question.ID is the column connecting 2 tables. right now i hav retreived data from both tables into single gridview. In same gridview i want to sort data based on device and category. im using dropdown for this .how to write stored procedure for this?
Member 11377180
3-Mar-15 8:27am
View
inspite of trying this its still reloading.
protected void Page_Load(object sender, EventArgs e)
{
if(!this.IsPostBack)
{
Calendar2.Visible = false;
Populate_MonthList();
Populate_YearList();
txtExpiry.Enabled = false;
}
}
Member 11377180
5-Feb-15 11:05am
View
no. please check the code. im using bulkcopy because i want to move rows from gridview of one page to gridview of another page.so im copying from gridview1 to database then in another page fetch data from database to gridview2
Member 11377180
5-Feb-15 8:44am
View
row.Cells[x]values also empty.
Member 11377180
4-Feb-15 23:30pm
View
i used breakpoints and checked the values..they are same as getting copied to database. int fields store 0, datetime fields store 01-01-0001 value, and string fields null values. and row.cells for all fields is '' ''.
please help with coding..
Member 11377180
4-Feb-15 22:17pm
View
ya database columns are matching
Member 11377180
30-Jan-15 9:07am
View
tried both still giving exception Input string was not in a correct format at this line:
int catid = int.Parse(row.Cells[2].Text);
but in troubleshooting tips its showing:When converting a string to datetime,parse the string to take the date before putting each variable into the datetime object.
Member 11377180
30-Jan-15 8:58am
View
int catid = int.Parse(row.Cells[2].Text);
this line is throwing exception.
Member 11377180
30-Jan-15 7:14am
View
im getting exception for int and datetime types. Datatypes in this code match with those given in database. then whats the error? for date and exp fields datatype in database is date not datetime. pls suggest the changes
Member 11377180
30-Jan-15 1:39am
View
string name = GridView2.DataKeys[e.RowIndex].Values["Name"].ToString();
this line gives error object reference not set to an instance of an object
Member 11377180
16-Jan-15 8:49am
View
This code has one problem..2nd gridview is in Webform1 itself not in webform2.. when i click button to transfer it must just show successfully sent msg,thats it.Later wen i open webform2 gridview2 must be shown..
Show More