jaya kumar

jaya kumar

  • NA
  • 18
  • 0

my dataset seems empty though i have values int able in wpfdatagrid(toolkit)

Apr 4 2010 3:26 PM
string connb = System.Configuration.ConfigurationSettings.AppSettings["anaMusical.Properties.Settings.anaConnectionString"].ToString();
            SqlConnection conn = new SqlConnection(connb);           
                    SqlCommand com;
                string strSql = "SELECT * FROM anaMusical";

            
            conn.Open();
            com = new SqlCommand(strSql, conn);
            SqlDataAdapter da = new SqlDataAdapter(com);

            da.SelectCommand = com;
            DataSet ds12 = new DataSet();

            da.Fill(ds12, "anaMusical");
            dataGrid4.DataContext = ds12;

          //dataGrid4.ItemsSource = ds12.Tables[0].ToString();
            conn.Close();
            com.Dispose();