Hi Marina,
Thanks for the reply. I got it working, I am using MS .NET 2003 and i
dont have to specify commandtype to change it to storedprocedure, I ommitted
the line and voila it worked. The compiler is smart enough to make
adjustments.
Do correct me if i'm wrong.
Thanks again
Hemant Singh
"Marina" wrote:
> You need to import System.Data, I believe that is where that enumeration is,
> since it is not exclusive to SQL Server.
>
> In general, you could always find what namespace a class is in, by looking
> it up in the documentation.
>
> "hemant" <(E-Mail Removed)> wrote in message
> news:46BCBE1F-82DA-4971-A17A-(E-Mail Removed)...
> > Hi,
> > SqlCommand cmd = new SqlCommand("my_storedprocedure",con);
> > cmd.CommandType = CommandType.StoredProcedure;
> >
> > The error is : type or namespace name 'CommandType' could not be found(are
> > you missing a using directive or an assembly reference)
> >
> > I have included the following namespaces
> > using System.Data.SqlClient;
> > and the method 'CommandType 'is defined in this class only, but still i
> > could not get it right.
> >
> > Suggest some other work arounds, or get it right.
> >
> > Please advise
> > --
> > Hemant Singh
> > Software Programmer
> >
>
>
>
|