Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

datagridview not populating...

$
0
0

I am certain this is a dumb problem, but I cannot find it.  

I am trying to populate a datagridview (dgv) in WinForms.  

I define my query sSQL = "select * from Table", I open my connection.  Then I am running the following code:

            sdaB = CurrentDB.ExecuteAdapter(sSQL); //Returns sqlDataAdapter --CurrentDB is a DataClass
            DataTable dtB = new DataTable();
            sdaB.Fill(dtB); //On this line, the code seems to stop (jumps to form view) no other lines are run.
            dgvB.DataSource = dtB;

As I mention above in the comments, the code runs to .Fill line and when I step that line of code, I jump to the Form view and the code stop.  The dgv is not populated.  I am stumped.  I know this is supposed to be simple.  

I have tested my sql statement, and my connection.  Both seem to be valid (there is data there).  

Any suggestions on why the code will not execute on the sdaB.Fill(dtB) line?


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>