.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 >> WPF >> Post New QuestionBookmark and Share Subscribe to Forum

dataset seems to be empty---wpftoolkit

Posted By: Jayakumar     Posted Date: April 04, 2010    Points:2   Category :WPF
hi

im using windows appp wpf with c# .

dataset is empty for the code though my tble has value..


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();

Responses
Author: Venkat             
Posted Date: April 05, 2010     Points: 5   

Hi,

Could you please check the connection string? Because your code seems fine

Mark As Answer if this solve your problem
Warm Regards,
Venkat


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