mobile database connectivity
-
heloo can anyone plz help me out in writing a code in c# to create a databse in mobile application iama a beginner thx. in advance bascially i got this but i getsa error in "da.Fill(dt)" stating that the database table craeted in c:/ inside my project is not valid i even started the ms avtive sync and emulator plz help me out public static string connectionString = ""; public static SqlCeConnection cn = null; public static SqlCeDataAdapter da = null; public static DataTable dt = new DataTable(); connectionString = "Data Source=c:\\My Documents\\Database.sdf" ; cn = new SqlCeConnection(connectionString); da = new SqlCeDataAdapter("SELECT * FROM Users", cn); da.Fill(dt); foreach (DataRow dr in dt.Rows) { listbox1.items.add(dr[0]); }
-
heloo can anyone plz help me out in writing a code in c# to create a databse in mobile application iama a beginner thx. in advance bascially i got this but i getsa error in "da.Fill(dt)" stating that the database table craeted in c:/ inside my project is not valid i even started the ms avtive sync and emulator plz help me out public static string connectionString = ""; public static SqlCeConnection cn = null; public static SqlCeDataAdapter da = null; public static DataTable dt = new DataTable(); connectionString = "Data Source=c:\\My Documents\\Database.sdf" ; cn = new SqlCeConnection(connectionString); da = new SqlCeDataAdapter("SELECT * FROM Users", cn); da.Fill(dt); foreach (DataRow dr in dt.Rows) { listbox1.items.add(dr[0]); }
Try, da.Fill(dt,"Users"); Just a thought. Martin