Assuming that you imported the System.Data.SqlClient, System.Data.OleDb, or
another namespace to connect to the DB, did you also import the System.Data
namespace? I've seen it happen a couple times where the
System.Data.SqlClient namespace (or whatever is appropriate for the given
database) is imported since all the connection and command objects, but the
System.Data namespace is forgotten. You have to import the System.Data
namespace in order to use the CommandType because it lives in the
System.Data namespace as System.Data.CommandType.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"EmJayEm" <Wo*@eookie.com> wrote in message
news:Z9******************@fe3.news.blueyonder.co.u k...
I'm having some problems with this line when I do a SQL insert stored
procedure:
Compiler Error Message: BC30451: Name 'CommandType' is not declared.
Source Error:
Line 65: cmd.Parameters.Add( "@EmployeeID",
newEmployeeId)
Line 66:
Line 67: cmd.CommandType = CommandType.StoredProcedure
Line 68:
Line 69: conn.Open()
Any ideas anyone?
Thanks,
EmJ.