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();
Dataset ds= new dataset();--type was not found..error
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Jitendra Patel138 reputationPosted Mar 30, 2010, 3:18 AM EDT
In your code you are not pass sqlcommand value to dataadapter.
so this errors accured.
SqlDataAdapter da = new SqlDataAdapter(com);
miss this code
da.selectcommand = com;
DataSet ds12 = new DataSet();
Try this,
Replay and if it is helpfull than marks me.
Thanks,
Jitendra Patel
Jaish MathewsRank #225 · 11K reputationPosted Mar 30, 2010, 4:20 AM EDT
You may missed adding below namesspace
using System.Data;
using System.Data.SqlClient;