• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 500
  • Last Modified:

asp.net get an error on CommandBehavior


I get a ' name CommandBehavior not declared'

Using command As New SqlCommand(SQLString, sqlConn)
                dataReader = command.ExecuteReader(CommandBehavior.CloseConnection)
                Do While dataReader.Read()
                    client_stores_files.Add(dataReader.GetValue(0).ToString())
                Loop
                dataReader.Close()
                sqlConn.Close()
            End Using
0
GlobaLevel
Asked:
GlobaLevel
1 Solution
 
appariCommented:
try this

Using command As New SqlCommand(SQLString, sqlConn)
                dataReader = command.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
                Do While dataReader.Read()
                    client_stores_files.Add(dataReader.GetValue(0).ToString())
                Loop
                dataReader.Close()
                sqlConn.Close()
            End Using
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now