You don't really bind a connection to a grid. You bind a table to a grid.
Something like:
String query = String.Format( "SELECT * FROM {0};", UpdateSelectEdit.Text );
SqlCommand cmd = new SqlCommand( query,
sqlconnect );
dataset = new DataSet();
dataadapter = new SqlDataAdapter();
dataadapter.SelectCommand = cmd;
dataadapter.Fill(dataset);
ResultGrid.DataSource = dataset.Tables[ 0 ];
In this case, UpdateSelectEdit is a TextEdit where the table name is entered
by the user. Sqlconnect is the SQL connection object.
Paul T.
"Nathan Zumwalt" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I've created an SqlCE database and I'm trying to bind it to a DataGrid
> using C#.
>
> I tried to use this code:
> http://samples.gotdotnet.com/quickst.../datagrid.aspx
>
> After converting it to C#, I get the following error:
> 'System.Data.SqlServerCe.SqlCeDataAdapter' does not contain a
> definition for 'Fill'.
>
> Am I making some newbie mistake? If this isn't the way to do it, how
> do I bind my SqlCE connection to a Datagrid?
>
> -Nathan