string connectionString = "Data Source=C:\\Users\\Jeewani\\Documents\\rundown.sdf;"; SqlCeConnection sql = new SqlCeConnection(connectionString); sql.Open(); string query = "select * from ItemsNames"; SqlCeCommand myCommand = new SqlCeCommand(query, sql); SqlCeDataReader reader = myCommand.ExecuteReader(); Viewer.DataSource = reader; //name of the datagridview is viewer sql.Close();
SqlCeDataAdapter sqlceda = new SqlCeDataAdapter(myCommand); DataSet dsData = new DataSet("ITEMNAMES"); sqlceda.Fill(dsData); Viewer.DataSource = ds.Tables[0];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)