.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> WWF >> Post New QuestionBookmark and Share Subscribe to Forum

dataset ds= new dataset();--type was not found..error

Posted By: Jayakumar     Posted Date: March 30, 2010    Points:2   Category :WWF
public SqlConnection conn= new SqlConnection("Data Source=;Initial Catalog=;Integrated Security=SSPI;UserID=sa;Password=;"); ;
public SqlCommand com;
string strSql = "SELECT * FROM SahanaMusical";
conn.Open();
com = new SqlCommand(strSql, conn);
SqlDataAdapter da = new SqlDataAdapter(com);

DataSet ds12 = new DataSet();

da.Fill(ds12, "SahanaMusical");
dataGrid4.DataContext = ds12;
dataGrid4.ItemsSource = ds12.Tables[0].ToString();
conn.Close();
com.Dispose();

Responses
Author: Dilip             
Posted Date: March 30, 2010     Points: 5   

Have you imported System.Data namespace apart from System.Data.SqlClient

Regards
Dilip


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend