TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
aleksandar ruba
NA
33
25.6k
winform and database
Oct 2 2012 4:15 AM
Hy,i wont to do winform app and the problem is database.I must put the database in aplication folder so when the aplication is instaled the database must be conected with aplication wherever is instaled and to avoid a problem if the client pc don't have instaled server or other stuff to run database.I wont to ask which database is good for this,i try to create database in visual studio 2010 but i can't get connection because my conneection string i think is not good.
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.
Reply
Answers (
1
)
Exception : The system cannot find the file specified. (Exception from HRESULT: 0x80070002) ??
USB Ports lock