Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a doubt in c#

while iam doing my c# applications especially ado.net

it says that a "type or namespace could not found."

even though i use using system.data.sqlclient namespace

the same example is ruiing me in vb.net

 

suppoose if i use a DataSet ds = new DataSet() ;

 

it says that type or name space of " DataSet" could not found

 

any body pls help me to clear my query

Thank you

Posted

using System;

using System.Collections;

using System.ComponentModel;

using System.Data.SqlClient;

using System.Drawing;

using System.Web;

using System.Web.SessionState;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

 

It executed for me Now!!!

Could you please tellme why it does nt take if i give

DataSet ds = new DataSet();

Instead of

System.Data.DataSet ds = new System.Data.DataSet();

 

my is it not inheriting the default namespace.Is it problem in framework. My framework version is 1.1.4322

 

and my using statements does't vary from what i gave above.

 

what about the other statements like SqlDbType ,CommadType ,ParameterDirection,... because these staements also getting the same error when iam using a stored procedure.

 

i will give a simple example for that

 

SqlConnection nwindConn = new SqlConnection("Initial Catalog=northwind;Data Source=Pubs;User Id=siva;Pwd=siva");

 

SqlCommand salesCMD = new SqlCommand("Ten Most Expensive Products" , nwindConn);

salesCMD.CommandType = CommandType.StoredProcedure;

 

nwindConn.Open();

 

SqlDataReader myReader = salesCMD.ExecuteReader();

 

while (myReader.Read())

{

Response.Write(myReader.GetString(0));

Response.Write(myReader.GetDecimal(1));

Response.Write("<br>");

}

 

Here it is giving the same error like

"type or namespace of name'CommadType' not found"

 

Please tell me why my using statements are not inheriting

I request you to extend your cooperation.

Thank you

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...