Weird error

J

jason

Hello,
I have a script written in c# that is returning the following error:

Compiler Error Message: CS0246: The type or namespace name 'SqldbType'
could not be found (are you missing a using directive or an assembly
reference?)

It is failing on:
oCmd.Parameters.Add("@FirstName", SqldbType.VarChar, 30).Value =
DBNull.Value;

and here are the headers of the aspx file (code is inline):
<%@ Page language="c#" AutoEventWireup="true" debug=true %>
<%@ import Namespace="System" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<%@ import Namespace="System.Configuration" %>
<%@ import Namespace="System.Web" %>


Any ideas what might be causing this error?
 
J

jason

Yes, that is how I had it before I started messing with it. Just
changed it back and it still doesn't work. :(. This has to be something
obvious.
 
M

Mark

You could try using the entire namespace when creating the Parameter..

System.Data....etc
 
B

Bruce Barker

c# is case sensitive, try: SqlDbType.VarChar (note cap D)

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top