TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
axnst1
NA
1
0
SQL CURSORS - in ASP
Apr 14 2004 4:05 PM
This is basicly what I am tying to accomplish in an ASP.NET app: ----------------------------------------------- DECLARE cur_temp SCROLL CURSOR FOR SELECT Connection FROM Popouts OPEN cur_temp DECLARE @popout_no FETCH FIRST FROM cur_temp ------------------------------------------------- The SQL 2000 Query Analyzer runs it without errors. Questions: ------------ - How do I make my SQL query string be equal to that? (Since it's more then one command/line) - Is there a better way to go through a SQL DBase, inspect the contents of a column and populate another column depending on contents of the first column? And do that for every record one-by-one? This is How I tried and it didn't work: ------------------------------------------ strSQLQuery = "DECLARE cur_temp SCROLL CURSOR; FOR SELECT Connection FROM Popouts;OPEN cur_temp;DECLARE @popout_no;FETCH FIRST FROM cur_temp;" objCommand = New SqlCommand(strSQLQuery, objConnection) objConnection.Open() DBUpdateDataGrid.DataSource = objCommand.ExecuteReaderCommandBehavior.CloseConnection) DBUpdateDataGrid.DataBind() objConnection.Close() -------------------------------------------- This is the error message I get: ------------------------------------- System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near ';'. -Thanks
Reply
Answers (
1
)
designing asp.net ecommerce website's using OO principles and modeling it using booch's UML
event problem