Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 display in datagrid
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

3 Posts

Posted - 11/20/2012 :  10:42:21  Show Profile  Reply with Quote
please help me to solve the problem, i am not getting any display in the datagrid

string strCon = "Data Source=HP-PC\\SQLEXPRESS;Initial Catalog=C:\\PROGRAM FILES\\MICROSOFT SQL SERVER\\MSSQL10.SQLEXPRESS\\MSSQL\\DATA\\STUDENT.MDF;Integrated Security=True;Pooling=False";


SqlDataAdapter dataAdapter = new SqlDataAdapter(strSQL, strCon);
SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter);

DataTable table = new DataTable("Complaint");

dataGrid1.ItemsSource = table.DefaultView;


Flowing Fount of Yak Knowledge

5155 Posts

Posted - 11/20/2012 :  11:50:23  Show Profile  Reply with Quote
It may be throwing an exception and silently going away and displaying your window. Wrap the code in a try-catch block and write the exceptions if any to debug trace or a popup window.

Also, you may want to start with an example somewhere (here is one:, get that to work, and make incremental changes to the code to get to where you want to.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000