I thing the soluction with |DataDirectory| is good but it don't work for me.
I try this but is not work
string spoj = @"Data Source=|DataDirectory|\baza.sdf; Persist Security Info=False;";
SqlConnection konekcija = new SqlConnection(spoj);
konekcija.Open();
string upit="select * from osoba";
SqlDataAdapter da = new SqlDataAdapter(upit, konekcija);
DataSet ds = new DataSet();
da.Fill(ds, "osoba");
dataGridView1.DataSource = ds.Tables["osoba"];
If you can advice me i be grateful.

Dorababu MekaRank #457 · 5.5K reputationPosted Oct 4, 2012, 12:27 AM EDT
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True